[wp-hackers] Database connection drops

J.D. Grimes jdg at codesymphony.co
Tue Dec 10 13:38:08 UTC 2013


Have a look at this ticket (tagged 3.9-early, too): https://core.trac.wordpress.org/ticket/5932

-J.D.

On Dec 10, 2013, at 3:59 AM, David Anderson <david at wordshell.net> wrote:

> Hi,
> 
> It's amazing how slow some people's web hosting is. I'm currently looking at a log file of a backup of a site which takes over an hour to create a single 150Mb zip file (which does have 26,000 files in it).
> 
> It appears that after somewhere around 3000 seconds, the database connection is dropped, and all commands that result in talking to the database silently fail. For example, this returns no results:
> 
> $all_tables = $wpdb->get_results("SHOW TABLES", ARRAY_N);
> 
> As another example, the option which my code is using to save its state isn't updated after that time. The saved state is out-of-date. (At this point, that's not a huge problem, as I have lots of checks and balances).
> 
> If I use the scheduler to schedule a restart of the task a few seconds later, then everything works. $wpdb isn't getting over-written, as that would lead to fatal errors for methods not found instead of silent failure.
> 
> Has anyone come across something like that before? Does anyone know where in WordPress core this happens...
> 
> ... and the important question: how to detect it/refresh the connection when it happens? At the moment I've thrown in a quick check at a key point, but on the test case I've seen, that comes about 10 minutes late. That's no problem, as everything in the code I've written is resumable and can detect and recover from failures like this. It'd just be good to not waste 10 minutes though.
> 
> Many thanks,
> David
> 
> -- 
> UpdraftPlus - Best WordPress backups - http://updraftplus.com
> WordShell - WordPress fast from the CLI - http://wordshell.net
> 
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list