My linode keeps failing

I have no idea what the culprit is. Here's what the munin says:

http://www.nexbo.com/munin/

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

Post some more details about your server and issues specifically. There is a lot of great help around here.

If you'd rather pay, I'd be happy to take care of the problem for you. :D

I'd make a wild guess and say, you got a surge in traffic, Apache went nuts trying to handle it, and your box OOMed and started killing processes… But that's just wild speculation without knowing anything more about the issue.

The munin graphs don't look like the box OOMed, but if it happened very quickly it might not have been graphed. Please tell us more symptoms of "failing". Exactly what doesn't work? What do the CPU/network/IO graphs look like in your linode manager?

  • 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.

Thanks all for the help.

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: http://library.linode.com/troubleshooti … networking">http://library.linode.com/troubleshooting/memory-networking

Restarted my box and will let you know how it goes.

..and how did it go?

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?

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.

@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?

Omit threadstack (i.e. leave it at the default of 192k) unless you have a lot of recursive procedures – in which case you'll get an error and need to increase it. I would go with the sortbuffersize = 512K and netbufferlength = 8K from my-medium.cnf. tablecache should be at least as big as max_connections (default is 100).

Just a thought – from your other thread -- Apache needs its memory footprint reducing as well.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct