Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/259.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 服务器在使用eBeSucher流量交换时陷入停滞_Php_Wordpress_Dedicated Server_Query Cache_Mysqltuner - Fatal编程技术网

Php 服务器在使用eBeSucher流量交换时陷入停滞

Php 服务器在使用eBeSucher流量交换时陷入停滞,php,wordpress,dedicated-server,query-cache,mysqltuner,Php,Wordpress,Dedicated Server,Query Cache,Mysqltuner,我有6个网站都在同一台专用服务器上,其中2个网站的流量非常稳定。我想说的是,他们在这两个网站上的人数始终至少为90至120人,其余的则为15至25人 这些站点目前运行正常,直到最近3天,一家付费流量共享公司被调用,为其他4个站点提供与主站点相同的流量,所有这些站点都托管在同一台服务器上-导致该站点在发出正确请求之前立即超时,如果它在2到3次刷新后决定加载,则需要几秒钟加30秒在停车之前。一旦你开始向内点击,网站的加载速度会更快,但很快就会下降到原来的水平 我一直在使用mysqltuner对my.

我有6个网站都在同一台专用服务器上,其中2个网站的流量非常稳定。我想说的是,他们在这两个网站上的人数始终至少为90至120人,其余的则为15至25人

这些站点目前运行正常,直到最近3天,一家付费流量共享公司被调用,为其他4个站点提供与主站点相同的流量,所有这些站点都托管在同一台服务器上-导致该站点在发出正确请求之前立即超时,如果它在2到3次刷新后决定加载,则需要几秒钟加30秒在停车之前。一旦你开始向内点击,网站的加载速度会更快,但很快就会下降到原来的水平

我一直在使用mysqltuner对my.cnf文件进行更改,但设置没有按预期工作。以及将它们调整到正确的音调。服务器容量为20TB,有更多的带宽来支持其自身

这些网站都是WordPress,安装了WP-SuperCache,所以速度应该更快。下面是我的配置设置,我确信它已经变得有点不平衡了。请注意,用于清理的表错误不是来自WP站点的表,与性能无关

mysqltuner结果

-------- Performance Metrics -------------------------------------------------
[--] Up for: 10h 23m 10s (11M q [295.373 qps], 666K conn, TX: 77G, RX: 1G)
[--] Reads / Writes: 50% / 50%
[--] Binary logging is disabled
[--] Total buffers: 4.8G global + 4.6M per thread (1000 max threads)
[OK] Maximum reached memory usage: 5.3G (67.58% of installed RAM)
[!!] Maximum possible memory usage: 9.3G (119.39% of installed RAM)
[OK] Slow queries: 0% (678/11M)
[OK] Highest usage of available connections: 10% (104/1000)
[OK] Aborted connections: 0.08%  (528/666673)
[OK] Query cache efficiency: 69.3% (2M cached / 3M selects)
[!!] Query cache prunes per day: 130766
[OK] Sorts requiring temporary tables: 0% (109 temp sorts / 179K sorts)
[!!] Temporary tables created on disk: 58% (111K on disk / 191K total)
[OK] Thread cache hit rate: 99% (120 created / 666K connections)
[OK] Table cache hit rate: 40% (2K open / 5K opened)
[OK] Open file limit used: 19% (1K/10K)
[OK] Table locks acquired immediately: 99% (1M immediate / 1M locks)

-------- MyISAM Metrics ------------------------------------------------------
[!!] Key buffer used: 29.0% (19M used / 68M cache)
[OK] Key buffer size / total MyISAM indexes: 65.0M/64.1M
[OK] Read Key buffer hit rate: 100.0% (30M cached / 13K reads)
[!!] Write Key buffer hit rate: 13.0% (239K cached / 208K writes)

-------- InnoDB Metrics ------------------------------------------------------
[--] InnoDB is enabled.
[!!] InnoDB buffer pool / data size: 4.0G/8.7G
[!!] InnoDB buffer pool instances: 1
[!!] InnoDB Used buffer: 23.71% (62152 used/ 262144 total)
[OK] InnoDB Read buffer efficiency: 99.99% (390201875 hits/ 390245584 total)
[!!] InnoDB Write Log efficiency: 85.21% (1596393 hits/ 1873419 total)
[OK] InnoDB log waits: 0.00% (0 waits / 277026 writes)

