Jump to content

Optimizing MySQL Help


abazoskib

Recommended Posts

+-----------+
| version() |
+-----------+
| 5.0.45    | 
+-----------+

 

machine specs:

 cat /proc/meminfo
MemTotal:      1788724 kB
MemFree:        849172 kB
Buffers:        144580 kB
Cached:         627588 kB
SwapCached:          0 kB
Active:         790900 kB
Inactive:        86064 kB
HighTotal:     1044488 kB
HighFree:       301460 kB
LowTotal:       744236 kB
LowFree:        547712 kB
SwapTotal:      917496 kB
SwapFree:       917496 kB
Dirty:             328 kB
Writeback:           0 kB
AnonPages:      104796 kB
Mapped:          15184 kB
Slab:            24828 kB
SReclaimable:    18352 kB
SUnreclaim:       6476 kB
PageTables:       1940 kB
NFS_Unstable:        0 kB
Bounce:              0 kB
CommitLimit:   1811856 kB
Committed_AS:   263756 kB
VmallocTotal:   114680 kB
VmallocUsed:      1360 kB
VmallocChunk:   112936 kB

 

my.cnf

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
skip-networking
set-variable = max_connections=2000

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

 

I run queries on a table with at least a million and a half records(and growing) that are pretty slow. I noticed I have no memory optimization in my.cnf. What can I do in terms of my.cnf to speed things up?

Let me know if I need to post any other information. Thanks.

Link to comment
Share on other sites

You can try adding the line

query_cache_size=x

x = this value will depends of the amount of system memory, on my production server i set it up to 64M.

 

If you tables are InnoDb like, you can try adding this too:

innodb_buffer_pool_size=y

y= this value will depends of the amount of system memory, this don't need to be like query_cache_size even it could be more or less.

 

I hope this can help you.

 

Link to comment
Share on other sites

It depends if this is a dedicated MySQL machine, or if there are other services running there. Also do not underestimate the possibility, that you can increase performance by adding indexes or optimising the query.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.