Tengo ese mensasje cada 15 0 30 minutos en mi servidor y no puedo detectar cuales seria la consulta que se genera que hace que se de ese percance o la cantidad de MaxClient
a utilizar para no estar reiniciando el servidor.
He revisado y tenemos picos pero no se si es alguna consulta que genera. Normalmente se mantiene en 207 usuarios, pero no se si existe algun otro problema. La base de datos no tiene indices, no es relacional y el codigo es creado en php y codechart.
Version de apache Server version: Apache/2.4.7 (Ubuntu)
MySQL Server version: 5.5.62-0ubuntu0.14.04.1-log (Ubuntu).
El PHP es la version PHP 5.5.9-1ubuntu4.29 (cli) (built: Apr 22 2019 18:33:52)
Configuración de apache:
<IfModule mpm_prefork_module>
StartServers 15
MinSpareServers 15
MaxSpareServers 20
MaxRequestWorkers 340
MaxClients 290
MaxConnectionsPerChild 3600
</IfModule>
KeepAlive de apache:
/etc/apache2/apache2.conf:KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
Configuración de mysql
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
default-character-set=utf8
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
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
skip-innodb
skip-name-resolve
default-storage-engine=MyISAM
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8
#bind-address = 127.0.0.1
key_buffer = 2G
max_allowed_packet = 256M
thread_stack = 192K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
max_connections = 180
#table_definition_cache = 600
table_open_cache = 400
table_cache = 800
sort_buffer_size = 6M
join_buffer_size = 120M
tmp_table_size = 60M
max_heap_table_size = 60M
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_type = 1
query_cache_limit = 2M
query_cache_min_res_unit = 2K
query_cache_size = 90M
#
# * 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
#
# Error log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# Here you can see queries with especially long duration
#log_slow_queries = /var/log/mysql/mysql-slow.log
#long_query_time = 1
#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 = 1
max_binlog_size = 10M
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
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
[isamchk]
key_buffer = 16M
Ejecución de mysqltuner:
>> MySQLTuner 1.8.5 - Major Hayden <[email protected]>
>> Bug reports, feature requests, and downloads at http://mysqltuner.pl/
>> Run with '--help' for additional options and output filtering
[--] Skipped version check for MySQLTuner script
[OK] Logged in using credentials from Debian maintenance account.
[!!] Your MySQL version 5.5.62-0ubuntu0.14.04.1-log is EOL software! Upgrade soon!
[OK] Operating on 64-bit architecture
-------- Log file Recommendations ------------------------------------------------------------------
[OK] Log file /var/log/mysql/error.log exists
[--] Log file: /var/log/mysql/error.log(26K)
[OK] Log file /var/log/mysql/error.log is not empty
[OK] Log file /var/log/mysql/error.log is smaller than 32 Mb
[OK] Log file /var/log/mysql/error.log is readable.
[!!] /var/log/mysql/error.log contains 249 warning(s).
[OK] /var/log/mysql/error.log doesn't contain any error.
[--] 5 start(s) detected in /var/log/mysql/error.log
[--] 1) 220302 10:58:56 [Note] /usr/sbin/mysqld: ready for connections.
[--] 2) 220302 10:49:15 [Note] /usr/sbin/mysqld: ready for connections.
[--] 3) 220302 10:27:51 [Note] /usr/sbin/mysqld: ready for connections.
[--] 4) 220302 8:45:22 [Note] /usr/sbin/mysqld: ready for connections.
[--] 5) 220302 8:42:47 [Note] /usr/sbin/mysqld: ready for connections.
[--] 5 shutdown(s) detected in /var/log/mysql/error.log
[--] 1) 220302 10:58:56 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 2) 220302 10:49:15 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 3) 220302 10:27:51 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 4) 220302 8:45:21 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 5) 220302 8:42:47 [Note] /usr/sbin/mysqld: Shutdown complete
-------- Storage Engine Statistics -----------------------------------------------------------------
[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED -InnoDB +MEMORY +MRG_MYISAM +MyISAM +PERFORMANCE_SCHEMA
[--] Data in MyISAM tables: 5.1G (Tables: 479)
[OK] Total fragmented tables: 0
-------- Analysis Performance Metrics --------------------------------------------------------------
[OK] No stat updates during querying INFORMATION_SCHEMA.
-------- Security Recommendations ------------------------------------------------------------------
[OK] There are no anonymous accounts for any database users
[OK] All database users have passwords assigned
[!!] There is no basic password file list!
-------- CVE Security Recommendations --------------------------------------------------------------
[--] Skipped due to --cvefile option undefined
-------- Performance Metrics -----------------------------------------------------------------------
[--] Up for: 2h 51m 41s (856K q [83.180 qps], 67K conn, TX: 282M, RX: 107M)
[--] Reads / Writes: 87% / 13%
[--] Binary logging is enabled (GTID MODE: OFF)
[--] Physical Memory : 93.9G
[--] Max MySQL memory : 69.4G
[--] Other process memory: 0B
[--] Total buffers: 2.1G global + 382.6M per thread (180 max threads)
[--] P_S Max memory usage: 0B
[--] Galera GCache Max memory usage: 0B
[OK] Maximum reached memory usage: 20.1G (21.39% of installed RAM)
[OK] Maximum possible memory usage: 69.4G (73.93% of installed RAM)
[OK] Overall possible memory usage with other process is compatible with memory available
[OK] Slow queries: 0% (65/856K)
[OK] Highest usage of available connections: 26% (48/180)
[OK] Aborted connections: 0.00% (0/67252)
[!!] Query cache may be disabled by default due to mutex contention.
[OK] Query cache efficiency: 39.0% (165K cached / 424K selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (27 temp sorts / 23K sorts)
[!!] Joins performed without indexes: 16690
[!!] Temporary tables created on disk: 27% (7K on disk / 28K total)
[OK] Thread cache hit rate: 99% (446 created / 67K connections)
[OK] Table cache hit rate: 98% (757 hits / 765 requests)
[!!] table_definition_cache(400) is lower than number of tables(563)
[OK] Open file limit used: 69% (1K/1K)
[OK] Table locks acquired immediately: 99% (459K immediate / 461K locks)
[OK] Binlog cache memory access: 0% (0 Memory / 0 Total)
-------- Performance schema ------------------------------------------------------------------------
[--] Performance schema is disabled.
[--] Memory used by P_S: 0B
[--] Sys schema isn't installed.
-------- ThreadPool Metrics ------------------------------------------------------------------------
[--] ThreadPool stat is disabled.
-------- MyISAM Metrics ----------------------------------------------------------------------------
[!!] Key buffer used: 27.2% (556.7M used / 2.0G cache)
[OK] Key buffer size / total MyISAM indexes: 2.0G/1.9G
[OK] Read Key buffer hit rate: 100.0% (3B cached / 186K reads)
[!!] Write Key buffer hit rate: 23.8% (265K cached / 63K writes)
-------- InnoDB Metrics ----------------------------------------------------------------------------
[--] InnoDB is disabled.
[--] InnoDB Storage engine is disabled. MyISAM is the default storage engine
-------- Aria Metrics ------------------------------------------------------------------------------
[--] Aria Storage Engine not available.
-------- TokuDB Metrics ----------------------------------------------------------------------------
[--] TokuDB is disabled.
-------- XtraDB Metrics ----------------------------------------------------------------------------
[--] XtraDB is disabled.
-------- Galera Metrics ----------------------------------------------------------------------------
[--] Galera is disabled.
-------- Replication Metrics -----------------------------------------------------------------------
[--] Galera Synchronous replication: NO
[--] No replication slave(s) for this server.
[--] Binlog format: STATEMENT
[--] XA support enabled: ON
[--] Semi synchronous replication Master: Not Activated
[--] Semi synchronous replication Slave: Not Activated
[--] This is a standalone server
-------- Recommendations ---------------------------------------------------------------------------
General recommendations:
MySQL was started within the last 24 hours - recommendations may be inaccurate
Enable the slow query log to troubleshoot bad queries
We will suggest raising the 'join_buffer_size' until JOINs not using indexes are found.
See https://dev.mysql.com/doc/internals/en/join-buffer-size.html
(specially the conclusions at the bottom of the page).
When making adjustments, make tmp_table_size/max_heap_table_size equal
Reduce your SELECT DISTINCT queries which have no LIMIT clause
Variables to adjust:
query_cache_size (=0)
query_cache_type (=0)
join_buffer_size (> 120.0M, or always use indexes with JOINs)
tmp_table_size (> 60M)
max_heap_table_size (> 60M)
table_definition_cache(400) > 563 or -1 (autosizing if supported)
Solo es un dominio con varias ips que se tienen en el servidor. Es sistema transaccional de datos de ptes.
Solo tiene php puro, codechart Javascript.
Memoria ¿La CPU como la tienes en ese servidor? Está siempre alta? normal? baja? Esta por lo general 1.3 pero cuando se generan reportes entonces se eleva y pasa lo del mysql_query. Muchas gracias
¿de cuanta memoria dispone el servidor?
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
MySQL was started within the last 24 hours - recommendations may be inaccurate
Reduce your overall MySQL memory footprint for system stability
Enable the slow query log to troubleshoot bad queries
We will suggest raising the 'join_buffer_size' until JOINs not using indexes are found.
See https://dev.mysql.com/doc/internals/en/join-buffer-size.html
(specially the conclusions at the bottom of the page).
Increase table_open_cache gradually to avoid file descriptor limits
Read this before increasing table_open_cache over 64: https://bit.ly/2Fulv7r
Read this before increasing for MariaDB https://mariadb.com/kb/en/library/optimizing-table_open_cache/
This is MyISAM only table_cache scalability problem, InnoDB not affected.
See more details here: https://bugs.mysql.com/bug.php?id=49177
This bug already fixed in MySQL 5.7.9 and newer MySQL versions.
Beware that open_files_limit (1024) variable
should be greater than table_open_cache (64)
Variables to adjust:
*** MySQL's maximum memory usage is dangerously high ***
*** Add RAM before increasing MySQL buffer variables ***
query_cache_size (=0)
query_cache_type (=0)
join_buffer_size (> 100.0M, or always use indexes with JOINs)
table_open_cache (> 64)
table_definition_cache(400) > 563 or -1 (autosizing if supported)
existen unas variables que no comprendo bien
mysql> show status like "%conn%";
+--------------------------+-------+
| Variable_name | Value |
+--------------------------+-------+
| Aborted_connects | 0 |
| Connections | 50031 |
| Max_used_connections | 123 |
| Ssl_client_connects | 0 |
| Ssl_connect_renegotiates | 0 |
| Ssl_finished_connects | 0 |
| Threads_connected | 43 |
+--------------------------+-------+
las de connections porque yo tengo registrado 180 como maximo y e ese lugar me aparece esa cantidad.
Muchas gracias