Mysql Ubuntu服务器正在随机关闭

Mysql Ubuntu服务器正在随机关闭,mysql,linux,wordpress,apache,ubuntu,Mysql,Linux,Wordpress,Apache,Ubuntu,我的Digital Ocean服务器在Wordpress上运行了一个博客,我遇到了一些问题。 服务器会随机运行100%内存/处理和超过200MB/s的磁盘IO,直到博客崩溃 如果我重新启动apache,服务器将恢复正常。 这种情况每周发生三次,与许多同时使用该网站的用户无关 我浏览了互联网,使用了一些解决方案,但没有任何真正的帮助。 我正在使用以下工具: - Wordpress version: 4.7.2 - Php version: PHP 5.6.28-1+deb.sury.org~xe

我的Digital Ocean服务器在Wordpress上运行了一个博客,我遇到了一些问题。 服务器会随机运行100%内存/处理和超过200MB/s的磁盘IO,直到博客崩溃

如果我重新启动apache,服务器将恢复正常。 这种情况每周发生三次,与许多同时使用该网站的用户无关

我浏览了互联网,使用了一些解决方案,但没有任何真正的帮助。 我正在使用以下工具:

- Wordpress version: 4.7.2

- Php version:
PHP 5.6.28-1+deb.sury.org~xenial+1 (cli) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

- Linux Version:
Linux 3.13.0-57-generic #95-Ubuntu SMP Fri Jun 19 09:28:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Ubuntu 16.04 server
我花了一些时间查看日志文件,dmesg、fail2ban、faillog和syslog没有任何异常

然而,apacheerror.log和access.log有一些有趣的东西

在错误日志中,我看到了很多这样的行:

[Wed Oct 25 16:43:31.234364 2017] [:error] [pid 23211] [client 172.68.26.39:37081] PHP Warning: Error while sending QUERY packet. PID=23211 in public_html/wp-includes/wp-db.php on line 1877, referer: https://sitename/blogpostname/comment-page-6/
[Wed Oct 25 16:43:31.615950 2017] [:error] [pid 23216] [client 172.68.27.196:15015] PHP Warning: Error while sending QUERY packet. PID=23216 in public_html/wp-includes/wp-db.php on line 1877, referer: https://www.google.com.br/
[Wed Oct 25 16:43:31.600365 2017] [:error] [pid 23224] [client 172.68.27.64:20351] PHP Warning: Error while sending QUERY packet. PID=23224 in public_html/wp-includes/wp-db.php on line 1877, referer: https://www.google.com.br/
[Wed Oct 25 16:43:32.736840 2017] [:error] [pid 22410] [client 162.158.74.163:17321] PHP Warning: Error while sending QUERY packet. PID=22410 in public_html/wp-includes/wp-db.php on line 1877
在1877行的wp-db.php文件中,这是一个随机的普通行,没有任何问题

在谷歌搜索之后,我看到很多人在更改php和apache配置文件中的一些变量时遇到了同样的问题。 因此,我增加了以下变量:

max_execution_time
max_allowed_packet_size
max_user_connections
max_connections 
And disabled the W3 Total Cache plugin
还是没有运气。 检查了cronjobs,它没有在我遇到这个问题的同时触发的任何作业

我将apache的error.log、access.log和mysql error.log放在上面的链接上,以备需要。 我上次遇到这个问题是在10月25日16:40,直到16:57重新启动apache服务

