0

I host a wordpress site on my server which has 2GB mem, I have used some cache plugin, but when I type ps -eo "%C : %p : %z : %a" | sort -k5 -nr in SSH, I see the httpd memory usage is very high.

15.7 :  3131 : 4732740 : /usr/local/mysql/bin/mysqld
 0.5 :  3356 : 515860 : /usr/sbin/httpd
 0.6 :  3363 : 509308 : /usr/sbin/httpd
 0.6 :  3333 : 509308 : /usr/sbin/httpd
 0.5 :  3367 : 509308 : /usr/sbin/httpd
 0.5 :  3361 : 509308 : /usr/sbin/httpd
 0.5 :  3358 : 509308 : /usr/sbin/httpd
 0.5 :  3338 : 509308 : /usr/sbin/httpd
 0.4 :  3366 : 509308 : /usr/sbin/httpd
 0.3 :  3370 : 509308 : /usr/sbin/httpd
 0.3 :  3359 : 509308 : /usr/sbin/httpd
 0.0 :  3193 : 410980 : /usr/sbin/httpd
 ...

The server always dead. I have set memory in php.ini like this:

memory_limit = 768M
memory = 20M

1 Answer 1

0

Main reason for your server load is due to memory_limit (768M) of php.ini. As your server has only 2GB ram could not able to handle if more http request made into the server leads of multiple connection of php that consume more memory. so, i suggest you to decrease the global php.ini memory_limit to optimal that is below 200M to control the load.

4
  • 1 httpd cost 50MB, if I set below 200M in php.ini, that mean my site only support 4 ips at one time? Commented Jan 19, 2013 at 8:19
  • There is no relation between php memory_limit to ip connection. Php memory_limit is for the memory of php website, whereas the connection limit are defined in httpd.conf Commented Jan 19, 2013 at 14:59
  • how many memory_limit is better? you tell me below 200M but in some blog, i saw somebody say 1/4 of total server. Do you have some authoritative article? Commented Jan 20, 2013 at 9:59
  • Memory is not that expensive today, maybe it is time to add some... Commented Jan 21, 2013 at 18:08

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.