• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Help with optimise my MYSQL

ledubl

New Pleskian
I have a dedicated server with the following specifications: Intel i7 CPU [email protected] with 24GB RAM, Plesk 11,5,30 (CentOS 5.5), but I have a problem with optimizing MySQL database. I have a CMS portal (Joomla) and database size is around 200 MB. Portal has 20-30000 inputs per day, and the problem happens when we let the links on our Facebook page, which has about 70,000 fans. Site and server simply suffocate the base load, so I asked someone to help me how to properly adjust my my.cnf.

Here are the results of mysqltuner:

-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.0.95-log
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[--] Status: -Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 164M (Tables: 775)
[--] Data in InnoDB tables: 14M (Tables: 383)
[!!] Total fragmented tables: 25

-------- Security Recommendations -------------------------------------------
[OK] All database users have passwords assigned

-------- Performance Metrics -------------------------------------------------
[--] Up for: 1d 17h 28m 26s (26M q [178.436 qps], 380K conn, TX: 397B, RX: 4B)
[--] Reads / Writes: 92% / 8%
[--] Total buffers: 186.0M global + 13.2M per thread (800 max threads)
[OK] Maximum possible memory usage: 10.5G (44% of installed RAM)
[OK] Slow queries: 0% (235/26M)
[OK] Highest usage of available connections: 16% (134/800)
[OK] Key buffer size / total MyISAM indexes: 128.0M/46.0M
[OK] Key buffer hit rate: 100.0% (4B cached / 36K reads)
[OK] Query cache efficiency: 47.3% (11M cached / 23M selects)
[!!] Query cache prunes per day: 48472
[OK] Sorts requiring temporary tables: 0% (126 temp sorts / 919K sorts)
[!!] Temporary tables created on disk: 49% (517K on disk / 1M total)
[OK] Thread cache hit rate: 99% (134 created / 380K connections)
[!!] Table cache hit rate: 4% (1K open / 25K opened)
[OK] Open file limit used: 1% (1K/65K)
[OK] Table locks acquired immediately: 99% (13M immediate / 13M locks)
[!!] InnoDB data size / buffer pool: 14.8M/8.0M

-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
When making adjustments, make tmp_table_size/max_heap_table_size equal
Reduce your SELECT DISTINCT queries without LIMIT clauses
Increase table_cache gradually to avoid file descriptor limits
Variables to adjust:
query_cache_size (> 32M)
tmp_table_size (> 32M)
max_heap_table_size (> 16M)
table_cache (> 1024)
innodb_buffer_pool_size (>= 14M)

my.cnf:

[mysqld]
local-infile=0
datadir=/var/lib/mysql
#skip_innodb
skip-locking
skip-bdb
#skip-networking
safe-show-database
query_cache_limit=16M
query_cache_size=64M ## 32MB
query_cache_type=1
max_connections=800
#interactive_timeout=10
#wait_timeout=20
#connect_timeout=20
thread_cache_size=32M
key_buffer=128M ## 128M
#join_buffer=2M
max_connect_errors=20
max_allowed_packet=16M
table_cache=4M
max_heap_table_size=32M
record_buffer=1M
sort_buffer_size=4M ## 1MB
read_buffer_size=4M ## 1M
read_rnd_buffer_size=4M ## 1MB
myisam_sort_buffer_size=32M
server-id=1
log-slow-queries = /var/log/mysql_slow_queries.log
# this can be used on your own wish.
#collation-server=latin1_general_ci