MYSQL错误日志文件中的一些行

            2017-10-25T18:40:00.355353Z 11952 [Note] Aborted connection 11952 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
            2017-10-25T18:40:01.869160Z 12116 [Note] Aborted connection 12116 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
            2017-10-25T18:43:10.465788Z 12185 [Note] Aborted connection 12185 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
            2017-10-25T18:43:11.058421Z 12199 [Note] Aborted connection 12199 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
            2017-10-25T18:43:13.415412Z 12187 [Note] Aborted connection 12187 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
            2017-10-25T18:43:15.844868Z 12186 [Note] Aborted connection 12186 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
            2017-10-25T18:43:21.387382Z 12217 [Note] Aborted connection 12217 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
            2017-10-25T18:43:21.418078Z 12218 [Note] Aborted connection 12218 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
            2017-10-25T18:43:21.747628Z 12093 [Note] Aborted connection 12093 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
            2017-10-25T18:43:24.705706Z 12219 [Note] Aborted connection 12219 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
            2017-10-25T18:43:29.267584Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
            2017-10-25T18:43:29.268753Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
            2017-10-25T18:43:29.812542Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
            2017-10-25T18:43:29.874865Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.15-0ubuntu0.16.04.1) starting as process 23296 ...
            2017-10-25T18:43:29.945767Z 0 [Note] InnoDB: PUNCH HOLE support available
            2017-10-25T18:43:29.945855Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
            2017-10-25T18:43:29.945891Z 0 [Note] InnoDB: Uses event mutexes
            2017-10-25T18:43:29.945902Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
            2017-10-25T18:43:29.945911Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
            2017-10-25T18:43:29.945922Z 0 [Note] InnoDB: Using Linux native AIO
            2017-10-25T18:43:29.954531Z 0 [Note] InnoDB: Number of pools: 1
            2017-10-25T18:43:29.957647Z 0 [Note] InnoDB: Using CPU crc32 instructions
            2017-10-25T18:43:29.962895Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
            2017-10-25T18:43:30.069723Z 0 [Note] InnoDB: Completed initialization of buffer pool
            2017-10-25T18:44:29.139834Z 0 [ERROR] InnoDB: Cannot allocate 1677722136 bytes of memory after 60 retries over 60 seconds. OS error: Cannot allocate memory (12). Check if you should increase the swap file or ulimits of your operating system. Note that on most 32-bit computers the process memory space is limited to 2 GB or 4 GB.
            2017-10-25 16:44:29 0x7fec07b49740  InnoDB: Assertion failure in thread 140651718285120 in file ut0ut.cc line 931
            InnoDB: Failing assertion: !m_fatal
            InnoDB: We intentionally generate a memory trap.
            InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
            InnoDB: If you get repeated assertion failures or crashes, even
            InnoDB: immediately after the mysqld startup, there may be
            InnoDB: corruption in the InnoDB tablespace. Please refer to
            InnoDB: http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html
            InnoDB: about forcing recovery.
            18:44:29 UTC - mysqld got signal 6 ;
            This could be because you hit a bug. It is also possible that this binary
            or one of the libraries it was linked against is corrupt, improperly built,
            or misconfigured. This error can also be caused by malfunctioning hardware.
            Attempting to collect some information that could help diagnose the problem.
            As this is a crash and something is definitely wrong, the information
            collection process might fail.

            key_buffer_size=16777216
            read_buffer_size=131072
            max_used_connections=0
            max_threads=151
            thread_count=0
            connection_count=0
            It is possible that mysqld could use up to 
            key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 76382 K  bytes of memory
            Hope that's ok; if not, decrease some variables in the equation.

            Thread pointer: 0x0
            Attempting backtrace. You can use the following information to find out
            where mysqld died. If you see no messages after this, something went
            terribly wrong...
            stack_bottom = 0 thread_stack 0x30000
            /usr/sbin/mysqld(my_print_stacktrace+0x3b)[0xe7f80b]
            /usr/sbin/mysqld(handle_fatal_signal+0x489)[0x784769]
            /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7fec06ac03d0]
            /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7fec05e7a418]
            /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7fec05e7c01a]
            /usr/sbin/mysqld[0x75a5ee]
            /usr/sbin/mysqld(_ZN2ib14fatal_or_errorD2Ev+0x2e8)[0x1116f58]
            /usr/sbin/mysqld[0xfd53c5]
            /usr/sbin/mysqld(_Z8log_initv+0x4a5)[0xfdba25]
            /usr/sbin/mysqld(_Z34innobase_start_or_create_for_mysqlv+0x22ed)[0x10bcd3d]
            /usr/sbin/mysqld[0xf81339]
            /usr/sbin/mysqld(_Z24ha_initialize_handlertonP13st_plugin_int+0x51)[0x7d1bc1]
            /usr/sbin/mysqld[0xc665b5]
            /usr/sbin/mysqld(_Z11plugin_initPiPPci+0x608)[0xc6dc58]
            /usr/sbin/mysqld[0x77cce4]
            /usr/sbin/mysqld(_Z11mysqld_mainiPPc+0x7e4)[0x77e264]
            /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fec05e65830]
            /usr/sbin/mysqld(_start+0x29)[0x774c79]
            The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
            information that should help you find out what is causing the crash.
            2017-10-25T18:44:29.747705Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
            2017-10-25T18:44:29.747973Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
            2017-10-25T18:44:30.168154Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
            2017-10-25T18:44:30.175188Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.15-0ubuntu0.16.04.1) starting as process 23379 ...
            2017-10-25T18:44:30.227947Z 0 [Note] InnoDB: PUNCH HOLE support available
            2017-10-25T18:44:30.228037Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
            2017-10-25T18:44:30.228056Z 0 [Note] InnoDB: Uses event mutexes
            2017-10-25T18:44:30.228067Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
            2017-10-25T18:44:30.228075Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
            2017-10-25T18:44:30.228083Z 0 [Note] InnoDB: Using Linux native AIO
            2017-10-25T18:44:30.229957Z 0 [Note] InnoDB: Number of pools: 1
            2017-10-25T18:44:30.231671Z 0 [Note] InnoDB: Using CPU crc32 instructions
            2017-10-25T18:44:30.235573Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
            2017-10-25T18:44:30.262313Z 0 [Note] InnoDB: Completed initialization of buffer pool
            2017-10-25T18:45:26.314564Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
            2017-10-25T18:45:26.351139Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
            2017-10-25T18:45:26.387449Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 162362845023
            2017-10-25T18:45:26.387528Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 162362845032
            2017-10-25T18:45:26.387864Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 162362845032
            2017-10-25T18:45:26.387888Z 0 [Note] InnoDB: Database was not shutdown normally!
            2017-10-25T18:45:26.387932Z 0 [Note] InnoDB: Starting crash recovery.
            2017-10-25T18:45:27.653149Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
            2017-10-25T18:45:27.655693Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
            2017-10-25T18:45:27.655993Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
            2017-10-25T18:45:27.832424Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
            2017-10-25T18:45:27.839253Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
            2017-10-25T18:45:27.839314Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
            2017-10-25T18:45:27.841792Z 0 [Note] InnoDB: Waiting for purge to start
            2017-10-25T18:45:27.897127Z 0 [Note] InnoDB: 5.7.15 started; log sequence number 162362845032
            2017-10-25T18:45:27.913296Z 0 [Note] Plugin 'FEDERATED' is disabled.
            2017-10-25T18:45:27.921641Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
            2017-10-25T18:45:28.017907Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
            2017-10-25T18:45:28.018041Z 0 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
            2017-10-25T18:45:28.018712Z 0 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
            2017-10-25T18:45:28.019306Z 0 [Note] Server socket created on IP: '127.0.0.1'.
            2017-10-25T18:45:28.163336Z 0 [Note] Event Scheduler: Loaded 0 events
            2017-10-25T18:45:28.166514Z 0 [Note] /usr/sbin/mysqld: ready for connections.
            Version: '5.7.15-0ubuntu0.16.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu)
            2017-10-25T18:45:30.429764Z 0 [Note] InnoDB: Buffer pool(s) load completed at 171025 16:45:30
            2017-10-25T18:53:52.366879Z 159 [Note] Aborted connection 159 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
            2017-10-25T18:56:03.345944Z 200 [Note] Aborted connection 200 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
            2017-10-25T18:56:04.660063Z 199 [Note] Aborted connection 199 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
            2017-10-25T18:56:05.729653Z 177 [Note] Aborted connection 177 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
            2017-10-25T18:56:12.520890Z 205 [Note] Aborted connection 205 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
            2017-10-25T18:56:12.669290Z 155 [Note] Aborted connection 155 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
            2017-10-25T18:56:16.064185Z 175 [Note] Aborted connection 175 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
            2017-10-25T18:56:19.823038Z 51 [Note] Aborted connection 51 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
            2017-10-25T18:56:20.741167Z 206 [Note] Aborted connection 206 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
            2017-10-25T18:56:20.746381Z 42 [Note] Aborted connection 42 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
            2017-10-25T18:56:24.312023Z 122 [Note] Aborted connection 122 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
            2017-10-25T18:56:24.352842Z 186 [Note] Aborted connection 186 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
            2017-10-25T18:56:25.449125Z 148 [Note] Aborted connection 148 to db: '<Database name>' user: '<Database User>' host: 'localhost' (Got timeout reading communication packets)
            2017-10-25T18:56:28.626509Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
            2017-10-25T18:56:28.626841Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
            2017-10-25T18:56:30.071894Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
            2017-10-25T18:56:30.105638Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.15-0ubuntu0.16.04.1) starting as process 23873 ...
            2017-10-25T18:56:30.235898Z 0 [Note] InnoDB: PUNCH HOLE support available
            2017-10-25T18:56:30.236056Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
            2017-10-25T18:56:30.236126Z 0 [Note] InnoDB: Uses event mutexes
            2017-10-25T18:56:30.236150Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
            2017-10-25T18:56:30.236167Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
            2017-10-25T18:56:30.236182Z 0 [Note] InnoDB: Using Linux native AIO
            2017-10-25T18:56:30.239770Z 0 [Note] InnoDB: Number of pools: 1
            2017-10-25T18:56:30.243200Z 0 [Note] InnoDB: Using CPU crc32 instructions
            2017-10-25T18:56:30.297785Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
            2017-10-25T18:56:30.471494Z 0 [Note] InnoDB: Completed initialization of buffer pool
            2017-10-25T18:57:24.662239Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
            2017-10-25T18:57:24.855967Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
            2017-10-25T18:57:24.892537Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 162362990185
            2017-10-25T18:57:24.892649Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 162362990194
            2017-10-25T18:57:24.893393Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 162362990194
            2017-10-25T18:57:24.893430Z 0 [Note] InnoDB: Database was not shutdown normally!
            2017-10-25T18:57:24.893449Z 0 [Note] InnoDB: Starting crash recovery.
            2017-10-25T18:57:25.486004Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
            2017-10-25T18:57:25.486109Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
            2017-10-25T18:57:25.486191Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
            2017-10-25T18:57:25.561775Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
            2017-10-25T18:57:25.565595Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
            2017-10-25T18:57:25.565662Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
            2017-10-25T18:57:25.583476Z 0 [Note] InnoDB: 5.7.15 started; log sequence number 162362990194
            2017-10-25T18:57:25.585667Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
            2017-10-25T18:57:25.589295Z 0 [Note] Plugin 'FEDERATED' is disabled.
            2017-10-25T18:57:25.661688Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
            2017-10-25T18:57:25.661775Z 0 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
            2017-10-25T18:57:25.661845Z 0 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
            2017-10-25T18:57:25.661935Z 0 [Note] Server socket created on IP: '127.0.0.1'.
            2017-10-25T18:57:25.756913Z 0 [Note] Event Scheduler: Loaded 0 events
            2017-10-25T18:57:25.758546Z 0 [Note] /usr/sbin/mysqld: ready for connections.
            Version: '5.7.15-0ubuntu0.16.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu)
            2017-10-25T18:57:25.958884Z 0 [Note] InnoDB: Buffer pool(s) load completed at 171025 16:57:25
