|
MySQL грузит процессор на ubuntu server
|
|||
---|---|---|---|
#18+
Здравствуйте, уважаемые форумчане! Я новичок в MySQL. Есть сервер на ubuntu server 16.04.7 LTS и на нем MySQL версии mysql Ver 14.14 Distrib 5.7.33, for Linux (x86_64) using EditLine wrapper. На сервере 2 сайты. Железо 8 -поточный xeon v3, 8gb ddr3, 256 ssd. На сервере 2 сайты с бэк-эндом на PHP Laravel. Процесс MySQL в htop дает avarage load 30+% на систему. Пробовал конфигурить его по разному, удалось немного сбить нагрузку. Когда нагрузка на сайт более 600 подключений получаю сильные тормоза и иногда ошибку 502. Можете подсказать в каком направлении мне копать чтобы сделать всё по-человечески и без особых затрат времени? MySQL config: # Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # The MySQL Server configuration file. # # For explanations see # http://dev.mysql.com/doc/mysql/en/server-system-variables.html [mysqld] # # * Basic Settings # user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3306 basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp lc-messages-dir = /usr/share/mysql skip-external-locking sql_mode = '' # # Instead of skip-networking the default is now to listen only on # localhost which is more compatible and is not less secure. # # * Fine Tuning # key_buffer_size = 64M max_allowed_packet = 32M thread_stack = 192K thread_cache_size = 128 # This replaces the startup script and checks MyISAM tables if needed # the first time they are touched #myisam-recover = BACKUP max_connections = 1000 #table_cache = 64 pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3306 basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp lc-messages-dir = /usr/share/mysql skip-external-locking sql_mode = '' # # Instead of skip-networking the default is now to listen only on # localhost which is more compatible and is not less secure. # # * Fine Tuning # key_buffer_size = 64M max_allowed_packet = 32M thread_stack = 192K thread_cache_size = 128 # This replaces the startup script and checks MyISAM tables if needed # the first time they are touched #myisam-recover = BACKUP max_connections = 1000 #table_cache = 64 #thread_concurrency = 10 # # * Query Cache Configuration # query_cache_limit = 0M query_cache_size = 0M # # * Logging and Replication # # Both location gets rotated by the cronjob. # Be aware that this log type is a performance killer. # As of 5.1 you can enable the log at runtime! #general_log_file = /var/log/mysql/mysql.log #general_log = 1 log-bin-trust-function-creators = 1 # # Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf. # # Here you can see queries with especially long duration #log_slow_queries = /var/log/mysql/mysql-slow.log #long_query_time = 2 #log-queries-not-using-indexes # # The following can be used as easy to replay backup logs or for replication. # note: if you are setting up a replication slave, see README.Debian about # other settings you may need to change. # # * Query Cache Configuration # query_cache_limit = 0M query_cache_size = 0M # # * Logging and Replication # # Both location gets rotated by the cronjob. # Be aware that this log type is a performance killer. # As of 5.1 you can enable the log at runtime! #general_log_file = /var/log/mysql/mysql.log #general_log = 1 log-bin-trust-function-creators = 1 # # Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf. # # Here you can see queries with especially long duration #log_slow_queries = /var/log/mysql/mysql-slow.log #long_query_time = 2 #log-queries-not-using-indexes # # The following can be used as easy to replay backup logs or for replication. # note: if you are setting up a replication slave, see README.Debian about # other settings you may need to change. #server-id = 1 #log_bin = /var/log/mysql/mysql-bin.log expire_logs_days = 10 max_binlog_size = 100M #binlog_do_db = include_database_name #binlog_ignore_db = include_database_name # # * InnoDB # # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. # Read the manual for more InnoDB related options. There are many! # # * Security Features # # Read the manual, too, if you want chroot! # chroot = /var/lib/mysql/ # # For generating SSL certificates I recommend the OpenSSL GUI "tinyca". # # ssl-ca=/etc/mysql/cacert.pem # ssl-cert=/etc/mysql/server-cert.pem # ssl-key=/etc/mysql/server-key.pem innodb_flush_log_at_trx_commit=2 character-set-server = utf8 ... |
|||
:
Нравится:
Не нравится:
|
|||
23.04.2021, 18:51 |
|
|
start [/forum/topic.php?fid=47&fpage=9&tid=1828100]: |
0ms |
get settings: |
11ms |
get forum list: |
14ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
67ms |
get topic data: |
13ms |
get forum data: |
3ms |
get page messages: |
29ms |
get tp. blocked users: |
2ms |
others: | 235ms |
total: | 382ms |
0 / 0 |