You are not logged in.

#1 2009-06-18 15:32:03

Gruw
Member
Registered: 2009-06-18
Posts: 2

MySQL is very slow

Hi everybody!

You apology my english please. That is first thing smile
In general, i want to ask you, what can i do for get faster mysql. I don't know what's wrong. In Ubuntu my own website hasn't any problems, but in Arch all queries are slower. I'm not sure if my setting file (my.cfg) is correct. But i have default file. Does somebody have some idea about that? It is generaly, when i send about 200 and more queries. In othres situations i don't see any slowing down.

Thank you!

Offline

#2 2009-06-19 06:14:18

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: MySQL is very slow

Well, I think that query cache is disabled by default. Maybe there are other areas that can be tweaked too, but enabling query cache alone has given me a ~20-fold speedup. Edit your /etc/my.cnf and add:

query_cache_limit = 1M
query_cache_size  = 16M

See if that makes a difference on your setup and adjust the values according to how much memory you have.

Offline

#3 2009-06-19 09:49:40

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: MySQL is very slow

Maybe this could help?
http://www.databasejournal.com/features … to-Set.htm

I'm a PostgreSQL guy myself, hence why I bookmarked that page (:P), so I can't really suggest must more than that, sorry.

Offline

#4 2009-06-20 08:58:55

Gruw
Member
Registered: 2009-06-18
Posts: 2

Re: MySQL is very slow

foutrelis wrote:

Well, I think that query cache is disabled by default. Maybe there are other areas that can be tweaked too, but enabling query cache alone has given me a ~20-fold speedup. Edit your /etc/my.cnf and add:

query_cache_limit = 1M
query_cache_size  = 16M

See if that makes a difference on your setup and adjust the values according to how much memory you have.

Thanks but i haven't problems with memory. My problem is heavy of CPU. When i send some queries CPU increase working load to 50%. And all queries are mede for long time. And your tip seve me some memory. It is true. But it isn't so important. Or i don't understand you big_smile

Offline

#5 2009-06-20 11:48:36

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: MySQL is very slow

Gruw wrote:

Thanks but i haven't problems with memory. My problem is heavy of CPU. When i send some queries CPU increase working load to 50%. And all queries are mede for long time. And your tip seve me some memory. It is true. But it isn't so important. Or i don't understand you big_smile

I probably didn't phrase it correctly. tongue

Enabling (or increasing the size of) the query cache saves on CPU time, as query results are cached and don't need to be recomputed (unless, of course, the data changes). My remark about the amount of memory available on your system was that if you've got plenty of memory, you can use a larger value for query_cache_size (my 16M is a bit on the low side, I think). fukawi2's link explains it much better, and includes other things you can tweak too. Here's another blog post with settings you can tune for optimal performance (it's a little old, but still contains useful advice).

Let us know how you do. smile

Offline

Board footer

Powered by FluxBB