[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cobalt-users] [RAQ3] Runaway process control?



We have a client whose site runs an e-commerce solution which will remain nameless - anyway, their particular store has about 10,000 product lines - this in itself is NOTHING too problematic - however, the problems occur with one of their store sections, namely Semiconductors.  This category has quite a few thousand items in it - which results in an HTML file of around 400kb in size.

Again - this file is not the problem - but when someone searches for a particular product, and the result is on this HUGE file, the browsing public causes a CGI script to read and parse the offending HTML file, in order to highlight the search phrases.

This process can take quite a long time - our research has shown that their viewers are impatient enough to click the back button, click the result again, and repeat the process, and repeat, repeat, repeat - before getting bored.

How is this a problem?   Well... .each time some impatient browser does this, the server fires up cgi to serve the page - each of these cgi script has been known to consume about 60Mb of RAM!

Now - I found no less than 24 of these processes today - each using 60Mb of RAM - or rather - 60Mb of SWAP in most cases.  These processes invariably end up sitting around for ages trying to send out data to a port that is no longer waiting for it - this uses CPU and HUGE amount of RAM - plus it puts the server into SWAP mode pretty darned quickly.

Here is part of the top from a few minutes ago:

[admin@ns admin]$ top
  3:22pm  up 1 day,  4:25,  3 users,  load average: 30.42, 48.38, 58.17
168 processes: 161 sleeping, 7 running, 0 zombie, 0 stopped
CPU states: 20.2% user,  6.4% system,  0.6% nice, 30.7% idle
Mem:   192748K av,  190576K used,    2172K free,   38864K shrd,    3932K buff
Swap:  655816K av,  600208K used,   55608K free                   18196K cached

  PID USER     PRI  NI  SIZE  RSS SHARE STAT  LIB %CPU %MEM   TIME COMMAND
21618 admin     15   0   916  916   656 R       0 13.0  0.4   0:00 top
21086 USERNAME  15   0 41444 9524   832 R       0  8.2  4.9   0:27 sh000002.cgi
21083 USERNAME  15   0 40808 5280   760 R       0  7.5  2.7   0:26 sh000002.cgi
21084 USERNAME  15   0 42336  10M   852 R       0  6.8  5.5   0:27 sh000002.cgi
21090 USERNAME  15   0 28368 5524   156 R       0  6.8  2.8   0:23 sh000002.cgi
21085 USERNAME   4   0 40516 9984   880 D       0  5.5  5.1   0:26 sh000002.cgi
21091 USERNAME   2   0 40516 4780   820 D       0  2.7  2.4   0:25 sh000002.cgi


Apart from adding more physical RAM - does anyone have a solution for throttling these processes, or at least killing them off if they sit for a while spinning their heels?

My immediate solution is to move the client to another machine with maxxed out RAM - but I'm sure this is going to happen again - no matter how much RAM the machine has, this is going to be a problem.  We are working with them to reduce the size of their pages but I'm running out of patience on this one.

tia

Greg Hewitt-Long
-- 
http://www.webyourbusiness.com/
Providers of E-Commerce Software &
Web Design Consultancy and Services.
PH: (970) 266-0195   FAX: (970) 266-0158