0

I'm running a vps (Ubuntu 14.04+NGINX+Mysql) with 8GB memory with a couple of wordpress sites.

Since several days ago the Mariadb-bin log is growing at 150 MB per hour rate. I discovered it because my server run out of space and the database crashed.

I deleted the logs and everything is OK now except by the fact that the MySQL log is still growing at the same rate and I have 1000s of mysql connections and the websites have almost no visitors. As a consequence my server is running out of memory and load average is 3.

Mytop shows this:

Queries: 1.3k     qps:    0 Slow:     0.0         Se/In/Up/De(%):    23510/00/00/00
 Sorts:     0 qps now:    1 Slow qps: 0.0  Threads:    6 (   1/   6) 3775/00/00/00
 Key Efficiency: 99.3%  Bps in/out:   0.6/106.0   Now in/out:  21.3/ 3.6k

       Id      User         Host/IP         DB       Time    Cmd    State Query
       --      ----         -------         --       ----    ---    ----- ----------
     7671      root       localhost                   169  Sleep
     7963 accionrh_       localhost accionrh_c          1  Sleep
     7417      root       localhost                     0  Query     init show full processlist
     7942 emotionyo       localhost emotionyou          0  Sleep
     7947 accionrh_       localhost accionrh_c          0  Sleep
     7964 emotionyo       localhost emotionyou          0  Sleep

MariaDB [(none)]> show status like '%onn%';
+-----------------------------------------------+-------+
| Variable_name                                 | Value |
+-----------------------------------------------+-------+
| Aborted_connects                              | 0     |
| Connection_errors_accept                      | 0     |
| Connection_errors_internal                    | 0     |
| Connection_errors_max_connections             | 0     |
| Connection_errors_peer_address                | 0     |
| Connection_errors_select                      | 0     |
| Connection_errors_tcpwrap                     | 0     |
| Connections                                   | 8258  |
| Max_used_connections                          | 12    |
| Performance_schema_session_connect_attrs_lost | 0     |
| Slave_connections                             | 0     |
| Slaves_connected                              | 0     |
| Ssl_client_connects                           | 0     |
| Ssl_connect_renegotiates                      | 0     |
| Ssl_finished_connects                         | 0     |
| Threads_connected                             | 7     |
| wsrep_connected                               | OFF   |
+-----------------------------------------------+-------+


MariaDB [(none)]> show processlist;
+------+----------------+-----------+----------------+---------+------+-------+------------------+----------+
| Id   | User           | Host      | db             | Command | Time | State | Info             | Progress |
+------+----------------+-----------+----------------+---------+------+-------+------------------+----------+
| 7417 | root           | localhost | NULL           | Sleep   |   77 |       | NULL             |    0.000 |
| 7671 | root           | localhost | NULL           | Query   |    0 | init  | show processlist |    0.000 |
| 7967 | accionrh_com   | localhost | accionrh_com   | Sleep   |    0 |       | NULL             |    0.000 |
| 7995 | accionrh_com   | localhost | accionrh_com   | Sleep   |    1 |       | NULL             |    0.000 |
| 7997 | emotionyou_com | localhost | emotionyou_com | Sleep   |    0 |       | NULL             |    0.000 |
+------+----------------+-----------+----------------+---------+------+-------+------------------+----------+

I restarted Mysql without results. I have added an image below for top:

enter image description here

Output of ps -ef | awk '$4>0:

UID        PID  PPID  C STIME TTY          TIME CMD
mysql     4311  4102  4 13:11 ?        00:00:19 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --skip-log-error --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306
www-data  4559 21155 28 13:17 ?        00:00:35 php-fpm: pool www
www-data  4576 21155 33 13:17 ?        00:00:22 php-fpm: pool www
www-data  4582 21155 37 13:18 ?        00:00:23 php-fpm: pool www
www-data  4591 21155 17 13:18 ?        00:00:06 php-fpm: pool www
www-data  4593 21155 10 13:18 ?        00:00:03 php-fpm: pool www
www-data  4610 21155  7 13:18 ?        00:00:01 php-fpm: pool www
www-data  4615 21155 22 13:18 ?        00:00:02 php-fpm: pool www
redis    18970     1  1 Mar08 ?        00:24:15 /usr/bin/redis-server 127.0.0.1:6379
  • Is the database engine exposed to the Internet? – Max Vernon Mar 9 '18 at 15:24
  • Do you have any swap space? Do you have replication set up? If it happens again, use mysqlbinlog to see what is flooding the binlog. – Rick James Mar 11 '18 at 15:57

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.