By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,374 Members | 1,939 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,374 IT Pros & Developers. It's quick & easy.

30 Simultaneous Processes

P: 5
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
Oct 8 '09 #1
Share this Question
Share on Google+
2 Replies


numberwhun
Expert Mod 2.5K+
P: 3,503
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
Oct 8 '09 #2

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

http://bytes.com/topic/perl/answers/...-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.
Oct 8 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.