Hi. I am looking for a way to limit the amount of memory and cpu used by the apache daemon, since the web machine is very resource-limited. I know I can reduce the maximum number of servers, but that doesn't limit usage by each server. Perhaps a default "nice" level would also help. How do you set the default nice for a user?
The thing is, would either of these stop something like a while(true) loop, which allocated memory? I've been making some changes to the apache daemon mod_perl setup recently and I end up being locked out because something swamps out the system. I get `half-connects' where, for instance, ssh/telnet connects but then just sits there until it times out. This sounds exactly like a thrashing problem. I had a top running and kswapd seemed to be the last thing I saw before it hung. Maybe this is a kernel level thing? Is there something like a high-watermark process killer that I could use, ie something which started rampaging around when memory usage crept above a certain level? Note that I think the problem will probably settle out once I've stopped making so many changes to the apache setup but, for now, it is a pain to have to ask for my machine to be powercycled. Regardless, it would be nice to know I have a safety net, just in case. Thanks, -- Mike