PDA

View Full Version : MySQL Slow Queries



joshkraemer
01-19-2009, 11:56 AM
I've been getting about 18-22 MySQL slow query log files every day in the /tmp/mysql_slow_queries folder for a little while now.

My site is MySQL driven, and has received a moderate increase in traffic each month - 5000 uniques, 5500 uniques, and now 6000 uniques.

I'm wondering if the visitors to my site see any messages like "too many database connections." I have visited my site during the times when there is heavy traffic, but have never seen any message like that. I just hope none of my visitors see a message like that, either.

How do these slow query logs affect what the user sees (or are they transparent)?

BTW, before someone "lectures" me on the need to optimize my SQL queries, they are already optimized (table structure and syntax-wise), the database is about 1MB of web page content, and I've set up a cron job to repair/optimize the database every week.

The only thing I could do better is to setup a cache option to reduce the number of connections/queries sent to the DB. I could also move to dedicated hosting, but I would rather stay with HM for the time-being, if possible.

shadmego
01-19-2009, 12:18 PM
I get these things as well, but I've never seen any real issues from the website end. I've optimized and repaired until the cows came home and it worked, but it did not completely resolve the issue. I'm not a database wizard so I don't know what else I can do, but I think as long as you stay away from the cpu_exceeded errors, then your visitors will not see anything unsightly.

Wish I had more to tell you.

~regards