Web Hosting Talk







View Full Version : mysql config


LoganNZ
12-27-2004, 07:13 AM
Mysql query times seem to be really high at the moment

here is the current config

[mysqld]
set-variable = max_connections=500
safe-show-database
port = 3306
skip-locking
set-variable = max_connections=250
set-variable = max_user_connections=20
set-variable = key_buffer=48M
set-variable = join_buffer=1M
set-variable = record_buffer=1M
set-variable = sort_buffer=2M
set-variable = table_cache=1028
set-variable = myisam_sort_buffer_size=32M
set-variable = interactive_timeout=100
set-variable = wait_timeout=100
set-variable = connect_timeout=10
set-variable = thread_cache_size=128
query_cache_type = 1
query_cache_size = 16M

anything i can add to it/mod it to make query times better?

Its a 2.4 celeron, not the best. However it has 1gb of ram....

Thanks.

assistanz247
12-27-2004, 07:30 AM
Try this tool to check mysql running process ::

http://jeremy.zawodny.com/blog/archives/000904.html

LoganNZ
12-27-2004, 07:36 AM
I don't have any mysql querys running, its not peak time and the query times are really high.

I don't need a app that tells me how many processes its using.

I need the query times to be lower...

Thanx

LoganNZ
12-27-2004, 09:02 PM
any ideas on how to get the sql query times low?

chvora01
12-28-2004, 11:58 AM
I would increase the query_cache_size to about 128M and maybe the key buffer. Get MySQL Administrator that will give you better idea of the key buffer hits etc.

I know you would prefer a staright forward answer but there are so many factors that can affect the query times.
The main is of course if your database has indexes etc. and your sql queries. without indexes a small database will be relatively fast but it will quickly slow down with size.

You can try restarting mysql that might help

Lynx
12-28-2004, 10:53 PM
What are you using the Mysql database for?

For what it's worth, I've been trying to sort out my own problems with a small vps and a phpBB. See: http://www.vbulletin.com/forum/showthread.php?p=774894&highlight=tmp_table_size#post774894 for some suggestions that might apply to your my.cnf.

error404
12-29-2004, 01:22 AM
Before you do any 'tweaking' of the database server, make sure your machine itself is running properly. Ensure that you don't have rogue processes eating up CPU or RAM, and if you do kill them. If you're not knowledgable in administering your server, reboot it.

If the problem isn't solved, it's likely a query planning issue. Optimize your query, add indexes where they'll be useful. EXPLAIN is a very useful SQL command to help you out with that.

I suspect that if things are running slowly, it's more an issue with the SQL code that you're running than anything to do with the server. What is 'slowly' to you? How many records in the database..and how many are being returned, and what sort of queries are we talking about?