I have installed php5 in ubuntu and wordpress.it can run after installed.but after few days I've found there are lots of process and occupied a lot of memories. I try to use

ps -aux|grep www-data

and found about 30 processes like this.

www-data  5066  0.0  0.0 131664   780 ?        S    16:20   0:00 /usr/sbin/php5-fpm --fpm-config /etc/php5/fpm/main.conf

I tried to

kill -9 pid

and it didn't work, more process appears again. So could you tell me how to kill them safely and I don't want to my vps' memory occupied by it.

link|improve this question
feedback

migrated from stackoverflow.com Nov 4 '11 at 8:00

This question came from our site for professional and enthusiast programmers.

1 Answer

Try here, I think its the same problem :)

http://serverfault.com/questions/89616/how-to-stop-www-datas-apache-processes

"Apache running as www-data is the default in Debian Lenny. You might be confusing a single 'parent' apache process (running as root) with apache 'children' doing HTTP request processing (running as www-data). Both 'parent' and 'children' processes should look like they were started with /usr/sbin/apache2 -k start (when you ps aux | grep apache), and the only difference is the process owner.

To control init startup scripts you could use sudo sysv-rc-conf (sudo aptitude install sysv-rc-conf if you don't have it - it is just an easy curses-like Perl wrapper for init scripts)." -Chronos

So each process is child process dealing with http requests, if yo really want to kill them either kill the process with sudo kill PID or maybe /usr/sbin/apache2 -k stop.

Tom

link|improve this answer
There is also one process that belongs to root and not www-data. This one is needed to bind to port 80 but will not actually do anything else for safety reasons. – Christoph Grimmer-Dietrich Nov 2 '11 at 8:51
i do not want to stop nginx or apache ,just think the memory it used may be too large.could you give me a solution that can optimize it or let the memory it occupied be fewer? – yudun1989 Nov 2 '11 at 9:56
Apache is never going to be super memory efficient. If you want to really minimize your memory usage, maybe use another web server such as lighttp lighttpd.net. If your hell-bent on streamlining Apache, maybe try wiki.joyent.com/display/gen/Tuning+Apache. – Xleedos Nov 2 '11 at 11:32
Also take not of the bottom of this page, soporte.ideasmultiples.com/…. Basically you can tune your Apache to have less spare children, this will save memory. Hope this helps :) – Xleedos Nov 2 '11 at 11:35
feedback

Your Answer

 
or
required, but never shown