【发布时间】:2016-08-21 19:10:26
【问题描述】:
我有一个 mysql 5.5 的站点,我已经安装了 wordpress 和一个生成 html 页面的缓存插件。该站点每天大约有 50k 访问者,有时我的站点“崩溃”(仅后端或有时也是前端),因此我需要停止 sql server,然后重新启动它。 (这种崩溃可能是几个月内发生 1 次,也可能是一周内发生 1 次以上,它们是随机发生的) (当我重新启动 sql 服务器时,由于 html 缓存 +“cloudflare always on”,该站点仍然可以正常工作)但我想避免这种崩溃。这是我的 sql 配置(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 performance 1 + private sql with 128mb ram + cloudflare cdn/cache
另外,用于缓存的插件是这样的:https://wordpress.org/plugins/wp-fastest-cache/faq/ 我经常运行“优化/修复”查询
【问题讨论】:
-
你知道 MySQL 服务器为什么会崩溃吗?
-
不,可能是因为查询太多或服务器 cpu/ram 不佳。当我第一次安装 WP 时,该服务器非常糟糕,即使每天有 1 万次访问,但使用我上面写的设置,它一直运行良好,直到一个月前它开始随机崩溃。
-
当您不知道错误是什么时,修复错误会更加困难。你查看过服务器上的日志吗? Apache 和 PHP 和 MYSQL
-
这是最常见的错误
FastCGI: comm with server "/homez.444/example/www/file.php" aborted: idle timeout (300 sec) [error] [client 000] [host www.example.org] FastCGI: incomplete headers (0 bytes) received from server "/homez.444/example/www/file.php" [error] [client 000] [host www.example.org] FastCGI: An error happend on Fastcgi processing, fallback to CGI [error] [client 000] [host www.example.org] FastCGI: comm with server "/homez.444/example/www/file1.php" aborted: idle timeout (300 sec), referer: http://www.example.org/article/ -
但是,我在我的主机上使用此设置
app.engine=php app.engine.version=5.6 http.firewall=none environment=production container.image=legacy
标签: php mysql wordpress caching