[wp-trac] [WordPress Trac] #26050: Continual Admin Page POST (HeartBeats?) Can Cause SQL Connection Issues

WordPress Trac noreply at wordpress.org
Sat Nov 16 00:01:20 UTC 2013


#26050: Continual Admin Page POST (HeartBeats?) Can Cause SQL Connection Issues
-------------------------------------+------------------------------
 Reporter:  optimized-marketing.com  |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  General                  |     Version:  3.7.1
 Severity:  normal                   |  Resolution:
 Keywords:                           |
-------------------------------------+------------------------------

Comment (by azaozz):

 As far as I can find out, the MySQL "sleeping" connections are waiting to
 terminate. Not sure what could be causing them to wait, WordPress doesn't
 use persistent DB connections and all default heartbeat AJAX requests
 don't load the server much (quite less than a normal page view).

 > ...have one common heartbeat for multiple pages/whole site?

 There is no way for JS to access a different browser window/tab. When
 different pages of the same site (same domain) are opened in different
 windows, it may be possible to use cookies and/or session storage to
 communicate between them. However not sure if that's a good solution, can
 experiment with it. In any case will try to add "sleep" functionality for
 3.8.

 Good way to turn heartbeat off is to not load the JS. Not advisable at
 least on the Add/Edit Post screen as the plan is to use heartbeat as
 transport for autosave. Something like this should work (untested):

 {{{
 add_action( 'init', 'my_deregister_heartbeat', 1 );
 function my_deregister_heartbeat() {
         global $pagenow;

         if ( 'post.php' != $pagenow && 'post-new.php' != $pagenow )
                 wp_deregister_script('heartbeat');
 }
 }}}

--
Ticket URL: <http://core.trac.wordpress.org/ticket/26050#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list