|
本帖最后由 leozhang 于 2012-1-25 10:39 编辑
nginx 服务器,跑的PHP 商城, linode 768的方案, 经常load一下就上来,CPU也上来, 好象很有规律的. 站基本没有流量, 一个月5%都用不完, 一天30,50个IP的, 不知道怎么回事,经常会突然就起来
补充一下,我还装了个Wordpress,是不是这个东东在搞鬼.
tuningprimer 测试结果:
-- MYSQL PERFORMANCE TUNING PRIMER --
- By: Matthew Montgomery -
MySQL Version 5.0.84 i686
Uptime = 0 days 0 hrs 5 min 28 sec
Avg. qps = 77
Total Questions = 25387
Threads Connected = 1
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 NOT enabled.
Current long_query_time = 10 sec.
You have 0 out of 25408 that take longer than 10 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 = 8
Current threads_cached = 4
Current threads_per_sec = 0
Historic threads_per_sec = 0
Your thread_cache_size is fine
MAX CONNECTIONS
Current max_connections = 400
Current threads_connected = 2
Historic max_used_connections = 6
The number of used connections is 1% of the configured maximum.
You are using less than 10% of your configured max_connections.
Lowering max_connections could help to avoid an over-allocation of memory
See "MEMORY USAGE" section to make sure you are not over-allocating
INNODB STATUS
Current InnoDB index space = 132 M
Current InnoDB data space = 232 M
Current InnoDB buffer pool free = 91 %
Current innodb_buffer_pool_size = 640 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 : 854 M
Configured Max Per-thread Buffers : 4.02 G
Configured Max Global Buffers : 792 M
Configured Max Memory Limit : 4.80 G
Physical Memory : 750 M
Max memory limit exceeds 90% of physical memory
KEY BUFFER
Current MyISAM index space = 2 M
Current key_buffer_size = 7 M
Key cache miss rate is 1 : 134
Key buffer free ratio = 88 %
Your key_buffer_size seems to be fine
QUERY CACHE
Query cache is enabled
Current query_cache_size = 128 M
Current query_cache_used = 9 M
Current query_cache_limit = 1 M
Current Query cache Memory fill ratio = 7.38 %
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 = 4 M
Current read_rnd_buffer_size = 2 M
Sort buffer seems to be fine
JOINS
Current join_buffer_size = 132.00 K
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 = 2000 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 = 64 tables
You have a total of 447 tables
You have 64 open tables.
Current table_cache hit rate is 3%
, while 100% of your table cache is in use
You should probably increase your table_cache
TEMP TABLES
Current max_heap_table_size = 16 M
Current tmp_table_size = 128 M
Of 3036 temp tables, 6% were created on disk
Effective in-memory tmp_table_size is limited to max_heap_table_size.
Created disk tmp tables ratio seems fine
TABLE SCANS
Current read_buffer_size = 4 M
Current table scan ratio = 6 : 1
read_buffer_size seems to be fine
TABLE LOCKING
Current Lock Wait ratio = 0 : 26776
Your table locking seems to be fine
附上: 现在my.cnf的配置:
innodb_buffer_pool_size=640M
innodb_additional_mem_pool=16M
max_allowed_packet=64M
sort_buffer_size=4M
read_buffer_size=4M
read_rnd_buffer_size=2M
myisam_sort_buffer_size=64M
tmp_table_size=128M
thread_cache_size=8
query_cache_size=128M
query_cache_type=1
max_connections=400
wait_timeout=300
|
|