WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
admin-ajax.php slow server response time (28 posts)

  1. yourbuddy009
    Member
    Posted 7 months ago #

    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/

  2. Roy
    Member
    Posted 7 months ago #

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

  3. kenw232
    Member
    Posted 6 months ago #

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

  4. Chirag Vora
    Member
    Posted 5 months ago #

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

  5. optimized-marketing.com
    Member
    Posted 5 months ago #

    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

  6. Chirag Vora
    Member
    Posted 5 months ago #

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

  7. scarlet522
    Member
    Posted 4 months ago #

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

  8. zappyone
    Member
    Posted 4 months ago #

    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.

  9. optimized-marketing.com
    Member
    Posted 4 months ago #

    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.

  10. Chirag Vora
    Member
    Posted 4 months ago #

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

  11. Chirag Vora
    Member
    Posted 4 months ago #

    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?

  12. zappyone
    Member
    Posted 4 months ago #

    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.

  13. Coen Jacobs
    Member
    Plugin Author

    Posted 4 months ago #

    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. :)

  14. Chirag Vora
    Member
    Posted 4 months ago #

    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

  15. Patrick Rauland
    Member
    Posted 3 months ago #

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

  16. cpatience
    Member
    Posted 3 months ago #

    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?

  17. rickydwilson
    Member
    Posted 3 months ago #

    I also have the problem with admin-ajax.php being called by Woocommerce which has a long wait time. What options are there to speed this up. Thanks

  18. fuad47
    Member
    Posted 2 months ago #

    İ also experience the same problem, this ajax.php extremely slovs dovn my vebpage according to pingdom tools. What does WP thinks about that man?

  19. fuad47
    Member
    Posted 2 months ago #

    I have find some useful point. When wp admin panel is opened at the same time with my website, ajax.php causes the loading time to increase. But when I logout\close wp admin page the website loads very fast. Beacuse we, site owners always open both admin panel and website together to edit their pages :)

  20. Steve
    Member
    Posted 2 months ago #

    @faud47. Are you saying that if we log in as admin into our site, and then do a Pingdom test, this will affect the Pingdom load-time results for admin-ajax.php ?? Having same issue, but I DO NOT have woocommerce installed. Thanks

  21. fuad47
    Member
    Posted 2 months ago #

    Yes I think so, moreover you can search for minimize WP loading time tips for,example and try the advices.

  22. eventosesportivosbrasil
    Member
    Posted 2 months ago #

    I was experiencing the same problem... Too slow when browsing the site and even more slow when using the admin page.

    I do not have use for the auto save option, so disabling it is not a problem at all.

    I just used the above code in both my sites and the problem is resolved!

    http://www.copamundial2014brasil.com.br and http://www.precodehotel.com.br

  23. Steve
    Member
    Posted 2 months ago #

    Thanks guys. My load time is 2.5s but could be down to 1.2s if it wasn't for this issue. Some people above report that this function doesn't work for them. And I just did a test for your sites @eventosesportivosbrasil and according to Pingdom the load times for them are: 10.97s and 15.15s. You're biggest issue is still the same: admin-ajax.php. If it wasn't for that, your load time could be down to 3s -4 s or less. So, it looks like the code above did not help!

  24. eventosesportivosbrasil
    Member
    Posted 2 months ago #

    Steve,

    Before I use the code above, the loading time of the sites was +-20 and +- 25 seconds. I´m able to reduce the loading time by almost half.

    I known its far from perfection, but it´s much better than without it...

    Both my sites use a lot of images at their homepages, but as you´ve pointed out, the issue is still admin-ajax.php.

    Any hints ant tips will be happily received!

    Best regards

  25. Steve
    Member
    Posted 2 months ago #

    @eventosesportivosbrasil. You should turn on gzip compression in your .htaccess. And install the Quick Cache plugin (very simple to use, just install and turn it on). If you need more info on these and how to set up, send me your direct email or Skype ID. Glad to help (as time permits). Cheers

  26. laurabfont
    Member
    Posted 1 month ago #

    I am also having the problem with admin-ajax.php being called by Woocommerce and the wait time is pretty absurd. I added in the code to disable the heartbeat but it did not help. Are there any other options? This seems like a big problem. Thanks

  27. zumzam123
    Member
    Posted 2 weeks ago #

    Same problem here any solutions?

    On my site the admin-ajax.php takes 600 ms to laod...

  28. CreativeWP
    Member
    Posted 1 week ago #

    Did anyone find a solution?

    I tried this:

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

    Did not work! :-(

Reply

You must log in to post.

About this Plugin

About this Topic