I'm running around 19 total sites on one of my servers, only one of which is extremely resource intensive...
The one site gets a large number of hits and is CONSTANTLY making long queries and updating data, the server load usually goes up above 2 with over 30 users online at a time.
How would I go about optimizing my.cnf to help keep it down?
Here's the contents of my current my.cnf
After an hour of running MySQL and running a cool script to get your info I got this...
Thanks!
EDIT: Should have added, server is
Processor #1 Vendor: GenuineIntel
Processor #1 Name: Intel(R) Pentium(R) 4 CPU 2.80GHz
Processor #1 speed: 2814.860 MHz
Processor #1 cache size: 512 KB
with 1GB of ram, spamAssassin is disabled along with Box trapper, ASSP is installed. CSF firewall and LFD. The security check also shows that it's a 68/70. The only things not done are phpSuEXEC and no disabled functions in PHP.
Also, eaccelerator:
The one site gets a large number of hits and is CONSTANTLY making long queries and updating data, the server load usually goes up above 2 with over 30 users online at a time.
How would I go about optimizing my.cnf to help keep it down?
Here's the contents of my current my.cnf
Code:
[mysqld]
skip-locking
skip-bdb
skip-innodb
query_cache_limit=8M
query_cache_size=8M
query_cache_type=1
max_connections=500
max_user_connections=500
interactive_timeout=20
wait_timeout=6
long_query_time = 5
connect_timeout=6
thread_cache_size=128
key_buffer=16M
join_buffer=1M
max_allowed_packet=16M
table_cache=2048
tmp_table_size=256M
record_buffer=1M
sort_buffer_size=2M
key_buffer_size=8M
read_buffer_size=2M
max_connect_errors=10
thread_concurrency=2
myisam_sort_buffer_size=64M
server-id=1
log-slow-queries = /var/log/mysql/mysql-slow.log
concurrent_insert=2
[mysql.server]
user=mysql
[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/lib/mysql/mysql.pid
open_files_limit=8192
[mysqldump]
quick
max_allowed_packet=16M
[mysql]
no-auto-rehash
#safe-updates
[isamchk]
key_buffer=32M
sort_buffer=32M
read_buffer=16M
write_buffer=16M
[myisamchk]
key_buffer=32M
sort_buffer=32M
read_buffer=16M
write_buffer=16M
Code:
SLOW QUERIES
Current long_query_time = 5 sec.
You have 0 out of 11313288 that take longer than 5 sec. to complete
The slow query log is NOT enabled.
Your long_query_time seems to be fine
MAX CONNECTIONS
Current max_connections = 500
Current threads_connected = 1
Historic max_used_connections = 6
The number of used connections is 1% of the configured maximum.
Your max_connections variable seems to be fine.
WORKER THREADS
Current thread_cache_size = 128
Current threads_cached = 5
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine
MEMORY USAGE
Max Memory Ever Allocated : 51 M
Configured Max Memory Limit : 2117 M
Total System Memory : 3065 M
KEY BUFFER
Current MyISAM index space = 10 M
Current key_buffer_size = 8 M
Key cache miss rate is 1 / 8264
Key buffer fill ratio = 47.00 %
Your key_buffer_size seems to be too high.
Perhaps you can use these resources elsewhere
QUERY CACHE
Query cache is enabled
Current query_cache_size = 8 M
Current query_cache_used = 2 M
Current Query cache fill ratio = 27.91 %
SORT OPERATIONS
Current sort_buffer_size = 2 M
Current record/read_rnd_buffer_size = 256.00 K
Sort buffer seems to be fine
JOINS
Current join_buffer_size = 1020.00 K
You have had 0 queries where a join could not use an index properly
Your joins seem to be using indexes properly
TABLE CACHE
Current table_cache value = 2048 tables
You have a total of 872 tables
You have 884 open tables.
The table_cache value seems to be fine
TEMP TABLES
Current tmp_table_size = 256 M
57% of tmp tables created were disk based
Perhaps you should increase your tmp_table_size
TABLE SCANS
Current read_buffer_size = 1 M
Current table scan ratio = 58 : 1
read_buffer_size seems to be fine
TABLE LOCKING
Current Lock Wait ratio = 1 : 1991
You may benefit from selective use of InnoDB.
If you have long running SELECT's against MyISAM tables and perform frequent updates consider setting 'low_priority_updates=1'
If you have a high concurrentcy of inserts on Dynamic row-lenght tables consider setting 'concurrent_insert=2'
EDIT: Should have added, server is
Processor #1 Vendor: GenuineIntel
Processor #1 Name: Intel(R) Pentium(R) 4 CPU 2.80GHz
Processor #1 speed: 2814.860 MHz
Processor #1 cache size: 512 KB
with 1GB of ram, spamAssassin is disabled along with Box trapper, ASSP is installed. CSF firewall and LFD. The security check also shows that it's a 68/70. The only things not done are phpSuEXEC and no disabled functions in PHP.
Also, eaccelerator:
Code:
eAccelerator support
enabled Version 0.9.5
Caching Enabled true
Optimizer Enabled true
Memory Size 16,777,180 Bytes
Memory Available 9,887,112 Bytes
Memory Allocated 6,890,068 Bytes
Cached Scripts 109
Removed Scripts 0
Cached Keys 0
Last edited: