load averages high, caused by mysql
Here's some information:
Code:
Web Server with Apache 2.2. Code:
[root@server init.d]# top Code:
Slow_queries 14 k phpMyAdmin on high Handler_read_rnd_next: The number of requests to read the next row in the data file. This is high if you are doing a lot of table scans. Generally this suggests that your tables are not properly indexed or that your queries are not written to take advantage of the indexes you have. So I am going to check the indexing of tables. The biggest table has over 40,000 rows. Maybe someone with similar problem experirence.. I appreciate any suggestions and help. |
The one most common reasons for high load on MySQL are queries not using indexes. You're on the right track in fixing this. Also use the EXPLAIN command.
|
The slow query log was already enabled. After disabling it (it was over 450MB heavy), it seems that the load averages droped a bit (not really sure, though, not many visitors at the moment).
Does that make sense? If so, are there any other logs I should consider emptying/disabling ? I tried to direct the slow query log to another file but no success. Maybe I shold try emptying it ? |
Well, that means that you have a LOT of slow queries. You should look into your indexing. Normally you should not disable any logs besides query log. After changing log settings, you may need to restart your MySQL server because the file descriptor for the old log is held by the process and settings are not re-read to my knowledge.
|
Hello,
There is a very handy perl script on the internet named mysqltuner.pl that can help you a lot when troubleshooting MySQL. Kind regards, Eric |
Thank you all for replies!
These are the last 5 slow queries from the slow-log. Does this suggest that there is indexing problem? This should be a matter of mysql now, right, so, maybe, i should post it somewhere else. ? Code:
# Time: 091231 11:10:45 |
Whoever wrote these queries should really learn some programming.
Look at this: Rows_sent: 46373 Rows_examined: 46373 This is horrible performance-wise. Indexing alone won't help you with this. Talk to the guy who wrote this mess. |
Thanks for the replies.
There was an indexing issue with some queries. I have to look into this, what it really does and if it is necessary at all Code:
Rows_sent: 46373 Rows_examined: 46373 |
All times are GMT -5. The time now is 05:51 PM. |