WordPress.org

Support

Support » Plugins and Hacks » admin-ajax.php slow server response time

admin-ajax.php slow server response time

  • yourbuddy009
    Member

    @yourbuddy009

    I’m trying to speed my woocommerse store up.

    So far I’ve done well. When analyzing the server response time for the various elements, it seems that the admin-ajax.php is taking forever for the server to respond.

    After digging, it seems this file is being called 20 times or so per page load. Since all the other elements that are being called in have a fast server response time, it seems the issue is not a hardware one, but rather an issue in the design as to how woocommerce is dealing with this file.

    Do you have any suggestions as to what I can do to speed it up? This is the site.

    Thanks

    http://wordpress.org/plugins/woocommerce/

Viewing 15 replies - 1 through 15 (of 35 total)
  • Roy Ho
    Member

    @splashingpixelscom

    How did you determined that it was called 20 times on every page load?

    I have the same problem. admin-ajax.php is dragging the server down and its only admin-ajax.php.

    Same with my store pingdom suggests that admin-ajax.php is the culprit.

    optimized-marketing
    Member

    @optimized-marketingcom

    My Webhosting shut all my sites down because admin-ajax.php was creating DB connections and sleep for long periods of time(there is more to the story but that is the bottom line). The highest sleep time I saw was 45s. What I determined is that in one of the WP updates, from WP 3.5 to WP 3.7.1, admin-ajax.php started being called from multiple pages (widgets.php, index.php, themes.php, and a few more) ever 2.5-3 min, even if nothing on the pages was touched. In WP 3.5 admin-ajax.php was only called automatically on the post.php page (I believe for autosave purposes)

    What is the point of admin-ajax.php being called on pages where no information was change and no ajax was initiated? Is there a way to turn this off?

    I have way more details if a WP Developer wants a way to reproduce the issue.

    Greg

    Nice insights there @greg. Hope this gets figured out in upcoming WP versions. Any workarounds for time being? without messing things?

    scarlet522
    Member

    @scarlet522

    I am having this same issue. admin-ajax.php is taking a while to load on the page…

    This is a serious problem for my site as well. Been shut down by HG multiple times no matte rhow many plugins I turn off/delete! Any alternate/temp fix would be great relief.

    optimized-marketing
    Member

    @optimized-marketingcom

    So I talked to a developer and got a temp work around. It is talked about in this forum post:

    http://wordpress.org/support/topic/admin-ajaxphp-being-called-from-admin-pages-causing-db-connection-issues

    It might not fix the issue for you but hopefully it helps.

    zappyone you issue sounds similar to mine since I used HG as well when this issue came up.

    @optimized-marketing.com Will this work for all WooCommerce install or is it a special use-case?

    Oh so from what I understood, the probable culprit is hearbeat API which was introduced in WooCommerce.. So how do I ensure that this workaround won’t break any other functionality of WooCommerce and other plugins?

    Sure does optimizedmarketing, I saw your post yesterday and tried it. Not really sure if it is working but so far I haven’t been shut down. According to my whm server stats I’m running anywhere from 25% to 35% that I can tell. Be nice if I could see a graph of that overtime?

    Chirag Vora: I am running woocommerce

    What concerns me is when I do a webpagetest.org report I get this long green line for /wp-admin/admin-ajax.php and 6000ms on the waterfall. Clearly something still isn’t right but let’s hope the fix will at least keep the website in safe territory with HG. (HG is a HUGE thread in itself)

    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');
    }

    I am also only using one or two windows when logged in. When not in use I log everything out.

    Just to be clear, WooCommerce did not introduce the Heartbeat API, neither is it using it in the current stable releases or the upcoming v2.1 release.

    The Heartbeat API was introduced in WordPress 3.6 and yes this is known for bringing down servers if used wrong. But if anything, it’s not WooCommerce, you can search our entire plugin for it being used, I can tell you it’s not. 🙂

    Oh yes. I saw on other forums, many non-Woo users are also facing this difficulty. This has nothing to do with WooCommerce. Heartbeat is part of WP.
    Thanks for confirming @jacob

    @coen – any other ideas why might be making the admin-ajax take a while to load?

    cpatience
    Member

    @cpatience

    We’re also seeing admin-ajax.php affecting the load time of our site. It does appear to be related to Woocommerce, since the load time of admin-ajax.php increased (ranging from 3-10+ seconds) when Woocommerce is active. The issue disappears when Woocommerce is deactivated.

    We’ve installed the heartbeat function posted earlier but see no change. Any other ideas?

Viewing 15 replies - 1 through 15 (of 35 total)
  • The topic ‘admin-ajax.php slow server response time’ is closed to new replies.