Connecting Tech Pros Worldwide Forums | Help | Site Map

30 Simultaneous Processes

Newbie
 
Join Date: Sep 2009
Location: Melbourne, Florida
Posts: 5
#1: Oct 8 '09
Hello:

(I posted related thread about a month ago. New information here.)

My ISP tells me that the Perl script I run on their server creates more than 30 processes simultaneously during peak Internet hours. How do I know? Because they shuts me down when the 30 process limit is hit. Ugh.

When I use SSH to view my process count (ps command), I can see 4 processes when idle, which jumps to 10 immediately after I refresh my home page. The home page is a Perl CGI script. The 10 processes stick around for 5 seconds or so, then it reverts back to the 4 idle processes. Here's the right portion of what the ps command produces:

==== when script is idle:

ps -ux
STARTED TIME COMMAND
11:55PM 0:00.17 sshd: coinqu@ttyp1 (sshd)
12:12AM 0:00.13 proftpd: coinqu - 24.110.45.14: IDLE (pr
11:55PM 0:00.06 -tcsh (tcsh)
12:36AM 0:00.00 ps -ux

==== for 5 seconds after I execute my script:

ps -ux
STARTED TIME COMMAND
Thu09PM 1:38.52 /usr/local/apache/bin/httpd
Thu10PM 1:55.65 /usr/local/apache/bin/httpd
11:55PM 0:00.17 sshd: coinqu@ttyp1 (sshd)
12:12AM 0:00.13 proftpd: coinqu - 24.110.45.14: IDLE (pr
12:29AM 0:00.05 /usr/local/apache/bin/httpd
12:29AM 0:00.10 /usr/local/apache/bin/httpd
12:36AM 0:00.00 /usr/local/apache/bin/httpd
Thu07PM 1:51.39 /usr/local/apache/bin/httpd
11:55PM 0:00.06 -tcsh (tcsh)
12:36AM 0:00.00 ps -ux

I'm no shell expert. Can you guys tell me if this behavior is normal or not? It appears that my single Perl script is creating 6 Apache/HHTP processes, and that these processes continue to run for about 5 seconds after they are done. Does this look normal? I am opening several DBM databases and locking one flat file during script execution with code that looks like this:

Expand|Select|Wrap|Line Numbers
  1. $db_msg_dbase = $loc_path_data_rw.'/db_msg_record_by_id';
  2. $db_msg_go = dbmopen(%db_msg_record_by_id,$db_msg_dbase,0666);
Expand|Select|Wrap|Line Numbers
  1. $db_msg_lock = $loc_path_data_rw.'/db_msg_lock.txt';
  2. open(MSG,">$db_msg_lock");
  3. flock(MSG,2);
All code is plain vanilla (I'm a old C and Fortran guy, can't you tell?). I appreciate any help. Jeff and RonB were big helps last time. Thanks!

Paul Richards
Melbourne, FL
numberwhun's Avatar
Site Moderator
 
Join Date: May 2007
Location: New Hampshire
Posts: 2,569
#2: Oct 8 '09

re: 30 Simultaneous Processes


Can you do me a favor? Post a link to your other thread and also show us your script? I definitely want to see what your code it doing. Thanks!

Jeff
Newbie
 
Join Date: Sep 2009
Location: Melbourne, Florida
Posts: 5
#3: Oct 8 '09

re: 30 Simultaneous Processes


Thanks, Jeff. You guys are right on top of things. The original post is at:

I've Hit the Process Limit

and I've put the offending Perl script at this web link:

http://statmatics.com/for_bytes/

This script runs a web site called CoinQuest, which I use to do rare coin appraisals. You can view CoinQuest here:

http://coinquest.com

-- Paul R.
Reply