即使安装了 memcached 和 APC,服务器也需要 20 多秒(等待时间/缓慢的 IO 响应时间)来响应 HTTP 请求。我相信这与 MYSQL 有关系,因为该站点有很多INSERT查询。
任何帮助将不胜感激。提前致谢。
avg-cpu: %user %nice %system %iowait %steal %idle
6.38 0.03 1.05 0.40 0.00 92.14
avg-cpu: %user %nice %system %iowait %steal %idle
10.37 0.00 1.61 3.14 0.00 84.87
avg-cpu: %user %nice %system %iowait %steal %idle
9.40 0.00 1.41 1.53 0.00 87.67
avg-cpu: %user %nice %system %iowait %steal %idle
10.02 0.00 1.42 1.09 0.00 87.46
avg-cpu: %user %nice %system %iowait %steal %idle
9.32 0.00 1.31 0.78 0.00 88.59 …Run Code Online (Sandbox Code Playgroud) 我想将一些(不是全部)MyISAM 表转换为 InnoDB。
最好的配置是什么?(需要添加InnoDB设置,因为我的里面没有InnoDB设置my.cnf)。
我有一个写入密集型的网络应用程序,我买了一个 768M RAM 的 VDS
我将 bulk_insert_buffer_size 指定为 126M,其他一些参数如下:
[mysqld]
bulk_insert_buffer_size=126M
set-variable = max_connections=500
safe-show-database
max_user_connections=200
key_buffer_size = 16M
query_cache_size = 50M
tmp_table_size = 50M
max_heap_table_size = 200M
thread_cache_size = 4
table_cache = 80
thread_concurrency = 8
innodb_buffer_pool_size = 100M
innodb_log_file_size = 25M
query_cache_limit = 50M
innodb_flush_log_at_trx_commit = 2
Run Code Online (Sandbox Code Playgroud) 使用“mysqlslap”观察到以下情况。
mysqlslap -u root -p --create-schema=matrix --query=monthly_kpi.sql --iterations=1 --concurrency=1 --delimiter=";"
Benchmark
Average number of seconds to run all queries: 2.735 seconds
Minimum number of seconds to run all queries: 2.735 seconds
Maximum number of seconds to run all queries: 2.735 seconds
Number of clients running queries: 1
Average number of queries per client: 24
mysqlslap -u root -p --create-schema=matrix --query=monthly_kpi.sql --iterations=1 --concurrency=4 --delimiter=";"
Benchmark
Average number of seconds to run all queries: 14.600 seconds
Minimum number of seconds to run …Run Code Online (Sandbox Code Playgroud) mysql ×4
innodb ×2
my.cnf ×2
concurrency ×1
myisam ×1
mysql-5 ×1
optimization ×1
performance ×1