Всем добра! Очень сильно надоедает ошибка. Гуглил, сам боролся - не решил. Подскажите пожалуйста, что еще можно сделать!? Больше информации нет.
говорит что сервер БД не отвечает ... скорее всего ограничения на одновременные соединения или еще что в таком роде ... чес говоря удивлен что в популярном движке используется mysqli_real_connect .... чего им простого коннекта недостаточно
Ну да. Стоит на VPS, где 1Гб ОЗУ, типо мало. Вопрос: как бороться? Кроме как ОЗУ добавить. Дело в том, что на обычном виртуальном хостинге работает, летает. И не такие нагрузки выдерживало.
Перечитал тысячи таких. По их данным падает еще чаще сервер. + у меня не вордПресс + у меня не 512 Мб ОЗУ Мой конфиг: Спойлер: my.cnf Код (Text): # For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html [mysqld] collation-server = utf8_general_ci character-set-server = utf8 local-infile=0 innodb_file_per_table = 1 pid-file = /var/lib/mysqld/mysqld.pid # # Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. # innodb_buffer_pool_size = 128M # # Remove leading # to turn on a very important data integrity option: logging # changes to the binary log between backups. # log_bin # # Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. # join_buffer_size = 128M # sort_buffer_size = 2M # read_rnd_buffer_size = 2M datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 log-error=/var/log/mysqld.log bind-address = :: max-connections = 50 max-user-connections = 100 max-connect-errors = 1000 max-allowed-packet = 128M innodb-buffer-pool-size = 64M innodb-flush-log-at-trx-commit = 0 innodb-flush-method = O_DIRECT transaction-isolation = READ-COMMITTED innodb-buffer-pool-instances = 1 innodb-file-per-table = 1 max-heap-table-size = 16M tmp-table-size = 16M table-definition-cache = 4096 table-open-cache = 4096 query-cache-size = 64M query-cache-limit = 1M thread-cache-size = 32 key-buffer-size = 64M optimizer-search-depth = 8 join-buffer-size = 1M pid-file=/var/run/mysqld/mysqld.pid [mysqld] sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION Как видно выкручено на максимум.
@webog что то ты не то крутишь почему у тебя - вместо _ https://matomo.org/faq/troubleshooting/faq_183/
Ну смотри логи что именно провоцирует падение tail -f /var/log/mysqld.log если верить конфигу. Это происходит всегда или при выполнении определенного скрипта? wait_timeout innodb_log_file_size установи --- Добавлено --- Кстати.. вот можно прикрутить отлавливать ошибки https://sentry.io или по логам php и сервера
Выдало: Спойлер Код (Text): 2019-01-11T17:12:38.083307Z 54642 [Note] Access denied for user 'root'@'localhos t' (using password: YES) 2019-01-11T17:12:38.568428Z 54644 [Note] Access denied for user 'root'@'localhos t' (using password: YES) 2019-01-11T18:01:08.921095Z 55975 [Warning] IP address '196.52.43.105' could not be resolved: Name or service not known 2019-01-11T18:59:12.808469Z 57611 [Warning] IP address '117.40.196.91' could not be resolved: Name or service not known 2019-01-11T19:05:00.659919Z 57790 [Warning] IP address '219.150.218.37' could no t be resolved: Name or service not known 2019-01-12T04:56:20.063093Z 72400 [Warning] IP address '164.52.24.170' could not be resolved: Name or service not known 2019-01-12T04:56:26.033863Z 72402 [Warning] IP address '164.52.24.170' could not be resolved: Name or service not known 2019-01-12T06:31:02.682996Z 74690 [Note] Aborted connection 74690 to db: 'admin_ urlshotik' user: 'admin_urlshotik' host: 'localhost' (Got an error reading commu nication packets) 2019-01-12T09:14:30.819251Z 80153 [Warning] Host name 'host112-169-213-188.serve rdedicati.aruba.it' could not be resolved: Name or service not known 2019-01-12T09:54:07.044285Z 81420 [Warning] IP address '39.109.123.31' could not be resolved: Name or service not known
те ошибки что есть устраняются skip_name_resolve а почему падает наверное где то выше а может вообще нету. yum install mc && mcedit /var/log/mysqld.log это так что б с vim не связываться) Переменные все установи по последней ссылки особенно wait
Код (Text): mysql -u USER -p show variables like "wait_timeout"; show variables like "interactive_timeout"; quit; ?
Тут не понятно. Скачал лог с сервера, 13Мб (за последние три дня). Вот что попало на глаза: Код (Text): Line 123749: 2019-01-09T16:01:18.748497Z 0 [Warning] Changed limits: max_open_files: 5000 (requested 8252) И сделал поиск именно Warning по логу: Спойлер Код (Text): Line 123649: 2019-01-09T08:39:14.498774Z 20802 [Warning] IP address '89.248.162.177' could not be resolved: Name or service not known Line 123650: 2019-01-09T10:32:26.998498Z 0 [Warning] Changed limits: max_open_files: 5000 (requested 8252) Line 123651: 2019-01-09T10:32:26.998761Z 0 [Warning] Changed limits: table_open_cache: 2470 (requested 4096) Line 123652: 2019-01-09T10:32:27.235457Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). Line 123681: 2019-01-09T10:32:27.724501Z 0 [Warning] CA certificate ca.pem is self signed. Line 123689: 2019-01-09T11:33:56.000665Z 1679 [Warning] IP address '85.93.20.38' could not be resolved: Name or service not known Line 123690: 2019-01-09T12:56:48.095461Z 3830 [Warning] IP address '27.124.17.108' could not be resolved: Name or service not known Line 123694: 2019-01-09T16:01:15.471118Z 0 [Warning] /usr/sbin/mysqld: Forcing close of thread 8679 user: 'root' Line 123749: 2019-01-09T16:01:18.748497Z 0 [Warning] Changed limits: max_open_files: 5000 (requested 8252) Line 123750: 2019-01-09T16:01:18.748782Z 0 [Warning] Changed limits: table_open_cache: 2470 (requested 4096) Line 123751: 2019-01-09T16:01:19.001794Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). Line 123775: 2019-01-09T16:01:19.240377Z 0 [Warning] CA certificate ca.pem is self signed. Line 123783: 2019-01-09T16:08:07.259027Z 229 [Warning] IP address '85.93.20.38' could not be resolved: Name or service not known Line 124336: 2019-01-09T17:49:55.008948Z 3483 [Warning] IP address '196.52.43.59' could not be resolved: Name or service not known Line 124889: 2019-01-10T04:38:28.937423Z 0 [Warning] Changed limits: max_open_files: 5000 (requested 8252) Line 124890: 2019-01-10T04:38:28.937718Z 0 [Warning] Changed limits: table_open_cache: 2470 (requested 4096) Line 124891: 2019-01-10T04:38:29.136727Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). Line 124920: 2019-01-10T04:38:29.731304Z 0 [Warning] CA certificate ca.pem is self signed. Line 124928: 2019-01-10T08:44:41.253602Z 6117 [Warning] IP address '85.93.20.38' could not be resolved: Name or service not known Line 124929: 2019-01-10T10:21:10.503090Z 8326 [Warning] IP address '211.218.126.142' could not be resolved: Name or service not known Line 124930: 2019-01-10T10:37:28.467816Z 8802 [Warning] IP address '89.35.39.148' could not be resolved: Name or service not known Line 124931: 2019-01-10T14:00:17.231345Z 14073 [Warning] IP address '81.17.29.154' could not be resolved: Name or service not known Line 124932: 2019-01-10T20:36:40.521530Z 23677 [Warning] Hostname 'zg-1210g-20.stretchoid.com' does not resolve to '104.131.133.158'. Line 124939: 2019-01-11T07:10:50.887384Z 37646 [Warning] IP address '88.214.26.17' could not be resolved: Name or service not known Line 124940: 2019-01-11T07:10:51.066544Z 37647 [Warning] IP address '88.214.26.18' could not be resolved: Name or service not known Line 124941: 2019-01-11T07:10:51.252881Z 37648 [Warning] IP address '88.214.26.19' could not be resolved: Name or service not known Line 124942: 2019-01-11T07:10:51.430906Z 37649 [Warning] IP address '88.214.26.20' could not be resolved: Name or service not known Line 124943: 2019-01-11T07:10:51.615054Z 37650 [Warning] IP address '88.214.26.39' could not be resolved: Name or service not known Line 124944: 2019-01-11T07:10:51.792684Z 37651 [Warning] IP address '88.214.26.40' could not be resolved: Name or service not known Line 124946: 2019-01-11T10:51:25.105455Z 43015 [Warning] IP address '194.147.32.50' could not be resolved: Name or service not known Line 124947: 2019-01-11T12:04:11.626662Z 44847 [Warning] IP address '185.255.31.2' could not be resolved: Name or service not known Line 125500: 2019-01-11T18:01:08.921095Z 55975 [Warning] IP address '196.52.43.105' could not be resolved: Name or service not known Line 125501: 2019-01-11T18:59:12.808469Z 57611 [Warning] IP address '117.40.196.91' could not be resolved: Name or service not known Line 125502: 2019-01-11T19:05:00.659919Z 57790 [Warning] IP address '219.150.218.37' could not be resolved: Name or service not known Line 125503: 2019-01-12T04:56:20.063093Z 72400 [Warning] IP address '164.52.24.170' could not be resolved: Name or service not known Line 125504: 2019-01-12T04:56:26.033863Z 72402 [Warning] IP address '164.52.24.170' could not be resolved: Name or service not known Line 125506: 2019-01-12T09:14:30.819251Z 80153 [Warning] Host name 'host112-169-213-188.serverdedicati.aruba.it' could not be resolved: Name or service not known Line 125507: 2019-01-12T09:54:07.044285Z 81420 [Warning] IP address '39.109.123.31' could not be resolved: Name or service not known
Спойлер Код (Text): mysql> show variables like "wait_timeout"; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | wait_timeout | 28800 | +---------------+-------+ 1 row in set (0.00 sec) mysql> show variables like "interactive_timeout"; +---------------------+-------+ | Variable_name | Value | +---------------------+-------+ | interactive_timeout | 28800 | +---------------------+-------+ 1 row in set (0.01 sec) mysql> quit; Bye --- Добавлено --- Парни, я не особо в теме Только учусь! --- Добавлено --- Я б тоже, видимо. Как?
Попробуй тогда лимит повысить. open_files_limit https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_open_files_limit Правда есть шанс словить ограничение от ОС. У тебя там что стоит на хосте? --- Добавлено --- @nospiou 28800 для пыха более чем достаточно, он столько не живет )
max_open_files: 5000 https://p0vidl0.info/kak-uvelichit-limit-otkrytyx-fajlov-i-processov-v-centos-rhel.html Лимит задается как в конфиге mysql, так и на уровне ОС, поставь и там и там 10000 и посмотри что будет.
Уверен? Это же меньше 1 Мб и меньше чем по умолчанию. Сделал пока по инструкции по ссылке, но не было файла /etc/security/limits.d/90-nproc.conf создал. Был 20-nproc.conf ulimit -u показал 3787 ulimit -a: Спойлер Код (Text): core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 3787 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 3787 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited
bind-address = 127.0.0.1 или фаервол А по сабжу нужно искать скрипт который вызывает ошибку возможно ему действительно нужно намного больше всего. --- Добавлено --- Если там большой цикл и нужно длинное соединение есть https://php.ru/manual/mysqli.ping.html
Так а как? Движок vBulletin, неужели криворукие писали его? Я пытался сделать подключение к базе типо Singleton'а, но что-то разницы нет.
Ну ты же как то увидел эту ошибку. Вот на форуме пишет что прям в отчетах на емейл прилетает при резервном копировании где нужно намного больше твоих установленных 28 секунд https://www.vbulletin.org/forum/showthread.php?t=300317 --- Добавлено --- А где ты видел не криворуких пихапишников? --- Добавлено --- Наверное еще и старая версия движка? --- Добавлено --- Оказывается 28800 это секунд 8 часов возможно ты сам закрываешь соединение в скрипте при определенных условиях какой то корявый плагин это делает. Ну или еще больше увеличь размер пакета хотя куда уж больше. Кто его знает. Искать причину и смотреть логи. Вообще при ошибке сервер должен отдавать 500 страницу как минимум можно посмотреть при каком запросе. Нужно больше инфы
Думаешь в этом проблема? vBulletin 3.8.7 Patch Level 2 Прошуршал по файлам, нет закрытия. Ну на почту падает мне + дублирование в логи сделал errorlogdatabase.log Ошибка с почты в шапке. Хз где еще и что искать...