Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Mar 03, 2006 11:55 am 
Offline
Senior Newbie

Joined: Thu Apr 07, 2005 4:50 pm
Posts: 16
I get this email saying:

There has been a problem with the database!

This is a notice email to let you know that SMF could not connect to the database,
contact your host if this continues.

Some background of recent happenings on the server.

I have recently installed an SMF forum. I have about 90 users ... but most of time I average 15-20 users online. My linode eventually crawls to a stop, where I can't ssh into my linode, I can't get to any of my urls. So basically I have to restart the linode, and start my httpd and my mysqld services.

This all started happening after I installed the forum.

Could it be the linode is just getting overloaded? Is there any way you can check?

Thanks
Rod


Top
   
 Post subject:
PostPosted: Fri Mar 03, 2006 12:17 pm 
Offline
Senior Member

Joined: Tue Apr 27, 2004 5:10 pm
Posts: 212
To check the CPU load, run "top" from the command-line. You'll see something like this at the top of its output:
Code:
top - 10:11:53 up 6 days, 12:14,  1 user,  load average: 0.08, 0.22, 0.20

The three numbers at the end there are what you should watch to monitor the cumulative CPU load on your linode. They represent the load averaged at one, five, and ten minutes respectively. For the purposes of this example, you can think of a value of "1" to equal 100% CPU load.

Below that line (and a few other lines relating to cpu and RAM usage), you'll see a long list of all the processes running on your system. By default, they'll be sorted be CPU usage with the highest users at the top of the list. In your case, you should watch this output while people are using your forum - if you're really having a CPU load issue, you'll see either apache or mysql (or whatever RDBMS you're using) pop up to the top of the display.

The other thing you should really watch is your swap usage - I'd guess that this is actually whats causing your problems. Swap usage is also displayed by "top". If it either says that you have 0k swap free or you see your swap numbers churning around rapidly, then chances are good that you're exhausting your io_tokens and are being put on the back burner by your host node.


Top
   
 Post subject:
PostPosted: Fri Mar 03, 2006 12:25 pm 
Offline
Senior Newbie

Joined: Thu Apr 07, 2005 4:50 pm
Posts: 16
anderiv ... thanks so much for the quick response ..

top - 11:24:49 up 28 min, 2 users, load average: 0.22, 0.56, 0.46
Tasks: 59 total, 2 running, 57 sleeping, 0 stopped, 0 zombie
Cpu(s): 2.6% user, 1.6% system, 0.0% nice, 95.8% idle
Mem: 75388k total, 73916k used, 1472k free, 732k buffers
Swap: 365560k total, 109316k used, 256244k free, 7700k cached

This look bad?


Top
   
 Post subject:
PostPosted: Fri Mar 03, 2006 12:28 pm 
Offline
Senior Member

Joined: Tue Apr 27, 2004 5:10 pm
Posts: 212
No, that doesn't look too bad. Is your box being actively used now, though? None of these figures are really going to do you much good unless you catch them in the midst of seeing the poor performance.

Paste the output of this:
Code:
$ cat /proc/io_status


Top
   
 Post subject:
PostPosted: Fri Mar 03, 2006 12:30 pm 
Offline
Senior Member

Joined: Tue Apr 27, 2004 5:10 pm
Posts: 212
As an aside, put [code]...[/code] tags around these when you paste them...then they'll be rendered in monospaced fonts and will be much easier to read.


Top
   
 Post subject:
PostPosted: Fri Mar 03, 2006 12:31 pm 
Offline
Senior Newbie

Joined: Thu Apr 07, 2005 4:50 pm
Posts: 16
right now I've got 15 members online ... which is right about the average ...

Code:
io_count=973194 io_rate=1743 io_tokens=149718 token_refill=512 token_max=400000


Top
   
 Post subject:
PostPosted: Fri Mar 03, 2006 12:38 pm 
Offline
Senior Member

Joined: Tue Apr 27, 2004 5:10 pm
Posts: 212
rodman wrote:
Code:
io_count=973194 io_rate=1743 io_tokens=149718 token_refill=512 token_max=400000


BAM!!! There's your problem. Your io_tokens number is quite low, and I'm guessing that your host is frequently bottoming out and having its processes limited by the host. So...you should browse through these forums and the wiki to see about slimming down your apache and DB server installs. I've never used SMF, but if it's a well written php app, there's no reason your linode shouldn't be able to support 15 concurrent users.


Top
   
 Post subject:
PostPosted: Fri Mar 03, 2006 12:40 pm 
Offline
Senior Member

Joined: Tue Apr 27, 2004 5:10 pm
Posts: 212
FYI - forgot to include this in my last response. It's very likely that overuse of swap is causing your io_tokens to be used up.

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


Top
   
 Post subject:
PostPosted: Fri Mar 03, 2006 12:41 pm 
Offline
Senior Newbie

Joined: Thu Apr 07, 2005 4:50 pm
Posts: 16
anderiv wrote:
rodman wrote:
Code:
io_count=973194 io_rate=1743 io_tokens=149718 token_refill=512 token_max=400000


BAM!!! There's your problem. Your io_tokens number is quite low, and I'm guessing that your host is frequently bottoming out and having its processes limited by the host. So...you should browse through these forums and the wiki to see about slimming down your apache and DB server installs. I've never used SMF, but if it's a well written php app, there's no reason your linode shouldn't be able to support 15 concurrent users.


anderiv ... thank you soooo much!!!

Loooks like I'll be busy looking up some threads!!!! If you find any that you may think are helpful to me can you post them here. I'll be doing my part as well!! THANK YOU SO MUCH!


Top
   
 Post subject:
PostPosted: Fri Mar 03, 2006 12:44 pm 
Offline
Senior Member

Joined: Tue Apr 27, 2004 5:10 pm
Posts: 212
No problem - see the link I posted in my last reply.

FYI, the io_tokens value ideally should be as close to 400,000 as possible.


Top
   
 Post subject:
PostPosted: Fri Mar 03, 2006 12:50 pm 
Offline
Senior Newbie

Joined: Thu Apr 07, 2005 4:50 pm
Posts: 16
Reading the article right now ...

Code:
io_count=182213 io_rate=0 io_tokens=400000 token_refill=512 token_max=400000


hahha should look just like this eh? This is my io)count on the new linode I purchased a 160 linode to hopefully fix the problem. But it looks like I may not have had to do that!!!

