有没有太多的caching? 我有一个2GB的内存服务器。
我跑2-3个网站closures以下:
[mysqld] set-variable = max_connections=50 log-slow-queries safe-show-database skip-networking skip-name-resolve set-variable=local-infile=0 local-infile=0 query_cache_type=1 query_cache_limit=1M query_cache_size=32M table_cache=1024 table_definition_cache=512 max_heap_table_size=512 tmp_table_size=32M max_heap_table_size=32M thread_cache=32 key_buffer=64M read_buffer_size=1M sort_buffer_size=1M myisam_sort_buffer_size=64M thread_concurrency=4 interactive_timeout=100 wait_timeout=15 connect_timeout=10 long_query_time=1 flush_time=3600 [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
。
+----------------+----------------------+----------------------+----------------------+ | Storage Engine | Data Size | Index Size | Table Size | +----------------+----------------------+----------------------+----------------------+ | InnoDB | 0.188 MB | 0.250 MB | 0.438 MB | | MyISAM | 181.114 MB | 61.270 MB | 242.384 MB | | Total | 181.302 MB | 61.520 MB | 242.821 MB | +----------------+----------------------+----------------------+----------------------+
我们需要知道MyISAM和InnoDB有多less数据
以MB为单位发送此查询的结果。
SELECT IFNULL(B.engine,'Total')“Storage Engine”CONCAT(LPAD(REPLACE(FORMAT(B.DSize / POWER(1024,pw),3),'',''),17,'' ),'','SUBSTR('KMGTP',pw + 1,1),'B')“Data Size”,CONCAT(LPAD(REPLACE(FORMAT (格式(B.Tsize /格式),'''','','',''),'',SUBSTR('KMGTP',pw + 1,1),'B' POWER(1024,pw),3),'',''),17,''),'',SUBSTR('KMGTP',pw + 1,1),'B')“Table Size”FROM SELECT引擎,SUM(data_length)DSize,SUM(index_length)ISize,SUM(data_length + index_length)TSize FROM information_schema.tables WHERE table_schema NOT IN('mysql','information_schema')AND引擎IS NOT NULL GROUP BY引擎WITH ROLLUP) B,(SELECT 2 PW)A TSDER ORDER BY TSize;