Reputation: 309
the database size is only 200MB. I tried repairing it with build in tools in phpmyadmin it does help but it goes back to a higher disk usage.
OS: Windows 10
Upvotes: 2
Views: 3913
Reputation: 562651
The most likely explanation is that you're running a lot of queries that use temporary space. But this is just a guess, because you have provided no information about what's running in your MySQL Server.
It's common for MySQL queries that use GROUP BY
or ORDER BY
or DISTINCT
to use temporary space. Sometimes a lot of temporary space, or sometimes a little space but you have a lot of queries per second. This could account for the rate of disk I/O reported.
You can reduce this by optimizing your queries carefully so they use indexes instead of sorting or grouping in temporary space on disk. The topic of query optimization is large, and too much to cover in a Stack Overflow post.
If you need help optimizing a specific query, you should ask a question with that query, along with the output of SHOW CREATE TABLE
and SHOW TABLE STATUS
for each table in the query.
There are other uses of disk I/O that can happen rapidly.
For example, if your buffer pool is too small, and your queries scan your full 200MB of data repeatedly, then the MySQL Server is forced to replace pages in the buffer pool over and over again, reading the same data from disk every time. If you can allocate more RAM to the buffer pool, you can mitigate this rate of page recycling, and probably speed up your overall performance a lot.
Another example is if you are using UPDATE
to change data over and over again, you could be writing a lot of I/O to the transaction log and the binary log, even though the total size of your data doesn't grow.
Tuning a database server is a complex process. If you need help tuning your MySQL options, it would be best to ask on dba.stackexchange.com. Include your MySQL version, and your current options in mysql.ini
.
Upvotes: 4