Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We one mysql server suddenly the access to it becomes slow of out sudden. So I read some place they said maybe due to var size is it? I am not too sure any idea how to check the root cause of it. The cpu is like nearly 150%. Any indication on it. I have tried this so far.

du -sh *
4.0K    account
67M     cache
4.0K    cvs
16K     db
8.0K    empty
4.0K    games
4.0K    gdm
148G    lib
4.0K    local
16K     lock
624M    log
0       mail
4.0K    nis
4.0K    opt
4.0K    preserve
400K    run
298M    spool
4.0K    tmp
359M    www
12K     yp
share|improve this question

closed as not a real question by womble, Michael Hampton, Tim Brigham, rnxrx, EEAA Aug 24 '12 at 3:51

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Have you tried logging slow queries? dev.mysql.com/doc/refman/5.1/en/slow-query-log.html –  Ynhockey Mar 25 '12 at 9:52
    
You should also be logging everything you can about performance statistics using something like Cacti or Zabbix with the Better Cacti Templates or the Zabbix Appaloosa Templates respectively. –  Ladadadada Mar 25 '12 at 11:44

1 Answer 1

up vote 1 down vote accepted

/var/lib is really big, and mysqls data directory resides there by default in many distributions. Can you do a du -sh of /var/lib, and in case mysql is there do a du -sh of that directory too.

You might want to try out mysqltuner.pl, to get an overview of how much data and indexes you have, how the buffers and caches are trimmed, your amount of queries and slow queries (etc etc).

share|improve this answer
    
I did this du -sh in /var/lib it gives me 148G. Actually this just shows the disk usage rite. I have done on the indexes previously all was working fine and nearly a year later now suddenly I am having problem. The connection is made via another web server to this db server can the web server also be having some problems? –  user111196 Mar 25 '12 at 10:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.