If I cna get my tokens up ... i swear I'm gonna buy you a beer ... or whatever your poison is! :D


Top
   
 Post subject:
PostPosted: Fri Mar 03, 2006 1:00 pm 
Offline
Senior Member

Joined: Tue Apr 27, 2004 5:10 pm
Posts: 212
rodman wrote:
If I cna get my tokens up ... i swear I'm gonna buy you a beer ... or whatever your poison is! :D

I like beer.


Top
   
 Post subject:
PostPosted: Fri Mar 03, 2006 1:21 pm 
Offline
Senior Newbie

Joined: Thu Apr 07, 2005 4:50 pm
Posts: 16
andeiv

BEER INDEED!!

You know what .... I'm thinking it might be my SquirrelMail!!! I have noticed when I run an instance on SquirrelMail .... that's when the slowness starts!!!

I haven't run an instance of Squirrelmail for about an hour now ... and now I'm at:



Code:
io_count=2213854 io_rate=651 io_tokens=365787 token_refill=512 token_max=400000


Do you use or have ued SquirrelMail? Is it that much of a memory hog?

Thanks
Rod


Top
   
 Post subject:
PostPosted: Fri Mar 03, 2006 6:55 pm 
Offline
Senior Member

Joined: Fri Feb 17, 2006 9:47 pm
Posts: 91
I agree that uou need to keep your io tokens high, but as far as memory hogs go mysql is a killer, have you trimmed down your mysql config for a low memory configuration? That would probably help, caker has a low memory config example for mysql here:

http://www.linode.com/~caker/uml/my.cnf

Check it out, it might help.

Enjoy.


Top
   
 Post subject:
PostPosted: Sat Mar 04, 2006 3:01 am 
Offline
Senior Newbie

Joined: Thu Apr 07, 2005 4:50 pm
Posts: 16
Hey Guys .....

My my.conf file looks like this:

Code:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
skip-bdb

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid


Do I just copy and paste all that stuff from that other my.conf file? Is it weird that my my.conf file is so small and such few entries?


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


Who is online

Users browsing this forum: No registered users and 5 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