• So I’ve been running 4 WP installation on a vps with 4gb ram. The site do not get a lot of traffic, mostly around 100-200 hits/day for all 4 of them.

    My server keeps on crashing every 12-24 hours, the cpu load spikes and then the MySql server gets killed.

    I have caching plugins, my wp-admin is renamed so I don’t get brute force attack and 2 of the 4 website are behind cloudflare.

    I’m trying to find the source of the problem, to get rid of it! Is there any way to identify from which website the cause of the problem is? Is there any logging plugin I can install to see this?

    Thanks

Viewing 13 replies - 31 through 43 (of 43 total)
  • Thread Starter hmseb

    (@hmseb)

    Here are the lines from my debug file from the last crash.

    [24-Jan-2016 13:12:49 UTC] PHP Warning: mysqli_real_connect(): (08004/1040): Too many connections in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:12:49 UTC] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:12:49 UTC] PHP Warning: mysqli_real_connect(): (08004/1040): Too many connections in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:12:49 UTC] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:12:49 UTC] PHP Warning: mysqli_real_connect(): (08004/1040): Too many connections in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:12:49 UTC] PHP Warning: mysqli_real_connect(): (08004/1040): Too many connections in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:12:49 UTC] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:12:49 UTC] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:12:49 UTC] PHP Warning: mysqli_real_connect(): (08004/1040): Too many connections in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:12:49 UTC] PHP Warning: mysqli_real_connect(): (08004/1040): Too many connections in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:12:49 UTC] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:12:49 UTC] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:12:49 UTC] PHP Warning: mysqli_real_connect(): (08004/1040): Too many connections in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:12:49 UTC] PHP Warning: mysqli_real_connect(): (08004/1040): Too many connections in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:12:49 UTC] PHP Warning: mysqli_real_connect(): (08004/1040): Too many connections in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:12:49 UTC] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:12:49 UTC] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:12:49 UTC] PHP Warning: mysqli_real_connect(): (08004/1040): Too many connections in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:12:49 UTC] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:12:49 UTC] PHP Warning: mysqli_real_connect(): (08004/1040): Too many connections in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:12:49 UTC] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:12:49 UTC] PHP Warning: mysql_connect(): Too many connections in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:12:49 UTC] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:12:49 UTC] PHP Warning: mysql_connect(): Too many connections in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:12:49 UTC] PHP Warning: mysql_connect(): Too many connections in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:12:49 UTC] PHP Warning: mysql_connect(): Too many connections in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:12:49 UTC] PHP Warning: mysql_connect(): Too many connections in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:12:49 UTC] PHP Warning: mysql_connect(): Too many connections in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:12:49 UTC] PHP Warning: mysql_connect(): Too many connections in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:12:49 UTC] PHP Warning: mysql_connect(): Too many connections in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:12:49 UTC] PHP Warning: mysql_connect(): Too many connections in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:12:49 UTC] PHP Warning: mysql_connect(): Too many connections in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:12:49 UTC] PHP Warning: mysql_connect(): Too many connections in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:12:51 UTC] PHP Warning: mysqli_real_connect(): MySQL server has gone away in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:12:51 UTC] PHP Warning: mysqli_real_connect(): Error while reading greeting packet. PID=6953 in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:12:51 UTC] PHP Warning: mysqli_real_connect(): (HY000/2006): MySQL server has gone away in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:12:51 UTC] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:12:51 UTC] PHP Warning: mysql_connect(): Connection refused in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:12:56 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): Connection refused in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:12:57 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): Connection refused in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:09 UTC] PHP Warning: mysqli_real_connect(): MySQL server has gone away in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:09 UTC] PHP Warning: mysqli_real_connect(): MySQL server has gone away in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:09 UTC] PHP Warning: mysqli_real_connect(): MySQL server has gone away in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:09 UTC] PHP Warning: mysqli_real_connect(): (HY000/2006): MySQL server has gone away in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:09 UTC] PHP Warning: mysqli_real_connect(): Error while reading greeting packet. PID=7162 in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:09 UTC] PHP Warning: mysqli_real_connect(): Error while reading greeting packet. PID=7159 in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:09 UTC] PHP Warning: mysqli_real_connect(): (HY000/2006): MySQL server has gone away in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:09 UTC] PHP Warning: mysqli_real_connect(): (HY000/2006): MySQL server has gone away in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:09 UTC] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:13:09 UTC] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:13:09 UTC] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:13:09 UTC] PHP Warning: mysql_connect(): Connection refused in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:13:09 UTC] PHP Warning: mysql_connect(): Connection refused in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:13:09 UTC] PHP Warning: mysql_connect(): Connection refused in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:13:11 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:11 UTC] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:13:11 UTC] PHP Warning: mysql_connect(): No such file or directory in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:13:18 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:18 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:18 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:18 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:18 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:20 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:20 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:20 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:20 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:20 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:21 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:23 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:23 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:23 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:23 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:23 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:24 UTC] PHP Warning: Cannot modify header information – headers already sent by (output started at /home/pinuts/public_html/wp-includes/functions.php:3464) in /home/pinuts/public_html/wp-includes/functions.php on line 3503
    [24-Jan-2016 13:13:24 UTC] PHP Warning: Cannot modify header information – headers already sent by (output started at /home/pinuts/public_html/wp-includes/functions.php:3464) in /home/pinuts/public_html/wp-includes/functions.php on line 3503
    [24-Jan-2016 13:13:24 UTC] PHP Warning: Cannot modify header information – headers already sent by (output started at /home/pinuts/public_html/wp-includes/functions.php:3464) in /home/pinuts/public_html/wp-includes/functions.php on line 3503
    [24-Jan-2016 13:13:24 UTC] PHP Warning: Cannot modify header information – headers already sent by (output started at /home/pinuts/public_html/wp-includes/functions.php:3464) in /home/pinuts/public_html/wp-includes/functions.php on line 3503
    [24-Jan-2016 13:13:24 UTC] PHP Warning: Cannot modify header information – headers already sent by (output started at /home/pinuts/public_html/wp-includes/functions.php:3506) in /home/pinuts/public_html/wp-includes/functions.php on line 3503
    [24-Jan-2016 13:13:25 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:26 UTC] PHP Warning: Cannot modify header information – headers already sent by (output started at /home/pinuts/public_html/wp-includes/functions.php:3506) in /home/pinuts/public_html/wp-includes/functions.php on line 3503
    [24-Jan-2016 13:13:27 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:28 UTC] PHP Warning: Cannot modify header information – headers already sent by (output started at /home/pinuts/public_html/wp-includes/functions.php:3464) in /home/pinuts/public_html/wp-includes/functions.php on line 3503
    [24-Jan-2016 13:13:33 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:33 UTC] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:13:33 UTC] PHP Warning: mysql_connect(): No such file or directory in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:13:33 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /home/pinuts/public_html/wp-includes/wp-db.php on line 1488
    [24-Jan-2016 13:13:33 UTC] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518
    [24-Jan-2016 13:13:33 UTC] PHP Warning: mysql_connect(): No such file or directory in /home/pinuts/public_html/wp-includes/wp-db.php on line 1518

    Thread Starter hmseb

    (@hmseb)

    I’ve also raise the memory limit to 256MB and the memory of a script to 64MB.

    I just don’t get what can cause this many cache in the memory http://i.imgur.com/3zB9DsW.png

    So the issue happens with “pinuts” site, sorry just trying to catch up.

    Have you tried switching themes?

    You also said the spike doesn’t happen same time each day, it varies.

    I’m wondering if there’s an area on your ecommerce site, where if ran, it reads so much data it actually kills all available resources ending in a overall crash of MYSQL. Seen it happen before, just bad coded in function but that also was with 10k products, how many do you have?

    Thread Starter hmseb

    (@hmseb)

    I haven’t tried switching themes, I have this theme since September, never had an issue before.

    I doubt it, I only have 25 products and when I run P3 it doesn’t crash automatically.

    Your post log shows too many connections. It’s possibly that a misconfiguration is within the overall server setup and rather then having one connection open up and be reused to connect to your DB, your just having new connections opened which are never closed after session and thus you spike up and run out of it all, which your DB then crashes.

    Sorry these are just thoughts.

    Any updates since September or last time this stuff was working fine without any spikes?

    Thread Starter hmseb

    (@hmseb)

    Possible I don’t remember, there’s so many plugin updates all the time…

    From what I’ve seen, the memory in myPhpAdmin is getting full, then the cpu usage goes crazy, the mysql gets shutdown. When the mysql server comes back up, everything is working fine for a few hours.

    Ok so you narrowed it down to one site now. What plugins do you have that are active. Actually any deactivated plugins I would remove because even though you deactivate a plugin, if its a bust of a plugin, well it’ll still keep up with its damage even after being deactivated.

    There’s a lot here that is running. However we sure know its MySQL being affected and something is eating your DB up.

    I sear I had this same problem with a site I managed, it would work for couple hours and MySQL would crash, reload and its running for a few hours again. If I could just remember the fix ohhhh grrr. 🙂

    Ok… Let’s see,

    what plugins, if any do you have that might be running some type of cron job?

    Or do you have any cron jobs running?

    Tried disabling all plugins and monitoring for spikes?

    You could also try putting this in wp-config.php for time being to see if spikes go away.

    define('DISABLE_WP_CRON', 'true');

    Just thinking, what do you have max_connections in mysql set at?

    Thread Starter hmseb

    (@hmseb)

    I have a backup cron job job running at from 1 to 2 AM, to avoid affecting the server during the day.

    I’ll look into cron jobs

    Max connection is 100

    I’ve also have the logs from 2 sites of the last sql crash of this morning, you can look at there here:
    https://dl.dropboxusercontent.com/u/5725048/hmseb.txt
    https://dl.dropboxusercontent.com/u/5725048/pinuts.txt

    Thread Starter hmseb

    (@hmseb)

    Here are the slowqueries if that can help…

    https://dl.dropboxusercontent.com/u/5725048/SlowQueries.txt

    Karl Silver

    (@karlfox2014akakldkarl)

    Hello, hmseb.

    Did you use any sort of custom queries on your page? Something you added to functions.php yourself? E.g. some heavy qeruies dealing with a lot of tables or something similar? > Could point to programming errors or just some queries that are too intense or too slow.

    Could you run your site (for testing purposes) on a different theme and does the error still occur? > could narrow it clearly down to some theme error.

    Does the error occur if you put the site into maintenance mode and lockout every public access at the time the server usually goes down? > could point to to some internal error not connected with external user access or access by search engine crawling meachnisms.

    Just thoughts.
    Hope you find the cause.

    Regards,

    Karl

Viewing 13 replies - 31 through 43 (of 43 total)

The topic ‘Server load and MySql problem’ is closed to new replies.