-------- ThreadPool Metrics --------------------------------------------------
[--] ThreadPool stat is disabled.

-------- AriaDB Metrics ------------------------------------------------------
[--] AriaDB is disabled.

-------- TokuDB Metrics ------------------------------------------------------
[--] TokuDB is disabled.

-------- Galera Metrics ------------------------------------------------------
[--] Galera is disabled.

-------- Replication Metrics -------------------------------------------------
[--] No replication slave(s) for this server.
[--] This is a standalone server..

-------- Recommendations -----------------------------------------------------
General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    Set up a Secure Password for user@host ( SET PASSWORD FOR 'user'@'SpecificDNSorIp' =                                                                                 PASSWORD('secure_password'); )
    MySQL started within last 24 hours - recommendations may be inaccurate
    Reduce your overall MySQL memory footprint for system stability
    Increasing the query_cache size over 128M may reduce performance
    Temporary table size is already large - reduce result set size
    Reduce your SELECT DISTINCT queries without LIMIT clauses
Variables to adjust:
  *** MySQL's maximum memory usage is dangerously high ***
  *** Add RAM before increasing MySQL buffer variables ***
    query_cache_size (> 128M) [see warning above]
    innodb_buffer_pool_size (>= 8G) if possible.
    innodb_buffer_pool_instances(=4)
这是my.cnf文件

[mysqld]
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under different user or group,
# customize your systemd unit file for mysqld according to the
# instructions in http://fedoraproject.org/wiki/Systemd
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
tmpdir=/dev/shm
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

open_files_limit=10000
query_cache_size=128M
query_cache_type=1
max_connections=1000
max_user_connections=25
wait_timeout=300
tmp_table_size=512M
max_heap_table_size=512M
thread_cache_size=64
key_buffer_size=65M
max_allowed_packet=268435456
table_cache=2048
table_definition_cache=2048

#delayed_insert_timeout=20 # Turn on if max_connections being reached due to delayed inserts
#delayed_queue_size=300 # Turn on if max_connections being reached due to delayed inserts

myisam_sort_buffer_size=32M # can be increased per sessions if needed for alter tables (indexes, repair)

query_cache_limit=2M # leave at default unless there is a good reason
join_buffer=2M # leave at default unless there is a good reason
sort_buffer_size=2M # leave at default unless there is a good reason
#read_rnd_buffer_size=256K # leave at default unless there is a good reason
#read_buffer_size=2M # leave at default unless there is a good reason

collation_server=utf8_unicode_ci
character_set_server=utf8

general_log=0
slow_query_log=1
log-output=TABLE # select * from mysql.general_log order by event_time desc limit 10;
long_query_time=5 # select * from mysql.slow_log order by start_time desc limit 10;

low_priority_updates=1
innodb_file_per_table=1

innodb_buffer_pool_size=4G # check mysql -e "SHOW GLOBAL STATUS LIKE 'Innodb_buffer_pool%';" - free vs total
innodb_additional_mem_pool_size=62M
innodb_log_buffer_size=62M
innodb_thread_concurrency=8 # Number of physical + virtual CPU's, preset when server is provisioned to have correct # of cores

default-storage-engine=MyISAM
[mysqld_safe]
我在这里做过,流量共享网站可能会因为过度ping你的服务器来获取他们发送给你的流量统计数据而伤害你——不确定这是一个值得去钻的兔子洞,还是我这边的配置太差。任何帮助、想法或想法都将不胜感激


非常感谢

碎片表-伪造;不要运行优化

危险的高内存使用率-不,不是。但要关闭它,请将最大连接数减少到200

查询缓存大小略高,为128M;不要提起它

大量基于磁盘的tmp表—将长查询时间缩短到1秒,并打开慢日志。一两天后再来,让我们看看这些顽皮的问题是什么。请注意,这也会将慢速查询提高到0%以上。我看到你把它打开,送到桌上。因此,使用select*from mysql.slow\u log order by query\u time desc limit 5获得感兴趣的查询。让我们与SHOW CREATE TABLE一起讨论它们

MyISAM和InnoDB的指标还不错;不需要采取行动

tmp_table_size=512M和max_heap_table_size=512M高得危险;将它们保持在RAM的1%以下

表_cache=2048——即使在起床的前10个小时,也会有一些震动;增加到4K

您似乎同时使用MyISAM和InnoDB