Mysql-crashing

Hello,

I read the following post before post here:

and here is EE info and related setting upon the instruction in the above post:

#ee -v EasyEngine v3.7.4

ee info

NGINX (1.10.0):

user www-data worker_processes auto worker_connections 4096 keepalive_timeout 30 fastcgi_read_timeout 300 client_max_body_size 100m allow 127.0.0.1

PHP (5.6.33-0):

user
expose_php Off memory_limit 256M post_max_size 300M upload_max_filesize 300M max_execution_time 300

Information about www.conf ping.path /ping pm.status_path /status process_manager ondemand pm.max_requests 500 pm.max_children 100 pm.start_servers 20 pm.min_spare_servers 10 pm.max_spare_servers 30 request_terminate_timeout 300 xdebug.profiler_enable_trigger off listen 127.0.0.1:9000

Information about debug.conf ping.path /ping pm.status_path /status process_manager ondemand pm.max_requests 500 pm.max_children 100 pm.start_servers 20 pm.min_spare_servers 10 pm.max_spare_servers 30 request_terminate_timeout 300 xdebug.profiler_enable_trigger on listen 127.0.0.1:9001

MySQL (10.1.32-MariaDB) on localhost:

port 3306 wait_timeout 600 interactive_timeout 28800 max_used_connections 69 datadir /var/lib/mysql/ socket /var/run/mysqld/mysqld.sock my.cnf [PATH] /etc/mysql/conf.d/my.cnf


Any suggestions for optimization setting to avoid mysql crashing wold be appreciated.

Thanks.

How much traffic you are getting and what type of caching you are using

@vibhi thanks

Redis is working on it.

as to the traffic, there is no user on it, and it is not production yet, and the mysql will crash when I just test the site on some speed test site like www.17ce.com.

every click on my site, there will error occur, like:

2018/05/13 13:49:43 [error] 10958#10958: *18123 FastCGI sent in stderr: “PHP message: WordPress database error Table ‘mysite_com.plpkj_defender_lockout’ doesn’t exist for query SELECT id, ip, status, lockout_message, release_time, lock_time, lock_time_404, attempt, attempt_404, meta FROM plpkj_defender_lockout WHERE ip = ‘95.216.10.80’ LIMIT 0,1 made by require(‘wp-blog-header.php’), require_once(‘wp-load.php’), require_once(’/var/www/mysite.com/wp-config.php’), require_once(‘wp-settings.php’), do_action(‘init’), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, WD_Main_Activator->init, WP_Defender\Module\IP_Lockout->__construct, WP_Defender\Module\IP_Lockout\Controller\Main->__construct, WP_Defender\Module\IP_Lockout\Controller\Main->maybeLockouts, Hammer\Base\DB_Model::findOne” while reading response header from upstream, client: 95.216.10.80, server: shop.mysite.com, request: “GET /product/549/add_to_wishlist=167&add-to-cart=1110 HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “shop.mysite.com

Any suggestion please?

Thanks …

Mysql isnt crash I think you make some mis configuration or you are using some plugin which creating this type of issue Look like It defender from wpmudev

@vibhi Well, that is not MySQL crash log, and I’m just tracking the configuration, since it seems a quite old issue in HHVM according to several posts, speciallly this one:

Any suggestions?

HHVM doesnt work well with alot of plugin and theme maybe thats creating a issue

@vibhi Oh, I know that, but never thought it is so serious.

Seems that I have to migrate it to a only php7+nginx+EE, what you think?

@vibhi

This is a quite type error, what might be the reason please?

2018/05/14 16:44:37 [error] 697#697: *22602 connect() failed (111: Connection refused) while connecting to upstream, client: 61.49.240.134, server: mysite.com, request: “POST /wp-admin/admin-ajax.php HTTP/2.0”, upstream: “fastcgi://127.0.0.1:8000”, host: “mysite.com”, referrer: “https://mysite.com/wp-admin/network/plugins.php

From my experience this is a plugin issue.

Have you tried creating a test site with a plain WP install and test that on the same server? That way you can rule out if its any plugins?

@madbradjohnson @vibhi

Great, and I just created a fresh subsite, please check the screenshot, there is no any plugin activated:

but the issue is same:

2018/05/14 19:29:10 [error] 698#698: *25699 connect() failed (111: Connection refused) while connecting to upstream, client: 111.194.79.163, server: mysite.com, request: “POST /wp-admin/network/plugins.php?plugin_status=active HTTP/1.1”, upstream: “fastcgi://127.0.0.1:8000”, host: “mysite.com”, referrer: “https://mysite.com/wp-admin/network/plugins.php?plugin_status=active

2018/05/14 19:29:22 [error] 698#698: *25708 connect() failed (111: Connection refused) while connecting to upstream, client: 111.194.79.163, server: mysite.com, request: “GET /wp-admin/plugins.php?plugin_status=all HTTP/1.1”, upstream: “fastcgi://127.0.0.1:8000”, host: “force.mysite.com”, referrer: “https://force.mysite.com/wp-admin/plugins.php?plugin_status=active

2018/05/14 19:29:34 [error] 698#698: *25713 connect() failed (111: Connection refused) while connecting to upstream, client: 111.194.79.163, server: mysite.com, request: “GET /2018/05/10/test/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:8000”, host: “force.mysite.com

2018/05/14 19:30:04 [error] 697#697: *25731 connect() failed (111: Connection refused) while connecting to upstream, client: 111.194.79.163, server: mysite.com, request: “GET /2018/05/10/test/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:8000”, host: “force.mysite.com

Geez… Okay. Your mariadb instance, does it run on the same server as your website?

Can you get into mariadb and access the databases?

Have your tried a password reset and reload mariadb.

Also, something seems fishy with the fast CGI port.

What command did you use to create your test site?

Hi @madbradjohnson,

site was created by EE with HHVM.

Yes, I did reload and even reinstalled mysql, and here is screenshot of server info:

Here is PHP fast CGI related:

or please check the attached full PHP info:

sorry, this community system seems does not support insert image.

Try create a PHP7 site and see if the issues are the same?

At this point in time, I am trying to help you figure out what the problem is by means of deduction.

For me, i f i understand correctly, you want to use HHVM which would fall back to PHP. (5) wit FCGI in this case. Perhaps, if you run the PHP7 installer by creating another test site, then HHVM will fall back to PHP7.

TBH, I am not a pro, so just trying to help you out.

Thanks, yes, I really need try to migrate site to only PHP7+Niginx…

Site migrate should not be a problem. Backup with Updraft plus… Restore with a new EE setup site with PHP7. I did that before.

Which php version is used in your HHVM please?

I no longer use HHVM. I ONLY USE PHP7

1 Like

yeah php7 with redis show very good result

It is memory. I had this problem with 1GB Ram.

  1. Reduce MySql memory footprint
  2. Increase memory (at least 2GB)
  3. Create or enlarge swap file (will prevent crash, but will be slow when is used)
  4. Do not remember name, but there exists software that monitors when service fails and restart it again