30 Simultaneous Processes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • statmatics
    New Member
    • Sep 2009
    • 5

    30 Simultaneous Processes

    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:

    Code:
    $db_msg_dbase = $loc_path_data_rw.'/db_msg_record_by_id';
    $db_msg_go = dbmopen(%db_msg_record_by_id,$db_msg_dbase,0666);
    Code:
    $db_msg_lock = $loc_path_data_rw.'/db_msg_lock.txt';
    open(MSG,">$db_msg_lock");
    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
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    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

    Comment

    • statmatics
      New Member
      • Sep 2009
      • 5

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



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



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



      -- Paul R.

      Comment

      Working...