[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=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[mysqlhotcopy]
interactive-timeout
 
For start, since you have a lot of RAM and you're missing query cache, increase query_cache_size to 4GB and set query_cache_limit to 4MB.

Next, set (table_open_cache is basically table_cache, it's just table_cache is deprecaded, so you don't get confused)
table_definition_cache = 2048
table_open_cache = 4096
(for start, maybe we will have to increase this as well later)

Before you change this values, make sure you run Tuning Primer:
https://launchpad.net/mysql-tuning-primer/trunk/1.6-r1/+download/tuning-primer.sh

and post output here.

Also, please monitor during this periods when you launch some news mysql processlist. To be more specific, please pay attention on row "Command" and watch for "Waiting for table lock" - check also "Time" for this table lock, how long it will be.
 
Hello and thanks for the suggestion. Some I applied, but some are not likely because the older version of mysql server (5.0.95 at me). Now I let some links to Facebook and there was congestion of servers, namely to slow the opening of the site. Waiting for more than one minute, so I had to reset the base. Previously, I managed to collect statistics tuning example scripts, but the load went very slowly. Most are waiting for the part "InnoDB STATUS". If you have some suggestions (delete, correct, ..), I would be very grateful.

Here's the data:

TUNING PRIMER

MySQL Version 5.0.95-log x86_64

Uptime = 0 days 3 hrs 7 min 48 sec
Avg. qps = 342
Total Questions = 3862882
Threads Connected = 226

Warning: Server has not been running for at least 48hrs.
It may not be safe to use these recommendations

To find out more information on how each of these
runtime variables effects performance visit:
http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html
Visit http://www.mysql.com/products/enterprise/advisors.html
for info about MySQL's Enterprise Monitoring and Advisory Service

SLOW QUERIES
The slow query log is enabled.
Current long_query_time = 1 sec.
You have 23990 out of 3862898 that take longer than 1 sec. to complete
Your long_query_time seems to be fine

BINARY UPDATE LOG
The binary update log is NOT enabled.
You will not be able to do point in time recovery
See http://dev.mysql.com/doc/refman/5.0/en/point-in-time-recovery.html

WORKER THREADS
Current thread_cache_size = 128
Current threads_cached = 36
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine

MAX CONNECTIONS
Current max_connections = 800
Current threads_connected = 250
Historic max_used_connections = 281
The number of used connections is 35% of the configured maximum.
Your max_connections variable seems to be fine.

INNODB STATUS
Current InnoDB index space = 8 M
Current InnoDB data space = 14 M
Current InnoDB buffer pool free = 11 %
Current innodb_buffer_pool_size = 20 M
Depending on how much space your innodb indexes take up it may be safe
to increase this value to up to 2 / 3 of total system memory

MEMORY USAGE
Max Memory Ever Allocated : 6.52 G
Configured Max Per-thread Buffers : 5.66 G
Configured Max Global Buffers : 4.49 G
Configured Max Memory Limit : 10.15 G
Physical Memory : 23.53 G
Max memory limit seem to be within acceptable norms

KEY BUFFER
Current MyISAM index space = 45 M
Current key_buffer_size = 512 M
Key cache miss rate is 1 : 59710
Key buffer free ratio = 79 %
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 = 3.90 G
Current query_cache_used = 40 M
Current query_cache_limit = 3.90 G
Current Query cache Memory fill ratio = 1.02 %
Current query_cache_min_res_unit = 4 K
Your query_cache_size seems to be too high.
Perhaps you can use these resources elsewhere
MySQL won't cache query results that are larger than query_cache_limit in size

SORT OPERATIONS
Current sort_buffer_size = 1 M
Current read_rnd_buffer_size = 1 M
Sort buffer seems to be fine

JOINS
Current join_buffer_size = 4.00 M
You have had 4 queries where a join could not use an index properly
join_buffer_size >= 4 M
This is not advised
You should enable "log-queries-not-using-indexes"
Then look for non indexed joins in the slow query log.

OPEN FILES LIMIT
Current open_files_limit = 9002 files
The open_files_limit should typically be set to at least 2x-3x
that of table_cache if you have heavy MyISAM usage.
Your open_files_limit value seems to be fine

TABLE CACHE
Current table_cache value = 4096 tables
You have a total of 1169 tables
You have 1624 open tables.
The table_cache value seems to be fine

TEMP TABLES
Current max_heap_table_size = 256 M
Current tmp_table_size = 256 M
Of 72034 temp tables, 49% were created on disk
Perhaps you should increase your tmp_table_size and/or max_heap_table_size
to reduce the number of disk-based temporary tables
Note! BLOB and TEXT columns are not allow in memory tables.
If you are using these columns raising these values might not impact your
ratio of on disk temp tables.

TABLE SCANS
Current read_buffer_size = 1 M
Current table scan ratio = 552 : 1
read_buffer_size seems to be fine

TABLE LOCKING
Current Lock Wait ratio = 1 : 193
You may benefit from selective use of InnoDB.

MYSQLTUNER

-------- Performance Metrics -------------------------------------------------
[--] Up for: 3h 7m 2s (3M q [343.182 qps], 89K conn, TX: 42B, RX: 616M)
[--] Reads / Writes: 88% / 12%
[--] Total buffers: 4.7G global + 7.2M per thread (800 max threads)
[OK] Maximum possible memory usage: 10.4G (44% of installed RAM)
[OK] Slow queries: 0% (23K/3M)
[OK] Highest usage of available connections: 26% (208/800)
[OK] Key buffer size / total MyISAM indexes: 512.0M/45.3M
[OK] Key buffer hit rate: 100.0% (565M cached / 9K reads)
[OK] Query cache efficiency: 50.9% (1M cached / 3M selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (684 temp sorts / 117K sorts)
[!!] Temporary tables created on disk: 49% (69K on disk / 140K total)
[OK] Thread cache hit rate: 99% (208 created / 89K connections)
[OK] Table cache hit rate: 99% (1K open / 1K opened)
[OK] Open file limit used: 22% (1K/9K)
[OK] Table locks acquired immediately: 99% (1M immediate / 1M locks)
[OK] InnoDB data size / buffer pool: 14.8M/20.0M

-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
MySQL started within last 24 hours - recommendations may be inaccurate
Temporary table size is already large - reduce result set size
Reduce your SELECT DISTINCT queries without LIMIT clauses

MY.CNF

[mysqld]
local-infile=0
datadir=/var/lib/mysql
skip-locking
skip-bdb
#skip-networking
safe-show-database
query_cache_limit=4000M
query_cache_size=4000M
query_cache_type=1
max_connections=800
#interactive_timeout=10
#wait_timeout=20
#connect_timeout=20
thread_cache_size=128
key_buffer=512M ## 128MB for every 1GB of RAM
join_buffer=4M
max_connect_errors=20
max_allowed_packet=16M
table_cache = 4096
tmp_table_size=256M
max_heap_table_size=256M
record_buffer=1M
sort_buffer_size=1M ## 1MB for every 1GB of RAM
read_buffer_size=1M ## 1MB for every 1GB of RAM
read_rnd_buffer_size=1M ## 1MB for every 1GB of RAM
#thread_concurrency=2 ## Number of CPUs x 2
myisam_sort_buffer_size=64M
server-id=1
#slow-query-log = 1
log-slow-queries = /var/log/mysql_slow_queries.log
long_query_time = 1
log-queries-not-using-indexes
# this can be used on your own wish.
#collation-server=latin1_general_ci

low_priority_updates=1
concurrent_insert=2
innodb_buffer_pool_size=20M
innodb_additional_mem_pool_size=50M
innodb_file_io_threads=16
innodb_lock_wait_timeout=50
innodb_log_buffer_size=16M
innodb_flush_log_at_trx_commit = 2

# BINARY LOGGING #
#log-bin = /var/lib/mysql/mysql-bin
#expire-logs-days = 14
#sync-binlog = 1

[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=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[mysqlhotcopy]
interactive-timeout
 
For start, you should decrese query_cache_limit = 4000M to something like 2-8MB, 3.9GB limit is way too high.

MySQL is running only 3 hours, leave it at least 24-48h hours.
 
Here are new statistics. Today I'm on facebook published an interesting story about that server literally froze and I had to restart the database. Incidentally present to the configuration of apache server. Please for new suggestions and by the way I wonder whether it is necessary ancestors on the new server, although this has a good performance.

free -m
total used free shared buffers cached
Mem: 24098 2283 21815 0 41 381
-/+ buffers/cache: 1859 22238
Swap: 2053 27 2025

SLOW QUERIES
The slow query log is enabled.
Current long_query_time = 1 sec.
You have 5656 out of 475784 that take longer than 1 sec. to complete
Your long_query_time seems to be fine

BINARY UPDATE LOG
The binary update log is NOT enabled.
You will not be able to do point in time recovery
See http://dev.mysql.com/doc/refman/5.0/en/point-in-time-recovery.html

WORKER THREADS
Current thread_cache_size = 200
Current threads_cached = 14
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine

MAX CONNECTIONS
Current max_connections = 800
Current threads_connected = 400
Historic max_used_connections = 801
The number of used connections is 100% of the configured maximum.
You should raise max_connections

INNODB STATUS
Current InnoDB index space = 8 M
Current InnoDB data space = 14 M
Current InnoDB buffer pool free = 45 %
Current innodb_buffer_pool_size = 32 M
Depending on how much space your innodb indexes take up it may be safe
to increase this value to up to 2 / 3 of total system memory

MEMORY USAGE
Max Memory Ever Allocated : 6.35 G
Configured Max Per-thread Buffers : 3.32 G
Configured Max Global Buffers : 3.03 G
Configured Max Memory Limit : 6.35 G
Physical Memory : 23.53 G
Max memory limit seem to be within acceptable norms

KEY BUFFER
Current MyISAM index space = 45 M
Current key_buffer_size = 2.92 G
Key cache miss rate is 1 : 9081
Key buffer free ratio = 81 %
Your key_buffer_size seems to be fine

QUERY CACHE
Query cache is enabled
Current query_cache_size = 8 M
Current query_cache_used = 3 M
Current query_cache_limit = 1 M
Current Query cache Memory fill ratio = 39.80 %
Current query_cache_min_res_unit = 4 K
MySQL won't cache query results that are larger than query_cache_limit in size

SORT OPERATIONS
Current sort_buffer_size = 1 M
Current read_rnd_buffer_size = 1 M
Sort buffer seems to be fine

JOINS
Current join_buffer_size = 1.00 M
You have had 0 queries where a join could not use an index properly
Your joins seem to be using indexes properly

OPEN FILES LIMIT
Current open_files_limit = 12288 files
The open_files_limit should typically be set to at least 2x-3x
that of table_cache if you have heavy MyISAM usage.
Your open_files_limit value seems to be fine

TABLE CACHE
Current table_cache value = 4096 tables
You have a total of 1169 tables
You have 2757 open tables.
The table_cache value seems to be fine

TEMP TABLES
Current max_heap_table_size = 256 M
Current tmp_table_size = 256 M
Of 11184 temp tables, 45% were created on disk
Perhaps you should increase your tmp_table_size and/or max_heap_table_size
to reduce the number of disk-based temporary tables
Note! BLOB and TEXT columns are not allow in memory tables.
If you are using these columns raising these values might not impact your
ratio of on disk temp tables.

TABLE SCANS
Current read_buffer_size = 1 M
Current table scan ratio = 518 : 1
read_buffer_size seems to be fine

TABLE LOCKING
Current Lock Wait ratio = 1 : 42
You may benefit from selective use of InnoDB.


-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.0.95-log
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[--] Status: -Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 163M (Tables: 768)
[--] Data in InnoDB tables: 14M (Tables: 383)
[!!] Total fragmented tables: 21

-------- Security Recommendations -------------------------------------------
[OK] All database users have passwords assigned

-------- Performance Metrics -------------------------------------------------
[--] Up for: 30m 39s (448K q [244.105 qps], 7K conn, TX: 5B, RX: 75M)
[--] Reads / Writes: 90% / 10%
[--] Total buffers: 3.3G global + 4.2M per thread (800 max threads)
[OK] Maximum possible memory usage: 6.6G (28% of installed RAM)
[OK] Slow queries: 1% (5K/448K)
[!!] Highest connection usage: 100% (801/800)
[OK] Key buffer size / total MyISAM indexes: 2.9G/45.6M
[OK] Key buffer hit rate: 100.0% (71M cached / 8K reads)
[OK] Query cache efficiency: 51.2% (202K cached / 394K selects)
[!!] Query cache prunes per day: 45713
[OK] Sorts requiring temporary tables: 0% (83 temp sorts / 15K sorts)
[!!] Temporary tables created on disk: 45% (8K on disk / 18K total)
[OK] Thread cache hit rate: 89% (801 created / 7K connections)
[OK] Table cache hit rate: 99% (2K open / 2K opened)
[OK] Open file limit used: 25% (3K/12K)
[OK] Table locks acquired immediately: 98% (212K immediate / 216K locks)
[OK] InnoDB data size / buffer pool: 14.6M/32.0M

-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
MySQL started within last 24 hours - recommendations may be inaccurate
Reduce or eliminate persistent connections to reduce connection usage
Temporary table size is already large - reduce result set size
Reduce your SELECT DISTINCT queries without LIMIT clauses
Variables to adjust:
max_connections (> 800)
wait_timeout (< 28800)
interactive_timeout (< 28800)
query_cache_size (> 8M)


[mysqld]
local-infile=0
datadir=/var/lib/mysql
#skip-locking
skip-bdb
#skip-networking
safe-show-database
#query_cache_limit=4M
query_cache_size=8M
query_cache_type=1
max_connections=800
#interactive_timeout=10
#wait_timeout=20
#connect_timeout=20
thread_cache_size=200
key_buffer=3000M ## 128MB for every 1GB of RAM
log-queries-not-using-indexes
join_buffer_size=1M
max_connect_errors=20
max_allowed_packet=32M
table_cache = 4096
tmp_table_size=256M
max_heap_table_size=256M
#bulk_insert_buffer_size=512M
thread_stack = 256K
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 1M
thread_concurrency=16 ## Number of CPUs x 2
myisam_sort_buffer_size=128M
myisam_max_sort_file_size=256M
myisam_repair_threads=4
server-id=1
log-slow-queries = /var/lib/mysql/mysql-slow.log
expire_logs_days=7
long_query_time = 1
low_priority_updates=1
concurrent_insert=2
open_files_limit=12288

innodb_buffer_pool_size=32M
innodb_additional_mem_pool_size=50M
innodb_file_io_threads=16
innodb_lock_wait_timeout=50
innodb_log_buffer_size=16M
innodb_flush_log_at_trx_commit = 2

[mysql.server]
user=mysql

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/lib/mysql/mysql.pid
open_files_limit=12288

[mysqldump]
quick
max_allowed_packet=32M

[mysql]
no-auto-rehash
#safe-updates

[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[mysqlhotcopy]
interactive-timeout



httpd.conf

Timeout 120
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15

# prefork MPM
<IfModule prefork.c>
StartServers 40
MinSpareServers 30
MaxSpareServers 200
ServerLimit 1024
MaxClients 512
MaxRequestsPerChild 10000
</IfModule>

# worker MPM
<IfModule worker.c>
StartServers 2
MaxClients 300
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>
 
Yeah you pretty much get diminishing returns if you set the cache above 128M. 4G is wasting memory, slowing it down, and making it much more unstable.
 
Here are some new statistics. Today I'm on facebook published an interesting story about that server literally froze and I had to restart the database. Incidentally present to the configuration of apache server. Please for new suggestions and by the way I wonder whether it is necessary ancestors on the new server, although this has a good performance.

free -m
total used free shared buffers cached
Mem: 24098 2283 21815 0 41 381
-/+ buffers/cache: 1859 22238
Swap: 2053 27 2025

-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.0.95-log
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[--] Status: -Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 163M (Tables: 768)
[--] Data in InnoDB tables: 14M (Tables: 383)
[!!] Total fragmented tables: 21

-------- Security Recommendations -------------------------------------------
[OK] All database users have passwords assigned

-------- Performance Metrics -------------------------------------------------
[--] Up for: 30m 39s (448K q [244.105 qps], 7K conn, TX: 5B, RX: 75M)
[--] Reads / Writes: 90% / 10%
[--] Total buffers: 3.3G global + 4.2M per thread (800 max threads)
[OK] Maximum possible memory usage: 6.6G (28% of installed RAM)
[OK] Slow queries: 1% (5K/448K)
[!!] Highest connection usage: 100% (801/800)
[OK] Key buffer size / total MyISAM indexes: 2.9G/45.6M
[OK] Key buffer hit rate: 100.0% (71M cached / 8K reads)
[OK] Query cache efficiency: 51.2% (202K cached / 394K selects)
[!!] Query cache prunes per day: 45713
[OK] Sorts requiring temporary tables: 0% (83 temp sorts / 15K sorts)
[!!] Temporary tables created on disk: 45% (8K on disk / 18K total)
[OK] Thread cache hit rate: 89% (801 created / 7K connections)
[OK] Table cache hit rate: 99% (2K open / 2K opened)
[OK] Open file limit used: 25% (3K/12K)
[OK] Table locks acquired immediately: 98% (212K immediate / 216K locks)
[OK] InnoDB data size / buffer pool: 14.6M/32.0M

-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
MySQL started within last 24 hours - recommendations may be inaccurate
Reduce or eliminate persistent connections to reduce connection usage
Temporary table size is already large - reduce result set size
Reduce your SELECT DISTINCT queries without LIMIT clauses
Variables to adjust:
max_connections (> 800)
wait_timeout (< 28800)
interactive_timeout (< 28800)
query_cache_size (> 8M)


SLOW QUERIES
The slow query log is enabled.
Current long_query_time = 1 sec.
You have 5656 out of 475784 that take longer than 1 sec. to complete
Your long_query_time seems to be fine

BINARY UPDATE LOG
The binary update log is NOT enabled.
You will not be able to do point in time recovery
See http://dev.mysql.com/doc/refman/5.0/en/point-in-time-recovery.html

WORKER THREADS
Current thread_cache_size = 200
Current threads_cached = 14
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine

MAX CONNECTIONS
Current max_connections = 800
Current threads_connected = 400
Historic max_used_connections = 801
The number of used connections is 100% of the configured maximum.
You should raise max_connections

INNODB STATUS
Current InnoDB index space = 8 M
Current InnoDB data space = 14 M
Current InnoDB buffer pool free = 45 %
Current innodb_buffer_pool_size = 32 M
Depending on how much space your innodb indexes take up it may be safe
to increase this value to up to 2 / 3 of total system memory

MEMORY USAGE
Max Memory Ever Allocated : 6.35 G
Configured Max Per-thread Buffers : 3.32 G
Configured Max Global Buffers : 3.03 G
Configured Max Memory Limit : 6.35 G
Physical Memory : 23.53 G
Max memory limit seem to be within acceptable norms

KEY BUFFER
Current MyISAM index space = 45 M
Current key_buffer_size = 2.92 G
Key cache miss rate is 1 : 9081
Key buffer free ratio = 81 %
Your key_buffer_size seems to be fine

QUERY CACHE
Query cache is enabled
Current query_cache_size = 8 M
Current query_cache_used = 3 M
Current query_cache_limit = 1 M
Current Query cache Memory fill ratio = 39.80 %
Current query_cache_min_res_unit = 4 K
MySQL won't cache query results that are larger than query_cache_limit in size

SORT OPERATIONS
Current sort_buffer_size = 1 M
Current read_rnd_buffer_size = 1 M
Sort buffer seems to be fine

JOINS
Current join_buffer_size = 1.00 M
You have had 0 queries where a join could not use an index properly
Your joins seem to be using indexes properly

OPEN FILES LIMIT
Current open_files_limit = 12288 files
The open_files_limit should typically be set to at least 2x-3x
that of table_cache if you have heavy MyISAM usage.
Your open_files_limit value seems to be fine

TABLE CACHE
Current table_cache value = 4096 tables
You have a total of 1169 tables
You have 2757 open tables.
The table_cache value seems to be fine

TEMP TABLES
Current max_heap_table_size = 256 M
Current tmp_table_size = 256 M
Of 11184 temp tables, 45% were created on disk
Perhaps you should increase your tmp_table_size and/or max_heap_table_size
to reduce the number of disk-based temporary tables
Note! BLOB and TEXT columns are not allow in memory tables.
If you are using these columns raising these values might not impact your
ratio of on disk temp tables.

TABLE SCANS
Current read_buffer_size = 1 M
Current table scan ratio = 518 : 1
read_buffer_size seems to be fine

TABLE LOCKING
Current Lock Wait ratio = 1 : 42
You may benefit from selective use of InnoDB.
 
my.cnf and httpd.conf

[mysqld]
local-infile=0
datadir=/var/lib/mysql
skip-locking
skip-bdb
#skip-networking
safe-show-database
query_cache_limit=128M
query_cache_size=128M
query_cache_type=1
max_connections=800
#interactive_timeout=10
wait_timeout=60
#connect_timeout=20
thread_cache_size=200
key_buffer_size=3000M
log-queries-not-using-indexes
join_buffer_size=1M
max_allowed_packet=16M
table_cache = 4096
tmp_table_size=256M
max_heap_table_size=256M
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 1M
thread_concurrency=16 ## Number of CPUs x 2
myisam_sort_buffer_size=128M
myisam_max_sort_file_size=256M
server-id=1
#log-slow-queries = /var/lib/mysql/mysql-slow.log
expire_logs_days=7
long_query_time = 1
low_priority_updates=1
concurrent_insert=2
open_files_limit=65535



innodb_buffer_pool_size=32M
innodb_additional_mem_pool_size=50M
innodb_file_io_threads=16
innodb_lock_wait_timeout=50
innodb_log_buffer_size=16M
innodb_flush_log_at_trx_commit = 2

# BINARY LOGGING #
#log-bin = /var/lib/mysql/mysql-bin
#expire-logs-days = 14
#sync-binlog = 1


[mysql.server]
user=mysql

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/lib/mysql/mysql.pid
open_files_limit=12288

[mysqldump]
quick
max_allowed_packet=16M

[mysql]
no-auto-rehash
#safe-updates

[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[mysqlhotcopy]
interactive-timeout



# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# ServerLimit: maximum value for MaxClients for the lifetime of the server
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
StartServers 8
MinSpareServers 5
MaxSpareServers 20
MaxClients 150
MaxRequestsPerChild 100
</IfModule>

# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_worker_module>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>
 
Back
Top