LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-10-2010, 09:16 AM   #1
MattiasKilbo
LQ Newbie
 
Registered: Jun 2009
Posts: 10

Rep: Reputation: 0
MySQL rapitly getting slower


Our MySQL 5.0.51a running on Debian Lenny is going slow a few minutes after start. There is no sign of taking a lot of resources, "top" says less than 10% cpu and less than 10% MEM.
As for now the mysqld is restarted every 7 minutes...

During startup syslog says
"InnoDB: HugeTLB: Warning: Failed to allocate 8404992 bytes. errno 12"

php-cgi segfaults just after restart and
"WordPress database error MySQL server has gone away for query" as expected(?) (there is no db for a few seconds)

The database is 700 Mb, 3300 tables and running Wordpress. mysql and php runs of different machines.


Please help!
 
Old 11-10-2010, 09:26 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,824

Rep: Reputation: 8232Reputation: 8232Reputation: 8232Reputation: 8232Reputation: 8232Reputation: 8232Reputation: 8232Reputation: 8232Reputation: 8232Reputation: 8232Reputation: 8232
Quote:
Originally Posted by MattiasKilbo View Post
Our MySQL 5.0.51a running on Debian Lenny is going slow a few minutes after start. There is no sign of taking a lot of resources, "top" says less than 10% cpu and less than 10% MEM.
As for now the mysqld is restarted every 7 minutes...

During startup syslog says
"InnoDB: HugeTLB: Warning: Failed to allocate 8404992 bytes. errno 12"

php-cgi segfaults just after restart and "WordPress database error MySQL server has gone away for query" as expected(?) (there is no db for a few seconds)

The database is 700 Mb, 3300 tables and running Wordpress. mysql and php runs of different machines.
Well, there's not alot we can help you with, since there's not enough details. How much memory is on the machine? CPU? 3300 tables is a bit high, but how many transactions/users are running through this DB?

And did you try to look up the error you're getting????
http://forums.mysql.com/read.php?24,196455,196476

You're going to have to modify things to use huge pages.
 
Old 11-10-2010, 10:02 AM   #3
MattiasKilbo
LQ Newbie
 
Registered: Jun 2009
Posts: 10

Original Poster
Rep: Reputation: 0
There are 2 cpus with 2 cores each and 8 Gb memory.
I do not know the exact number of transactions/users, but max ~ 30 pageview / minute.
The server should have no problem with this.

Cpu(s): 0.8%us, 0.2%sy, 0.0%ni, 98.8%id, 0.0%wa, 0.0%hi, 0.2%si, 0.0%st
Mem: 9169304k total, 5824604k used, 3344700k free, 50844k buffers
Swap: 2650684k total, 0k used, 2650684k free, 856628k cached



Yes I have read that thread and followed the guide here:
http://www.cyberciti.biz/tips/linux-...rformance.html

cat /proc/meminfo | grep Huge
HugePages_Total: 40
HugePages_Free: 40
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB

Looks like mySQL is not using any of it (HugePages_Free: 40)
 
Old 11-10-2010, 10:18 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,824

Rep: Reputation: 8232Reputation: 8232Reputation: 8232Reputation: 8232Reputation: 8232Reputation: 8232Reputation: 8232Reputation: 8232Reputation: 8232Reputation: 8232Reputation: 8232
Quote:
Originally Posted by MattiasKilbo View Post
There are 2 cpus with 2 cores each and 8 Gb memory. I do not know the exact number of transactions/users, but max ~ 30 pageview / minute. The server should have no problem with this.

Cpu(s): 0.8%us, 0.2%sy, 0.0%ni, 98.8%id, 0.0%wa, 0.0%hi, 0.2%si, 0.0%st
Mem: 9169304k total, 5824604k used, 3344700k free, 50844k buffers
Swap: 2650684k total, 0k used, 2650684k free, 856628k cached

Yes I have read that thread and followed the guide here:
http://www.cyberciti.biz/tips/linux-...rformance.html

cat /proc/meminfo | grep Huge
HugePages_Total: 40
HugePages_Free: 40
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
Looks like mySQL is not using any of it (HugePages_Free: 40)
Well, if it's not using it, then there's obviously some part of the configuration that was missed. The link to the MySQL forums page had troubleshooting info on it, since it dealt with that topic specifically.
 
Old 11-10-2010, 11:48 AM   #5
MattiasKilbo
LQ Newbie
 
Registered: Jun 2009
Posts: 10

Original Poster
Rep: Reputation: 0
It seems like I placed "ulimit -l unlimited" at the wrong place.
It is now in the mysql initscript

Almost, there
"InnoDB: HugeTLB: Warning: Failed to allocate 8404992 bytes. errno 12" is gone but
"Warning: Failed to allocate 952107008 bytes from HugeTLB memory. errno 12"

So it can allocate 8 404 992 bytes but not 952 107 008
 
Old 11-11-2010, 11:49 AM   #6
MattiasKilbo
LQ Newbie
 
Registered: Jun 2009
Posts: 10

Original Poster
Rep: Reputation: 0
It turns out that
HugePages_Total: 40
Hugepagesize: 2048 kB

40 * 2048 k > 8404992
but
40 * 2048 k < 952107008

So to summarize, for those with the same problem:
Follow the guide here
http://www.cyberciti.biz/tips/linux-...rformance.html
change
vm.nr_hugepages= X
where X should be more than
Failed to allocate 952107008 bytes / Hugepagesize / 1000
and X * 2048 k should be less than your mem.

Add
ulimit -l unlimited
to mysql initscript
run sysctl -p

restart mysql
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL 20x slower on NFS share mijohnst Linux - General 3 04-05-2011 09:01 AM
[SOLVED] LXDE suddenly getting slower and slower Aquarius_Girl Linux - Newbie 1 09-22-2010 05:22 AM
FC6 gets slower and slower and slower... jonrpick Linux - Software 19 11-12-2007 03:02 PM
Why is Mandrake/KDE getting slower and slower? KWTm Mandriva 12 09-28-2004 09:43 PM
Internet connection becomes slower and slower. caesius_01 Linux - General 1 03-14-2004 02:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration