我有一个带有mysql 5.5的站点,我安装了wordpress和一个生成html页面的缓存插件。这个站点每天有大约50k的访问者,有时我的站点会“崩溃”(后端只有或者有时也是前端的),所以我需要停止sql server,并重新启动它。(这种崩溃可能在几个月内就有1次,也可能在一周内超过1次,它们是随机发生的)(当我重新启动sql服务器时,由于html缓存+ "cloudflare a on“,站点仍然完全正常工作),但我希望避免这种崩溃。这是我的sql config (ovh) ps:我的站点没有WP用户,只有管理员,所以每个访问者都要打开缓存。
[mysqld]
tmp_table_size=400M
query_cache_size=1M
skip-external-locking
key_buffer_size = 12M
max_allowed_packet = 1M
table_cache = 4
table_open_cache = 96
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 128K
thread_cache_size = 4
max_heap_table_size = 600M
max_binlog_cache_size = 1M
max_join_size = 1M
max_seeks_for_key = 2M
max_write_lock_count = 512K
myisam_max_sort_file_size = 1M
########################
##Configuration Innodb##
##Uncomment the next line to disable Innodb
skip-innodb
default-storage-engine=myisam
innodb_buffer_pool_size = 16M
innodb_additional_mem_pool_size = 2M
innodb_log_file_size = 10M
innodb_log_buffer_size = 4M
innodb_flush_log_at_trx_commit=1我如何优化这个配置?
或者我需要提升我的出价?实际上,我有以下内容:https://www.ovh.co.uk/web-hosting/performance-web-hosting.xml web性能1+带有128 web ram + cloudflare cdn/cache的专用sql
另外,用于缓存的插件是:https://wordpress.org/plugins/wp-fastest-cache/faq/和我经常运行“优化/修复”查询
发布于 2016-04-27 14:55:55
我认为您应该将日志文件大小增加到> 2BG。
I配置一个Magento站点,其产品超过20k,用户为3k /天,值为my.cnf:
innodb_buffer_pool_size = 8G
innodb_change_buffering=all
innodb_log_buffer_size=16M
innodb_additional_mem_pool_size=20M
innodb_log_file_size = 1536M
innodb_autoextend_increment=512
thread_concurrency = 3
thread_cache_size = 32
table_cache = 1024
query_cache_size = 512M
query_cache_limit = 512M
join_buffer_size = 256M
tmp_table_size = 512M
key_buffer = 256M
max_heap_table_size = 512M
read_buffer_size = 512M
read_rnd_buffer_size = 512M
bulk_insert_buffer_size = 128M 重要的值是
innodb_log_file_size
innodb_buffer_pool_size希望这是合理的。
发布于 2016-04-27 13:04:42
每天50,000名访问者,您正在接收0.5787037037访问者一秒钟。如果是这样的话,我建议要么将服务器升级到拥有128 to以上RAM的SQL数据库。如果这不是一种选择,缓存是您最后的选择。
注意,不管您如何努力推动缓存,如果您的服务器一开始就很弱或很差,那么缓存仍然是非常有限的。
https://stackoverflow.com/questions/36890631
复制相似问题