I am running a directadmin server that shows me the httpd PIDs. Every 10 minutes or so there are thousands of PIDs listed and it slows down the site a lot. By deleting it it helps to cut the load for a while. I don't know if deleting the processes is a good thing or not but I'd like to automatically delete them every once in a while if you think it's alright. How can I accomplish that? Thanks.
Well cron job to kill the process id's would do it but I think your attacking this from the wrong spot. What is causing the spawn? You need to do some straces and find out the root of the problem and correct it. If it is mysql running wild or possible exploit etc. You could also have apache or your web server limit the number of processes allowed. Blindly killing processes like that can be very bad especially if it is passing data back and forth on a transaction to a database etc. I would also imagine you have tons of stale sessions in tmp logs as well. Start looking for the problem. Is this a shared host?
Did a search through and there are no exploits. It is a dedicated server. I'll look into the number of processes allowed. You think something like 25 is reasonable? By the way what logs should I look into? Thanks.
Depends how busy the server is. If oyu have thousands of users then 25 might not cut it and can have negative impact on overall performance. Look into : /var/log/apache/error.log /var/log/system /var/log/messages File locations might vary a bit depending on distro. Also don't take this the wrong way or anything but your a web hosting company and don't know what logs to look at? Also was apache pre compiled or was it done from scratch?