M
M
Maxim Konishchev2020-05-23 20:41:43
MySQL
Maxim Konishchev, 2020-05-23 20:41:43

Why so many MySQL processes?

Hosted by CentOS 8, MySQL, 1C-Bitrix. Processes began to appear on the server:
usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid
First one, then two, and up to hundreds. Load processors at 100%.
I execute KILL of any process on the server, all are deleted at once. The site stops working, gives an error connecting to the database. MySQL itself does not start the process, you have to run the service mysqld restart command.
After the site starts working. but after 20 minutes, the processes multiply again and occupy almost 100% of the processors. In the log below is a piece from the file. Immediately after restarting MySQL and before a new restart.

Log (var/log/mysql/error.log):
2020-05-23T14:25:19.098847Z 0 [Note] /usr/sbin/mysqld: Shutdown complete

2020-05-23T14:25:39.120898Z 0 [Warning] Changed limits: max_open_files: 5000 (requested 8703
)
05-23T14:25:39.238234Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set. 2020-05-23T14:25: 39.238381Z
0 [Note] /usr/sbin/mysqld (mysqld 5.7.29-32-log) starting as process 230704 ...
] InnoDB: PUNCH HOLE support available
2020-05-23T14:25:39.294644Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-05-23T14:25:39.294647Z 0 [Note] InnoDB: Uses event mutexes
2020 -05-23T14:25:39.294650Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2020-05-23T14:25:39.294653Z 0 [Note] InnoDB: Compressed tables use zlib
1.2.7 0 [Note] InnoDB: Using CPU crc32 instructions
2020-05-23T14 :25:39.303760Z 0 [Note] InnoDB: Initializing buffer pool, total size = 9G, instances = 9, chunk size = 128M 2020-05-23T14:25 : 39.561860Z 0 [Note] Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-05-23T14:25:39.643057Z 0 [Note] InnoDB: Crash recovery did not find the parallel doublewrite buffer at /var/lib/mysql/xb_doublewrite
2020-05-23T14:25:39.645074Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2020-05-23T14:25:39.801553Z 0 [Note] InnoDB: Created parallel doublewrite buffer at /var/lib/mysql/xb_doublewrite, size 35389440 bytes
2020-05-23T14:25:40.043166Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-05-23T14:25:40.043313Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-05-23T14:25:40.075397Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-05-23T14:25:40.077189Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2020-05-23T14:25:40.077215Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2020-05-23T14:25:40.078403Z 0 [Note] InnoDB: Waiting for purge to start
2020-05-23T14:25:40.129057Z 0 [Note] InnoDB: Percona XtraDB 5.7.29-32 started; log sequence number 103422489791
2020-05-23T14:25:40.129384Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-05-23T14:25:40.129829Z 0 [Note] Plugin 'FEDERED' is disabled.
2020-05-23T14:25:40.185387Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2020-05-23T14:25:40.185421Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2020-05-23T14:25:40.186909Z 0 [Warning] CA certificate ca.pem is self signed.
2020-05-23T14:25:40.187010Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2020-05-23T14:25:40.187204Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2020-05-23T14:25:40.187271Z 0 [Note] IPv6 is available.
2020-05-23T14:25:40.187292Z 0 [Note] - '::' resolves to '::';
2020-05-23T14:25:40.187302Z 0 [Note] Server socket created on IP: '::'.
2020-05-23T14:25:40.200247Z 0 [Note] Failed to start slave threads for channel ''
2020-05-23T14:25:40.209190Z 0 [Note] Event Scheduler: Loaded 0 events
2020-05-23T14:25:40.209467Z 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.7.29-32-log' socket: '/var/lib/mysqld/mysqld.sock' port: 3306 Percona Server (GPL), Release 32, Revision 56bce88
2020-05-23T14:25:48.817802Z 0 [Note] InnoDB: Buffer pool(s) load completed at 200523 17:25:48
2020-05-23T15:58:42.574580Z 3144 [Note] Access denied for user 'root'@'localhost' (using password: NO)
2020-05-23T16:02:55.851978Z 0 [Note] Giving 360 client threads a chance to die
gracefully
Z 0 [Note] Forcefully disconnecting 0 remaining clients
2020-05-23T16:02:57.858494Z 0 [Note] Event Scheduler: Purging the queue. 0 events
2020-05-23T16:02:57.858730Z 0 [Note] Binlog end
2020-05-23T16:02:57.889190Z 0 [Note] Shutting down plugin 'ngram'
2020-05-23T16:02:57.889217Z 0 [ Note] Shutting down plugin 'BLACKHOLE'
2020-05-23T16:02:57.889228Z 0 [Note] Shutting down plugin 'ARCHIVE'
2020-05-23T16:02:57.889233Z 0 [Note] Shutting down plugin 'partition'
2020- 05-23T16:02 :
57.889237Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
Note] Shutting down plugin 'CSV'
2020-05-23T16:02:57.889262Z 0 [Note] Shutting down plugin 'MEMORY'
2020-05-23T16:02:57.889266Z 0 [Note] Shutting down plugin ' INNODB_TABLESPACES_SCRUBBING
'
0 [Note] Shutting down plugin 'INNODB_CHANGED_PAGES'
2020-05-23T16:
02:57.889283Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2020-05-23T16:02:57.889286Z 0 [Note] Shutting down plugin ' INNODB_SYS_TABLESPACES
'
0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2020-05-23T16:02:57.889298Z 0 [Note] Shutting down plugin ' INNODB_SYS_FIELDS
'
0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2020-05-23T16:02:57.889310Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2020-05-23T16:02:57.889325Z
2020-05-23T16:02:57.889329Z 0 [Note] Shutting down plugin ' INNODB_FT_INDEX_TABLE
'
0 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2020-05-23T16:02:57.889341Z 0 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2020-05-23T16:02:57.889344Z 0 [Note] Shutting down plugin ' INNODB_FT_DELETED
'
0 [Note] Shutting down plugin 'INNODB_METRICS'
2020-05-23T16:02:57.889356Z 0 [Note] Shutting down plugin 'INNODB_TEMP_TABLE_INFO'
2020-05-23T16:02:57.889359Z
2020-05-23T16:02:57.889363Z 0 [Note] Shutting down plugin ' INNODB_BUFFER_PAGE_LRU
'
0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2020-05-23T16:02:57.889375Z 0 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2020-05-23T16:02:57.889378Z 0 [Note] Shutting down plugin ' INNODB_CMPMEM_RESET
'
0 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2020-05-23T16:02:57.889390Z 0 [Note] Shutting down plugin 'INNODB_CMP'
2020-05-23T16:02:57.889393Z
2020-05-23T16:02:57.889397Z 0 [Note] Shutting down plugin ' INNODB_LOCKS
'
0 [Note] Shutting down plugin 'XTRADB_ZIP_DICT_COLS'
2020-05-23T16:02:57.889409Z
2020-05-23T16:02:57.889413Z 0 [Note] Shutting down plugin ' XTRADB_RSEG
'
0 [Note] Shutting down plugin 'XTRADB_READ_VIEW'
2020-05-23T16:02:57.889424Z 0 [Note] Shutting down plugin 'InnoDB'
2020-05-23T16:02:58.168839Z 0 [Note] InnoDB: FTS optimize thread exiting .
2020-05-23T16:02:58.169131Z 0 [Note] InnoDB: Starting shutdown
... /ib_buffer_pool
2020-05-23T16:02:58.290300Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 200523 19:02:58
2020-05-23T16:02:59.071597Z 0 [Note] InnoDB:
2020-05-23T16:03:01.023000Z 0 [Note] InnoDB: Shutdown completed; log sequence number 103524038347
2020-05-23T16:03:01.023244Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2020-05-23T16:03:01.023257Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2020 -05-23T16:03:01.023290Z 0 [Note] Shutting down plugin 'sha256_password'
2020-05-23T16:03:01.023293Z 0 [Note] Shutting down plugin 'mysql_native_password'
2020-05-23T16:03:01.023496Z 0 [Note] Shutting down plugin 'binlog'
2020-05-23T16:03:01.039096Z 0 [Note] /usr/sbin/mysqld: Shutdown complete

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Karasik, 2020-05-23
@Max1303

List processes
ps -ef | grep mysqld

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question