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

WordPress Trac noreply at wordpress.org
Fri Nov 15 21:47:05 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 optimized-marketing.com):

 > > If multiple admin pages are open for long periods of time(ex. over
 night) the SQL Connections associated with the POSTs will begin to
 progressively have longer sleep times.
 >
 > What exactly causes the SQL Connections to have "sleep times"? Would
 they have "sleep time" when you have visitors to your site? I know some
 hosting companies have limits for "SQL connections per hour" or similar,
 probably this is the problem.
 I don't know what is causing the sleep times, this is just what I am
 seeing during POSTs to admin-ajax.php. I have attached an image with an
 example of what I am seeing.

 When visitors load up a page there is a sleep command but the time is 0
 sec. I can see how the connection limits per hour could be an issue but
 for my hosting the only SQL limits I know of are 25 concurrent connections
 and connections over 30 sec. I will double check with my Hosting Service.
 By the way this is the 2nd hosting service I have been able to reproduce
 this on(hostgator and godaddy).

 > Heartbeat behaves very similarly to autosave. The differences are that
 it runs on all admin pages vs. only Add/Edit Post, and connects less
 frequently when the user is not active. Have you had problems with your
 host when leaving the Edit Post page loaded overnight?

 I have not had any issues leaving edit post pages open all day and night.
 I actually do this quite frequently, that is why I was surprised when this
 occurred for the admin pages. I have also not been able to reproduced this
 issue with only 1 or 2 admin pages open over night. It could be that the
 more connections happening repeatedly could cause this issue to manifest
 its self earlier. so 1 or 2 open admin pages with the heartbeat may take 2
 days to reproduce were 6 open only takes a few hours.

 > > Is this the expected experience/results? Should there be a sleep
 setting on these POSTs to stop after a given time frame?
 >
 > Unfortunately it is impossible to guess what the user's intentions are.
 When a web page is left loaded in the browser, the most common reason is
 that the user would come back to it and continue to use it.

 I am referring to the expectations of how WP would function and act in
 this type of situation. Should it be causing issue with SQL connetions
 just hanging around for 30+ seconds without any human activity?

 > Most computers would "fall sleep" after a period of inactivity usually
 10-30min, effectively disconnecting from Internet. Been testing adding the
 same functionality to heartbeat, however that would affect the other
 functions. For example post locks will be released too.

 I understand the reason for having the heartbeat and a sleep function
 might be a good solution. Just trying to figure out the best happy medium.
 Is the need for the heartbeat after 10+ hours with the pages being
 inactive worth the negative consequences? Is there a better way to trigger
 the heartbeat? or have one common heartbeat for multiple pages/whole site?
 Just trying to figure out if there is an in between option.

 Is there any way to turn off the heartbeat and what would be the
 consequences? I tried adding remove_action( 'admin_init',
 'wp_auth_check_load' ); in my functions.php file, but that didn't do
 anything.

 Hopefully this clears some things up. Let me know if you need more
 information or have more questions.

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


More information about the wp-trac mailing list