My linode keeps failing
How can I know exactly which PHP scripts from all the websites I have on my linode that are costing the most server resources such as RAM? Can you please also point me to some reputable paid server optimization services? Thanks!
9 Replies
If you'd rather pay, I'd be happy to take care of the problem for you.
If you're using MySQL heavily, find out which queries are taking a long time. Google "mysql slow query".
Check the system logs for any mention of OOM (out of memory), segfault, "kill", etc.
Keep Apache's ServerLimit and MaxClients below 25. Find the memory_limit line in your php.ini and make sure it's reasonable, such as 32M. Some distros have a default of 128M, which is too high for a linode 512. Restart Apache. If you notice that some script doesn't work anymore, it might be the culprit.
Hi, hybinet, may I know what logs should I look at in this case? Where are they located?
I have configured PHP as you have advised. I have also optimized Apache2 and MySQL the way described at here:
Restarted my box and will let you know how it goes.
I noticed this in that linode document:
In your MySQL configuration file (typically found in /etc/mysql/my.cnf), change your entries for the various settings shown below to match the recommended values:
key_buffer = 16K
maxallowedpacket = 1M
thread_stack = 64K
table_cache = 4
sort_buffer = 64K
netbufferlength = 2K
now, key_buffer is default 16M , they suggest changing it to 16k ?
is that a typo?
@pclissold:
It looks like a leftover from when the smallest Linode had 64M of memory – it's the value suggested in the example file my-small.cnf. You can stick with 16M, the value from my-medium.cnf.
OK, thanks! Do the other values look reasonable still?