Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon Jun 01, 2009 9:45 am 
Offline
Junior Member

Joined: Thu Dec 18, 2008 12:33 pm
Posts: 27
Hi guys,

Something weird happened today, I had a cpu spike for 2 hours, I did a restart of the server and everything went back to normal.

Is there a way to see what happened? I had a network spike, but I had spikes before and it never went over 16% cpu

I'm kinda worried right now.


Top
   
 Post subject:
PostPosted: Mon Jun 01, 2009 9:51 am 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 10:32 pm
Posts: 246
Location: NJ, USA
Your Linode was OOMing. Take a look at your console log via Lish:

http://www.linode.com/wiki/index.php/Lish_Documentation

-Tom


Top
   
 Post subject:
PostPosted: Mon Jun 01, 2009 10:03 am 
Offline
Junior Member

Joined: Thu Dec 18, 2008 12:33 pm
Posts: 27
Sorry to be such a noob, what do you mean by OOming, looking on google does not really help me.

Is there a way my server reboot itself at 100% of the cpu?


Top
   
 Post subject:
PostPosted: Mon Jun 01, 2009 10:49 am 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
He means your server ran out of memory (Out Of Memory).

You need to do one or all of the following:

1) Reconfigure your services to consume less memory
2) Switch to more memory efficient services (IE, Apache -> Lighttpd/Lightspeed/nginx/etc)
3) Increase the amount of swap space available to your node

That's my take on it, anyhow.

EDIT: Under no circumstances should you ever want a computer to reboot when it consumes 100% of the available CPU time. Because that happens extremely frequently, and is normal. Your server would do nothing but reboot all day long.


Top
   
 Post subject:
PostPosted: Mon Jun 01, 2009 10:52 am 
Offline
Junior Member

Joined: Thu Dec 18, 2008 12:33 pm
Posts: 27
I think I got it down for a while, it non stop ooming now..., and with all the links incoming I can't probably do nothing for all the day

pretty sad..


Top
   
 Post subject:
PostPosted: Mon Jun 01, 2009 11:28 am 
Offline
Junior Member

Joined: Thu Dec 18, 2008 12:33 pm
Posts: 27
ok thx for the advice,

I added 180 meg of ram for the day, and activate super cache for wordpress. I think mysql was killing my server.


Top
   
 Post subject:
PostPosted: Mon Jun 01, 2009 11:35 am 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
If you're able to log in at all (and you might be more successful with Lish at that), you should probably just shut down your web server entirely and then work on optimizing your box.

What web server do you use? Any dynamic languages enabled (PHP/Perl/etc)? Do you use MySQL? Any mail services (SpamAssasin is a memory hog)? Anything else running on the box? What Linode do you have?


Top
   
 Post subject:
PostPosted: Mon Jun 01, 2009 11:40 am 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
MySQL can be configured for various memory levels. It ships with a bunch of pre-configured config files for various memory levels. You can try swapping out your config file with one of the lower memory ones.

I'm not very familiar with WordPress, although switching out Apache for Lighttpd is probably still sound advice; unless you're using a very custom Apache config, it's usually easier to install Lighttpd than tweak Apache for lower memory usage.

Do you have enough swap space on your node? You should probably have at least as much swap as you have RAM.


Top
   
 Post subject:
PostPosted: Mon Jun 01, 2009 12:08 pm 
Offline
Junior Member

Joined: Thu Dec 18, 2008 12:33 pm
Posts: 27
can you point my to witch config files I need to change, i just saw in lish that mysql was out of memory, tahts the problem


Top
   
 Post subject:
PostPosted: Mon Jun 01, 2009 12:41 pm 
Offline
Junior Member

Joined: Thu Dec 18, 2008 12:33 pm
Posts: 27
mysql was out of memory, thats the problem, it told me in lish, so i'm very popular of some bad people overwhelming my slq db


Top
   
 Post subject:
PostPosted: Mon Jun 01, 2009 5:00 pm 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
The example config files can be found here:

/usr/share/doc/mysql-server-5.0/examples

Most of them are gzipped so you'll need to decompress them. Then you can override your existing my.cnf (which is in /etc/mysql I think).

The headers of the files say what they're good for, but here's an online list:

http://brian.moonspot.net/2008/05/06/ex ... cnf-files/

I guess you probably want my-medium.cnf

Just because it was MySQL that ran out of memory doesn't mean that MySQL was the process that was using the most memory. If Apache used up all the RAM and then MySQL tried to allocate some more, MySQL would run out of RAM even though Apache was using most of it.


Top
   
 Post subject:
PostPosted: Mon Jun 01, 2009 10:35 pm 
Offline
Junior Member

Joined: Thu Dec 18, 2008 12:33 pm
Posts: 27
thank you for the advice!

I'm still a bit shaken, It took me 4 hours to get it back online, I updated the my.cnf config, and it did took the load for 2 hours and after the load went to lower levels.

This is really unfortunate as I make revenue from ads.

I know nothing about server optimization, before today I was happy it was up and running since my disk storage update,

I added 90 meg of memory permanently, i'm on a 360, earlier you talked about the swap, is this the swap image in the linode control you talked about? or i'm wrong?


Top
   
 Post subject:
PostPosted: Tue Jun 02, 2009 3:22 am 
Offline
Junior Member

Joined: Mon Sep 22, 2008 8:41 am
Posts: 48
Location: London, UK
Karnius wrote:
I added 90 meg of memory permanently, i'm on a 360, earlier you talked about the swap, is this the swap image in the linode control you talked about? or i'm wrong?


Yes, it is it. Have a look in the menu under disk images:

xxx MB Swap Image (swap)

You can resize (increase) the swap from this menu


Top
   
 Post subject:
PostPosted: Tue Jun 02, 2009 7:25 am 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
Generally speaking, you do NOT want a large swap partition -- if you're thrashing swap, you're already on the way down and are just delaying the inevitable by a few minutes. Swap is extremely slow and is no substitute for either reducing your memory requirements or increasing available memory.

I usually run with either 128MB or 256MB, depending on how much "inactive" stuff I expect. If it's a single-purpose server, 128MB is more than enough.


Top
   
 Post subject:
PostPosted: Tue Jun 02, 2009 11:27 am 
Offline
Junior Member

Joined: Thu Dec 18, 2008 12:33 pm
Posts: 27
okay ..

My server was more stable this morning, but still crashed just now..

This is only one site, with like 5000 visit a day, I do not understand how this is crashing a dedicated.

I augmented the swap, my-medium,cfn is up and running, my last option is returning to managed hosting I think.....


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group