Hello
Mysql cpu load to high 98%, Query very slow , 0% installed RAM, browsing very slow + blank page
Server
DualXeonE5-2620 - 24 CPU, 64 GB RAM
./tuning-primer.sh
Mysql cpu load to high 98%, Query very slow , 0% installed RAM, browsing very slow + blank page
Server
DualXeonE5-2620 - 24 CPU, 64 GB RAM
Code:
[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
[mysqld]
wait_timeout=3
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
bind-address=127.0.0.1
symbolic-links=0
port=3306
skip-external-locking
#skip-innodb
max_connections = 2000
interactive_timeout=3
key_buffer = 5G
myisam_sort_buffer_size = 512M
join_buffer_size = 6M
read_buffer_size = 8M
sort_buffer_size = 6M
table_cache = 1024
read_rnd_buffer_size=6144K
thread_cache_size = 300k
thread_stack=128K
thread_concurrency=12
wait_timeout = 20
connect_timeout = 10
max_allowed_packet = 32M
max_connect_errors = 10
query_cache_limit = 1M
query_cache_size = 32M
query_cache_type = 1
#skip-locking
#skip-bdb
max_binlog_size=100M
default-storage-engine=MyISAM
tmp_table_size=2500M
max_heap_table_size=2500M
table_definition_cache = 500
#slow_query_log=1
#slow_query_log_file=mysql-slow.log
#long_query_time=5
log-queries-not-using-indexes
low_priority_updates=1
concurrent_insert=2
#skip-federated
#log-bin=mysql-bin
server-id = 1
[mysqld_safe]
#log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
open_files_limit = 35000
socket=/var/run/mysqld/mysqld.sock
nice=0
[mysqldump]
#quick
#max_allowed_packet = 16M
#quote-names
[myisamchk]
key_buffer = 512M
sort_buffer = 512M
read_buffer = 128M
write_buffer = 128M
[isamchk]
key_buffer = 512M
sort_buffer = 512M
read_buffer = 128M
write_buffer = 128M
[mysql.server]
#basedir=/var/lib/mysql
[mysqlhotcopy]
interactive-timeout
safe-show-database
set-variable=local-infile=0
./tuning-primer.sh
Code:
[[email protected] home]# ./tuning-primer.sh
-- MYSQL PERFORMANCE TUNING PRIMER --
- By: Matthew Montgomery -
MySQL Version 5.1.73 x86_64
Uptime = 0 days 0 hrs 26 min 4 sec
Avg. qps = 16
Total Questions = 25741
Threads Connected = 258
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:
[url=http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html]MySQL :: MySQL 5.1 Reference Manual :: 5.1.4 Server System Variables[/url]
Visit [url]http://www.mysql.com/products/enterprise/advisors.html[/url]
for info about MySQL's Enterprise Monitoring and Advisory Service
SLOW QUERIES
The slow query log is NOT enabled.
Current long_query_time = 10.000000 sec.
You have 514 out of 25762 that take longer than 10.000000 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 [url=http://dev.mysql.com/doc/refman/5.1/en/point-in-time-recovery.html]MySQL :: MySQL 5.1 Reference Manual :: 7.5 Point-in-Time (Incremental) Recovery Using the Binary Log[/url]
WORKER THREADS
Current thread_cache_size = 16384
Current threads_cached = 255
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine
MAX CONNECTIONS
Current max_connections = 2000
Current threads_connected = 258
Historic max_used_connections = 513
The number of used connections is 25% of the configured maximum.
Your max_connections variable seems to be fine.
INNODB STATUS
Current InnoDB index space = 0 bytes
Current InnoDB data space = 0 bytes
Current InnoDB buffer pool free = 96 %
Current innodb_buffer_pool_size = 8 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 : 18.12 G
Configured Max Per-thread Buffers : 51.02 G
Configured Max Global Buffers : 5.04 G
Configured Max Memory Limit : 56.06 G
Physical Memory : 62.88 G
Max memory limit seem to be within acceptable norms
KEY BUFFER
Current MyISAM index space = 919 M
Current key_buffer_size = 5.00 G
Key cache miss rate is 1 : 3613
Key buffer free ratio = 80 %
Your key_buffer_size seems to be fine
QUERY CACHE
Query cache is enabled
Current query_cache_size = 32 M
Current query_cache_used = 20 K
Current query_cache_limit = 1 M
Current Query cache Memory fill ratio = .06 %
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 = 6 M
Current read_rnd_buffer_size = 6 M
No sort operations have been performed
Sort buffer seems to be fine
JOINS
Current join_buffer_size = 6.00 M
You have had 0 queries where a join could not use an index properly
Your joins seem to be using indexes properly
join_buffer_size >= 4 M
This is not advised
OPEN FILES LIMIT
Current open_files_limit = 35000 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_open_cache = 1024 tables
Current table_definition_cache = 500 tables
You have a total of 651 tables
You have 1024 open tables.
Current table_cache hit rate is 87%
, while 100% of your table cache is in use
You should probably increase your table_cache
You should probably increase your table_definition_cache value.
TEMP TABLES
Current max_heap_table_size = 2.44 G
Current tmp_table_size = 2.44 G
Of 519 temp tables, 5% were created on disk
Created disk tmp tables ratio seems fine
TABLE SCANS
Current read_buffer_size = 8 M
Current table scan ratio = 103 : 1
read_buffer_size seems to be fine
TABLE LOCKING
Current Lock Wait ratio = 1 : 0
You may benefit from selective use of InnoDB.[/QUOTE]
[[email protected] home]# netstat -an | grep :80 | wc -l
36000
mtop
[QUOTE]load average: 232.58, 224.72, 209.72 mysqld 5.1.73 up 0 day(s), 0:29 hrs
257 threads: 257 running, 256 cached. Queries/slow: 697/0 Cache Hit: 99.98%
Opened tables: 0 RRN: 278 TLW: 20.0K SFJ: 0 SMP: 0 QPS: 0