my.cnf

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
#innodb_log_file_size = 256M
[mysqld]
innodb_file_per_table
#innodb_file_format = Barracuda
max_allowed_packet = 1G
innodb_log_file_size = 500M
innodb_log_buffer_size = 800M
innodb_strict_mode = 0
wait_timeout = 100
php.ini

[PHP]

engine = On
short_open_tag = Off
asp_tags = Off
precision = 14
output_buffering = 4096
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func =
serialize_precision = 17
disable_functions =
disable_classes =
zend.enable_gc = On
expose_php = On
max_execution_time = 100
max_input_time = 60
memory_limit = -1
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
track_errors = Off
html_errors = On
variables_order = "GPCS"
request_order = "GP"
register_argc_argv = Off
auto_globals_jit = On
post_max_size = 8M
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
default_charset = "UTF-8"
doc_root =
user_dir =
enable_dl = Off
file_uploads = On
upload_max_filesize = 24M
max_file_uploads = 20
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60

[CLI Server]
cli_server.color = On

[Date]

[filter]

[iconv]

[intl]

[sqlite3]

[Pcre]

[Pdo]

[Pdo_mysql]
pdo_mysql.cache_size = 2000
pdo_mysql.default_socket=

[Phar]

[SQL]
sql.safe_mode = Off

