Questions about CPU and ram/swap usage

I have a 512 Linode for a Mediawiki site (on Nginx) with about 10K views a day (actually slightly more because logged users are not counted in these stats). So it could be 12K views a day.

The 5 minutes CPU average used to be around 10% but recently its been going around 30-40%. Once it hit 160% for a few hours. My question: (1) Do I have to worry about CPU usage? I don't want to be contacted by Linode for using too much CPU. So yea, how much CPU can I use? I know that one response is "if its idle, I can use all of it". But is it ok if I keep using 160%, in a hypothetical situation? I just want to know my limits so I can take action when I need to.

I come from a Shared server where I was asked to leave because of the CPU (our site had grown and we could not use a shared server any longer)

The description for a 512 Linode says "8 CPU (1x priority)". Looks like if there's a 1024 Linode on the same server, they'll get twice the priority and if there's other 512 Linodes, they all share the CPU equally.

Also, (2) that CPU in the graphs is only my own usage, correct? Or is that how much CPU the server is having for all the accounts on it? I mean it would drop down to 0% if I disabled my account.

I'm trying 'top' and its the php5-fpm that takes most of the CPU (web requests for PHP files).

Also, (3) how can I see the live reporting for web access that shows all the current requests with the IP addresses? I want to see what pages are being requested. I might have to check if a spam bot is requesting too many pages and trying to enter data into the wiki. In the past I've downloaded the access logs and ran them through a log analyzer. I might try that again but I'm wondering if there's any 'live' reporting too.

(4) Last question about ram/swap: Out of the 512MB memory or ram, 50-150MB is free. Is that fine? I wonder what I can do over there. mysql takes up 25% of that. Out of 256MB swap, about 90MB is being. When should be I worried for these numbers?

3 Replies

As an aside, Linode doesn't mix and match the types of Linode between hosts (or at least they didn't used to). So if you're a 512, there are nothing buy 512s on the same host.

In terms of what is the maximum acceptable CPU usage that you can sustain without Linode complaining, I believe it is currently 800% (as in, they will never complain about your CPU usage) :)

You could look into using memcached http://wiki.nginx.org/NginxHttpMemcachedModule to reduce the load on your Linode.

Optimizing mysql will help with ram usage. I have a config here you could tweak:

http://p.linode.com/7463

40% CPU out of 800% isn't so much of an issue. Worst case senario, we just open a ticket and ask you to optimize your services. The graphs in the Linode Manager show your own CPU usage, not a total for the whole server.

for website access monitoring you could use awstats - http://awstats.sourceforge.net/ or pwiki - http://piwik.org/

You'll want to try and reduce swap usage as this can slow down your running processes. Reducing your Ram use or upgrading your Linode plan should help with this.

800%, that's great, thanks guys. Looks like its not too critical then. I will still look into how I can use less resources.

Thanks Mesk, that link isnt working. Another link?

I'll bookmark this thread as a reference for future.

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