1

I am using ec2 aws instance for my wordpress webiste.after every 5 to 10 minute and randomly my website going down i tried lots of things like increasing buffer memory ,memory limit but that not working for me so any one know how do i resolve this issue bellow snpiet is the error log

Mysqld log :- http://pastebin.com/8Gp0V5g3

error log:- http://pastebin.com/cpEHHUwm

160201 14:44:06 [Warning] /usr/libexec/mysql55/mysqld: Forcing close of thread 104  user: 'wordpress2'

160201 14:44:06 [Warning] /usr/libexec/mysql55/mysqld: Forcing close of thread 73  user: 'wordpress2'

160201 14:44:06  InnoDB: Starting shutdown...
160201 14:44:07  InnoDB: Shutdown completed; log sequence number 2756685
160201 14:44:07 [Note] /usr/libexec/mysql55/mysqld: Shutdown complete

160201 14:44:07 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
160201 14:44:08 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
160201 14:44:08 [Note] /usr/libexec/mysql55/mysqld (mysqld 5.5.46) starting as process 14406 ...
160201 14:44:08 [Note] Plugin 'FEDERATED' is disabled.
160201 14:44:08 InnoDB: The InnoDB memory heap is disabled
160201 14:44:08 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160201 14:44:08 InnoDB: Compressed tables use zlib 1.2.8
160201 14:44:08 InnoDB: Using Linux native AIO
160201 14:44:08 InnoDB: Initializing buffer pool, size = 128.0M
160201 14:44:08 InnoDB: Completed initialization of buffer pool
160201 14:44:08 InnoDB: highest supported file format is Barracuda.
160201 14:44:08  InnoDB: Waiting for the background threads to start
160201 14:44:09 InnoDB: 5.5.46 started; log sequence number 2756685
160201 14:44:09 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
160201 14:44:09 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
160201 14:44:09 [Note] Server socket created on IP: '0.0.0.0'.
160201 14:44:09 [Note] Event Scheduler: Loaded 0 events
160201 14:44:09 [Note] /usr/libexec/mysql55/mysqld: ready for connections.
Version: '5.5.46'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL)

show full table wp_options as bellow:-

wp_options

my.cnf file setting in /etc/my.cnf

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mysqld according to the
# instructions in http://fedoraproject.org/wiki/Systemd
#max_connections = 1000
#wait_timeout = 120
#interactive_timeout = 120
#max_allowed_packet = 64M
#innodb_buffer_pool_size = 800M
#innodb_buffer_pool_size = 384M
#max_user_connections = 500
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

error after refreshing the page rapidly. after refreshing

User privileges wordpress user as bellow:- user

Connection's:-

connections

  • 2
    /usr/libexec/mysql55/mysqld: Normal shutdown - sounds like someone or something is stopping/restarting your server (maybe a misconfigured watchdog script keeps thinking it does not respond?). – jkavalik Feb 1 '16 at 19:26
  • 1
    Can you do SHOW FULL COLUMNS FROM wp_options; from the mysql commandline tool (or phpmyadmin)? – Rick James Feb 2 '16 at 1:27
  • @jkavalik ok but how do i trouble shoot for misconfiguration. – Sanjay Nakate Feb 2 '16 at 5:04
  • @RickJames hi have added snap in question from SHOW FULL COLUMNS FROM wp_options; – Sanjay Nakate Feb 2 '16 at 11:25
0
+100

This sound like a (probably) badly written wordpress plugin.

If you have installed some plugins, especially if these are not rated or newest release, try to deactivate it one by one and do a test for each deactivation (if you want first backup the database and httpd wordpress dir, but normally on the deactivation process this is not required)

Also check the "wordpress2" user grants in order to find some restriction like max_user_connections XXX, in order to do this connect as a root to your mysql console than:

select user, host, max_user_connections from mysql.user where `user`= 'wordpress2';
  • did not under stand this :- "Also check the "wordpress2" user grants in order to find some restriction like max_user_connections XXX, in order to do this connect as a root to your mysql console than:" – Sanjay Nakate Feb 4 '16 at 10:27
  • Check the mysql grants/privileges for the user used by your wordpress application to access to database (running the above query) – Cristian Porta Feb 4 '16 at 14:09
  • see i have added out put your query in question. – Sanjay Nakate Feb 4 '16 at 14:18
  • User is ok, have you tried to deactivate your wordpress plugins? – Cristian Porta Feb 4 '16 at 14:59
  • there is issue with multiple plugin's when i deactivate all plugins it works good and i have shifted code on test environment cpanel base server it's also same issue too may connections so now i am on conclusion on that there is some script in plugins which causing too many connection. – Sanjay Nakate Feb 11 '16 at 5:19
0

If that snapshot really says you are doing it, do not mix mysql_* interface calls with mysqli_* calls. That could cause mysterious problems.

Do not use mysql_* at all.

You could try raising max_connections to 400. But that is just a bandaid.

  • but thing is that i couldn't edit the word press core files. – Sanjay Nakate Feb 2 '16 at 14:33
  • max_connections, which defaults to something like 100, controls how many connections are allowed. If you need more than a few hundred, then something is amiss. – Rick James Feb 2 '16 at 14:56
0

I like first to mention something about the warning mysqld: Forcing close of thread 120 user: 'wordpress2' I found the following link hope it help: Mysql Forcing close of thread 946 user

MySQL Too many connections error meaning: If you get a Too many connections error when you try to connect to the mysqld server, this means that all available connections are in use by other clients.

max_connections parameter: system variable. The default value is 151 to improve performance when MySQL is used with the Apache Web server. If you need to support more connections, you should set a larger value for this variable.

Dependencies: the quality of the thread library on a given platform, the amount of RAM available, how much RAM is used for each connection, the workload from each connection, and the desired response time.

Supported simultaneous connections: Linux or Solaris should be able to support at 500 to 1000 simultaneous connections routinely and as many as 10,000 connections if you have many gigabytes of RAM available and the workload from each is low or the response time target undemanding. Windows is limited to (open tables × 2 + open connections) < 2048 due to the Posix compatibility layer used on that platform.

You can increase MySQL 5.5 max connection Linux by following the following example on RHEL: http://blog.endpoint.com/2013/12/increasing-mysql-55-maxconnections-on.html

some useful links and references:

https://www.percona.com/blog/2015/03/06/stopped-mysql-tracing-back-signals-sent-mysql/

https://dev.mysql.com/doc/refman/5.5/en/too-many-connections.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.