[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1

[Interbase]
ibase.allow_persistent = 1
ibase.max_persistent = -1
ibase.max_links = -1
ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
ibase.dateformat = "%Y-%m-%d"
ibase.timeformat = "%H:%M:%S"

[MySQL]
mysql.allow_local_infile = On
mysql.allow_persistent = On
mysql.cache_size = 2000
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off

[MySQLi]]
mysqli.max_persistent = -1
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.cache_size = 2000
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off

[mysqlnd]
mysqlnd.collect_statistics = On
mysqlnd.collect_memory_statistics = Off

[OCI8]]

[PostgreSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0

[Sybase-CT]
sybct.allow_persistent = On
sybct.max_persistent = -1
sybct.max_links = -1
sybct.min_server_severity = 10
sybct.min_client_severity = 10

[bcmath]
bcmath.scale = 0

[browscap]

[Session]
session.save_handler = files
session.use_strict_mode = 0
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_probability = 0
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.referer_check =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 5
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"

[MSSQL]
mssql.allow_persistent = On
mssql.max_persistent = -1
mssql.max_links = -1
mssql.min_error_severity = 10
mssql.min_message_severity = 10
mssql.compatibility_mode = Off
mssql.secure_connection = Off

[Assertion]

[COM]

[mbstring]

[gd]

[exif]

[Tidy]
tidy.clean_output = Off

[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
soap.wsdl_cache_limit = 5
全局状态和全局变量位于dropbox文件中:

以及引擎的InnoDb状态

Type    Name    Status
InnoDB      "=====================================
                2017-10-27 ..."

在每天只实施一个项目之前,您需要研究以下建议。有些可以动态应用。建议的cfg/ini值如下,可以修改、添加或删除

innodb_print_all_deadlocks=1 # from OFF to record in error log for CORRECTION
slow_query_log=1 # from OFF to record for possible CORRECTION
innodb_log_buffer_size=838860800  REMOVE to allow default of 16M (buffer size is larger than file size today and likely your most significant difficulty) NOT a dynamic variable
thread_cache_size=100 #from 8 to support 500 created threads since start
innodb_read_ahead_threshold=8 #from 56 for your intensity of reading
innodb_stats_sample_pages=32 #from 8 for more accurate cardinality of ndx's
have_query_cache=NO #from yes default since you have no intention of using qc
query_cache_size=0 #from 16M to conserve RAM
key_buffer_size=1M #from 16M, only used by ISAM.  Low requirements
key_cache_age_threshold=64800 #from 300 seconds, avoid RD for 8 hours
max_write_lock_count=128 #from enormous number to allow RD after this nn
sql_select_limit=1000000000 #from enormous number to 1 Billion rows selected limit
table_open_cache= 10000 #from 2000 to support 40,000 opened since start.
如果可能的话,需要对ulimit进行审查并使其更加宽容。
在适当的时候,请提供反馈。

可能在某个地方是一个无休止的循环。也许用时间戳记录每个请求的开始和结束,你就能找到那些永远不会结束的请求,因此永远不会写入访问日志?根据你在第25行发布的错误日志,有人刚刚要求1677722136字节的RAM。那是一场半小时的演出。然后在日志中记录断言错误。我们需要知道您的MySQL服务器有多少RAM,请在您的问题文本中发布显示全局状态的结果;显示全局变量;显示引擎INNODB状态:请发布MySQL完整的cfg.ini和php.ini。我已经插入了配置文件。所有不存在的东西都会被评论。SHOW GLOBAL STATS对我来说太长了,无法放在这里,所以我在dropbox上放了指向文件的链接。谢谢,你的服务器有多少RAM?CPU的?HDD或SSD存储和每个GB的数量?感谢您的回复,因为此问题的发生是随机的,我已经将前两行放在那里,并将查看日志文件是否可以向我显示更多信息。第三行可能会纠正“随机”问题。其他方法只会使系统更能响应用户请求。每天只更改一个。嗨,谢谢你的回复,我现在正在更改这个变量。我想这可能就是问题所在。“随机”问题再次出现,在谷歌搜索新日志文件的一些内容后,我遇到了这个页面,它基本上说缓冲区不能大于文件大小。我将更改此值并使用结果进行更新。感谢MySQL和大多数系统,如果BUFFER SIZE>FILE SIZE=出现问题,因为您将“超过”下一次向请求的目标进程推送数据。因此,我按照您的建议更改了一些变量,并且我又出现了几次相同的错误。所以我决定按照你的建议改变所有的变量。其中一些在重启过程中使mysql崩溃。这些是:have\u query\u cache=0 key\u age\u threshold=64800 sql\u sql\u limit=100000000现在我可能要等一周左右,看看问题是否再次发生,然后回复反馈。谢谢你的帮助!
Type    Name    Status
InnoDB      "=====================================
                2017-10-27 ..."
innodb_print_all_deadlocks=1 # from OFF to record in error log for CORRECTION
slow_query_log=1 # from OFF to record for possible CORRECTION
innodb_log_buffer_size=838860800  REMOVE to allow default of 16M (buffer size is larger than file size today and likely your most significant difficulty) NOT a dynamic variable
thread_cache_size=100 #from 8 to support 500 created threads since start
innodb_read_ahead_threshold=8 #from 56 for your intensity of reading
innodb_stats_sample_pages=32 #from 8 for more accurate cardinality of ndx's
have_query_cache=NO #from yes default since you have no intention of using qc
query_cache_size=0 #from 16M to conserve RAM
key_buffer_size=1M #from 16M, only used by ISAM.  Low requirements
key_cache_age_threshold=64800 #from 300 seconds, avoid RD for 8 hours
max_write_lock_count=128 #from enormous number to allow RD after this nn
sql_select_limit=1000000000 #from enormous number to 1 Billion rows selected limit
table_open_cache= 10000 #from 2000 to support 40,000 opened since start.