| Author |
Message |
rodman
Joined: 07 Apr 2005
Posts: 12
|
| Posted: Fri Mar 03, 2006 10:55 am Post subject: database error? or host error? |
|
|
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 |
|
| Back to top |
|
anderiv
Joined: 27 Apr 2004
Posts: 130
|
| Posted: Fri Mar 03, 2006 11:17 am Post subject: |
|
|
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. |
|
| Back to top |
|
rodman
Joined: 07 Apr 2005
Posts: 12
|
| Posted: Fri Mar 03, 2006 11:25 am Post subject: |
|
|
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? |
|
| Back to top |
|
anderiv
Joined: 27 Apr 2004
Posts: 130
|
| Posted: Fri Mar 03, 2006 11:28 am Post subject: |
|
|
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 |
|
| Back to top |
|
anderiv
Joined: 27 Apr 2004
Posts: 130
|
| Posted: Fri Mar 03, 2006 11:30 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
rodman
Joined: 07 Apr 2005
Posts: 12
|
| Posted: Fri Mar 03, 2006 11:31 am Post subject: |
|
|
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 |
|
| Back to top |
|
anderiv
Joined: 27 Apr 2004
Posts: 130
|
| Posted: Fri Mar 03, 2006 11:38 am Post subject: |
|
|
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. |
|
| Back to top |
|
anderiv
Joined: 27 Apr 2004
Posts: 130
|
| Posted: Fri Mar 03, 2006 11:40 am Post subject: |
|
|
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 |
|
| Back to top |
|
rodman
Joined: 07 Apr 2005
Posts: 12
|
| Posted: Fri Mar 03, 2006 11:41 am Post subject: |
|
|
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! |
|
| Back to top |
|
anderiv
Joined: 27 Apr 2004
Posts: 130
|
| Posted: Fri Mar 03, 2006 11:44 am Post subject: |
|
|
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. |
|
| Back to top |
|
rodman
Joined: 07 Apr 2005
Posts: 12
|
| Posted: Fri Mar 03, 2006 11:50 am Post subject: |
|
|
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 |
|
| Back to top |
|
anderiv
Joined: 27 Apr 2004
Posts: 130
|
| Posted: Fri Mar 03, 2006 12:00 pm Post subject: |
|
|
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. |
|
| Back to top |
|
rodman
Joined: 07 Apr 2005
Posts: 12
|
| Posted: Fri Mar 03, 2006 12:21 pm Post subject: |
|
|
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 |
|
| Back to top |
|
cherring
Joined: 17 Feb 2006
Posts: 83
|
| Posted: Fri Mar 03, 2006 5:55 pm Post subject: |
|
|
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. |
|
| Back to top |
|
rodman
Joined: 07 Apr 2005
Posts: 12
|
| Posted: Sat Mar 04, 2006 2:01 am Post subject: |
|
|
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? |
|
| Back to top |
|
| |