Anatole
01-26-2002, 08:05 PM
Due to some configuration issues, I cannot run Apache with RLimitCPU. Now question:
How to kill -9 only those httpd processes that run longer than for 3 minutes? Maybe a script to run via cron job every 3 minutes and kill such processes?
Matt Lightner
01-26-2002, 11:49 PM
Originally posted by Anatole
Due to some configuration issues, I cannot run Apache with RLimitCPU. Now question:
How to kill -9 only those httpd processes that run longer than for 3 minutes? Maybe a script to run via cron job every 3 minutes and kill such processes? You could write a script to run in the background and log the running processes every 10 or 15 seconds. It will then be able to keep track of the information associated with each process, and know when it is time to kill a given process.
AlaskanWolf
01-27-2002, 03:56 AM
can someone shed some light on what RLimitCPU and MEM exactly does?
say i set the RLimitCPU to 2 or 3 or 100, what would that mean for apache running on my server?
likewise with the mem side of it, i have 1 gig of ram, if i set it to say 40 megs what would basically happen?
Matt Lightner
01-27-2002, 04:51 AM
Originally posted by AlaskanWolf
can someone shed some light on what RLimitCPU and MEM exactly does?You may find this link useful:
http://httpd.apache.org/docs/mod/core.html#rlimitcpu
AlaskanWolf
01-27-2002, 05:11 AM
well i already read those last night, i was looking for some ummm...laymans terms rather then technical :)
Anatole
01-27-2002, 06:47 AM
RLimitCPU basically limits time for a CGI process. For example,
if you place RLimitCPU 25 somewhere in <VirtualHost>, that virtual server will not have ability to run scripts that lasts more than 25 seconds. Such CPU intensive processes will be killed.
If you combine RLimitCPU with suexec, you will get pretty much control over CPU resources.
RLimitMEM limits an amount of memory that a process can allocate.
My standard parameters are:
RLimitCPU 10 20
RLimitMEM 10000000 20000000
Going back to my question: does anybody have a scipt that kills long running httpd processes?
cperciva
01-27-2002, 08:32 AM
You should never use the RLimit directives; using the operating system's login classes provides much better functionality.
But returning to the original question, why can't you just use MaxRequestsPerChild?
Anatole
01-27-2002, 09:47 AM
Because I do not use Apache 2.0, yet.
Also, again, I was looking for a solution to automatically kill httpds which are older than 3 minutes. Some script maybe, which runs as a cron job. Someone knows such a script?
The server uptime is almost 180 days, I want to try getting 365 days of uptime for it ;)