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.

I have 1GB Linode VPS with a standard LAMP stack. Apache is tuned fine but for some reason MySQL's disk usage is high. This is causing really slow site load times. RAM and CPU usage are fine.

Can anyone give me any pointers on tuning mysql's disk performance? I'm using InnoDB. iotop output is below.

    Total DISK READ: 38.50 M/s | Total DISK WRITE: 27.20 K/s
  TID  PRIO  USER    DISK READ>  DISK WRITE  SWAPIN      IO    COMMAND                                                                                                                                                                                                    
 9808 be/4 mysql      22.40 M/s    0.00 B/s  0.00 % 63.75 % mysqld
10045 be/4 mysql       2.06 M/s    0.00 B/s  0.00 % 26.65 % mysqld
 9987 be/4 mysql    1694.38 K/s    0.00 B/s  0.00 % 18.33 % mysqld
10015 be/4 mysql    1554.47 K/s    0.00 B/s  0.00 % 12.71 % mysqld
10019 be/4 mysql    1461.21 K/s    0.00 B/s  0.00 %  5.58 % mysqld
 9839 be/4 mysql    1383.48 K/s    0.00 B/s  0.00 % 25.69 % mysqld
10031 be/4 mysql    1243.58 K/s    0.00 B/s  0.00 %  5.68 % mysqld
10023 be/4 mysql    1057.04 K/s    0.00 B/s  0.00 %  2.02 % mysqld
10020 be/4 mysql    1025.95 K/s    0.00 B/s  0.00 %  7.05 % mysqld
10001 be/4 mysql     808.33 K/s  683.97 K/s  0.00 %  1.16 % mysqld
10025 be/4 mysql     746.15 K/s    0.00 B/s  0.00 %  3.28 % mysqld
10043 be/4 mysql     715.06 K/s    0.00 B/s  0.00 %  0.48 % mysqld
10044 be/4 mysql     672.31 K/s    0.00 B/s  0.00 %  5.25 % mysqld
10034 be/4 mysql     668.42 K/s 1989.73 K/s  0.00 %  5.31 % mysqld
 9985 be/4 mysql     450.80 K/s  124.36 K/s  0.00 %  8.83 % mysqld
 9989 be/4 mysql     357.53 K/s    0.00 B/s  0.00 %  5.21 % mysqld
10033 be/4 mysql     186.54 K/s    0.00 B/s  0.00 %  1.59 % mysqld
10021 be/4 mysql     155.45 K/s  435.25 K/s  0.00 %  1.23 % mysqld
10007 be/4 mysql     124.36 K/s    0.00 B/s  0.00 %  0.53 % mysqld
 9763 be/4 www-data   38.86 K/s    0.00 B/s  0.00 %  4.56 % apache2 -k start
10027 be/4 mysql      31.09 K/s    0.00 B/s  0.00 %  4.24 % mysqld
    1 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % init
    2 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kthreadd]
    3 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [ksoftirqd/0]
    4 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kworker/0:0]
    5 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kworker/u:0]
    6 rt/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [migration/0]
    7 rt/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [migration/1]
share|improve this question
1  
it could be slow queries with poor indexing. Could you show queries with mytop? –  neo Jan 22 '13 at 1:28
    
Hi I ran thus command you suggested which showed one of the apps misbehaving. As this was only ever a demo site (from ages ago) for a client I simply disabled the site and the usage returned to normal. Thanks for your help! –  Jake Schoermer Jan 22 '13 at 1:55

1 Answer 1

First you can check the slow-query.log for queries not using indexes.

Second, could you explain how many GB is the database? For me it looks like the DB is quite big (compared to 1GB RAM of your linode machine, and the db server cannot serve from the buffer pool, it needs to go to the disk for data again and again. Try increase buffer pool setting, and checking for indexes.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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