New client, linode is OOMing.

I just got tasked with deploying a heavily trafficked Wordpress blog to Linode.

I used Linode's Wordpress Stackscript (~~[https://www.linode.com/stackscripts/view/?StackScriptID=12" target="_blank">](https://www.linode.com/stackscripts/vie … criptID=12">https://www.linode.com/stackscripts/view/?StackScriptID=12]().

Current plan: Linode 2048.

As soon as I start up MySQL and Apache, available memory starts dropping, and eventually i'm OOMing. Within like 10 minutes.

I've tried fine tuning MySQL and Apache config files.

I've tried running mysqltuner.pl. She also has WP Super Cache running with mod_rewrite.

Any other ideas? Any information that I can give you guys to help me, please let me know. I didn't think this size Linode would just be 100% taxed.

She's moved over from Pressable. I think her monthly pageviews are around 400k. She's also heavy on the images (style blogger). Is a bigger Linode really what she needs?

http://damselindior.com

Thanks for any help, struggling for a solution over here.

11 Replies

A video for tuning mysql: http://mirror.linux.org.au/linux.conf.a … _Lloyd.mp4">http://mirror.linux.org.au/linux.conf.au/2014/Thursday/257-EasyMySQLserverperformancetuningforeveryone-why8MBisnotenoughand256KBdefinitelyis-Trent_Lloyd.mp4

There's probably reasonable guide for configuring apache (or switch to nginx - there's a few good config templates on github).

Make sure cache control headers are set on static content.

@danblack:

A video for tuning mysql: http://mirror.linux.org.au/linux.conf.a … _Lloyd.mp4">http://mirror.linux.org.au/linux.conf.au/2014/Thursday/257-EasyMySQLserverperformancetuningforeveryone-why8MBisnotenoughand256KBdefinitelyis-Trent_Lloyd.mp4

There's probably reasonable guide for configuring apache (or switch to nginx - there's a few good config templates on github).

Make sure cache control headers are set on static content.

Yea I've been going back and forth with MySQL and Apache tuning, literally all day.

I caved, upgrading to more memory.

Maybe if she sized her photos for the web, it wouldn't need so much ram.

Yea, upping the ram from 2 to 4GB has alleviated the problem.

She also would benefit from picking the right image types for the site. Looking quickly, her About page is filled with *.png files (the FAQ says she does her own image work in Photoshop). I feel JPEGs would be most appropriate for those types of images and get things smaller without sacrificing quality.

Edit: Looks like she's using JPEGs on the rest of the site (large high quality compression ones), so the few *.png files are probably not a big deal.

@vonskippy:

Maybe if she sized her photos for the web, it wouldn't need so much ram.

Edit 2: …though the overall bloat of the images are! I'm not surprised about the load issues when she has a 5.8 MB home page for a site with that kind of traffic.

I second examining cache settings. I'm still learning about how to better cache things, and it definitely makes a big difference.

Is 5.8MB really such a big issue in this day and age? Especially if the images are loading from top to bottom, the stuff above the fold would load very quickly on a broadband connection. The page appears to load pretty much instantly here.

mctenold, have you thought of using a Fast-CGI/PHP-FPM setup for handling the dynamic content? It could alleviate the stress being put on apache by WP.

Hi, if I can just jump in on this thread, because I had the same problem today.

It came about on one of my clients sites, SaveTheGreatSouthBay.org.

He was on HuffPo today and the traffic ate up CPU until he used 101% of avail memory according to Plesk. The monitor on the dashboard had clear moments where the CPU went to zero. He is running Total Cache with WP and we're offloading images to Amazon S3, so that wasn't the issue.

We're also using NGINX, but I'm not an NGINX expert and am not sure if that needs performance tuning as well.

Here's a screenshot of traffic - jumped to around 45 M bits/second at around 2 pm.

~~![](<URL url=)http://digitalstrategyworks.com/files/2 … .14-PM.png">http://digitalstrategyworks.com/files/2014/05/Screen-Shot-2014-05-07-at-11.35.14-PM.png" />

~~![](<URL url=)http://digitalstrategyworks.com/files/2 … .33-PM.png">http://digitalstrategyworks.com/files/2014/05/Screen-Shot-2014-05-07-at-11.41.33-PM.png" />

I could do one of the following:

1. Upgrade the Linode from 4096 to 8192 and see if that handles the issue.

2. Make the following recommended change.

Currently, this is my my.cnf

* Fine Tuning

#

key_buffer = 16M

maxallowedpacket = 16M

thread_stack = 192K

threadcachesize = 8

This is the recommend my.cnf at this link https://library.linode.com/troubleshoot … networking">https://library.linode.com/troubleshooting/memory-networking

key_buffer = 16K

maxallowedpacket = 1M

thread_stack = 64K

table_cache = 4

sort_buffer = 64K

netbufferlength = 2K

If it do this and reboot the server, will that really have a noticeable impact on performance? Will I cause any issues? If I have to restore from backup will my.cnf revert back to the old settings?

3. Add another Linode and the nodebalancer. Not sure how to clone my Linode and keep both of them updated at the same time while shifting traffic with the nodebalancer.

Would love to get some recommendations. Thanks.~~~~

What you need to do is figure out where that traffic spike came from, what request was responsible for it, and if it is intended that way, and where it caused load/memory issues. Was it really MySQL using all the memory? Or was it PHP? Or something else alltogether? Then see how you can tune that service. But just trying stuff out while not knowing for sure if that was the service responsible for the issues won't help.

That's what I'm trying to do now. I'm working on installing Longview, but I'm not sure if that's going to show me what happened two days ago.

This might be helpful in trying to isolate it:

http://www.sysdig.org/

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