提高网站性能(Nginx - PHP - FPM5.5 - MySQL5.5)

I'm setting up a new server, but my website keeps going down after migration to a better server.

Server specification:
CPU(s): 56
Model name: Intel(R) Xeon(R) Gold 5120 CPU @ 2.20GHz
Mem: 30G
Read - Write 8.1 GB/s - 1.9 GB/s

nginx/1.12.2 PHP 5.6.40 5.5.63-MariaDB MariaDB Server

nginx configuration:

location / {
        index index.php  index.html index.htm;
        rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last;
        rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
        try_files $uri $uri/ /index.php?$args;
        proxy_read_timeout 660s;
        proxy_send_timeout 660s;
        }

location ~ \.php$ {
        fastcgi_pass   127.0.0.1:9002;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;
        include fastcgi_params;
        fastcgi_param  QUERY_STRING     $query_string;
        fastcgi_param  REQUEST_METHOD   $request_method;
        fastcgi_param  CONTENT_TYPE     $content_type;
        fastcgi_param  CONTENT_LENGTH   $content_length;
        fastcgi_intercept_errors        on;
        fastcgi_ignore_client_abort     on;
        fastcgi_connect_timeout 600;
        fastcgi_send_timeout 660;
        fastcgi_read_timeout 660;
        fastcgi_buffer_size 256m;
        fastcgi_buffers 16 128m;
        fastcgi_busy_buffers_size 256m;
        fastcgi_temp_file_write_size 256m;
        }

php-fpm configuration:

listen.allowed_clients = 127.0.0.1
pm =ondemand
pm.process_idle_timeout = 5s
pm.max_children = 100
;pm.start_servers = 30
;pm.min_spare_servers = 10
;pm.max_spare_servers = 20
;pm.max_requests = 2500
pm.max_requests = 450
;pm.status_path = /status
request_terminate_timeout = 500s
slowlog = /var/log/php-fpm/www-slow.log
request_slowlog_timeout = 200s
php_admin_value[error_log] = /var/log/php-fpm/error.log
php_admin_flag[log_errors] = on
php_value[session.save_handler] = files
php_value[session.save_path] = /var/lib/php/session
catch_workers_output = yes

my.cnf:

[mysqld]
max_connections = 550
datadir         =/var/lib/mysql
port            = 3306
innodb_force_recovery = 4
default-storage-engine=MyISAM
socket          = /var/lib/mysql/mysql.sock
key_buffer_size = 4G
max_allowed_packet = 3048M
table_open_cache = 2048
net_read_timeout=3600
net_write_timeout=3600
sort_buffer_size = 8M
read_buffer_size = 8M
read_rnd_buffer_size = 32M
myisam_sort_buffer_size = 128M
thread_cache_size = 40
query_cache_type = 1
query_cache_size = 4G
max_heap_table_size = 1024M
tmp_table_size =1024M

Can anyone help improving this?

ds3422222
ds3422222 您可以与社区分享的任何新闻?进展?
一年多之前 回复
douyan6958
douyan6958 如果您仍在尝试使用innodb_force_recovery=4运行,请查看强制恢复的目的,让您的系统更接近“正常”的生产环境。免责声明:我是在我的个人资料,网络个人资料中命名的网站网站内容的作者,可以提供其他建议。
一年多之前 回复
doujiaohuo1096
doujiaohuo1096 你有没有应用2019年4月6日23:16的任何建议?你有什么结果?附加建议:max_allowed_pa​​cket=1G是上限,请更改你的my.cnf。key_buffer_size=512M应该足够4G。您不能使用当前的低信誉评分进行投票或接受。
一年多之前 回复
dtz55359
dtz55359 您是否知道innodb_force_recovery=4仅用于EMERGENCY从您的服务器获取数据?它不适用于正在进行的常规操作。删除read_buffer_size,read_rnd_buffer_size以允许使用DEFAULTS。thread_cache_size=256,query_cache_type=0表示OFF,query_cache_size=0表示可以节省RAM并减少查询缓存管理的CPU开销。max_heap_table_size=300M,tmp_table_size=300M。请过几天告诉我们你的进展情况。
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问