WordPress.org

Ready to get started?Download WordPress

Forums

Nginx
[resolved] Admin slow (4 posts)

  1. BigWilliam
    Member
    Posted 1 year ago #

    When nginx helper is activated, it takes WordPress up to 10 seconds just to 'update' a page after I edit it in Admin. I verified this on 2 sites. It makes saving things in the admin slow, but once I disable the plugin, pages load normally (admin only).

    I have no idea what might be the issue. I'm running on Ubuntu 12.04, Nginx, php5-fpm.

    Any help is appreciated. Thanks!

    http://wordpress.org/extend/plugins/nginx-helper/

  2. rahul286
    Member
    Plugin Author

    Posted 1 year ago #

    @BigWilliam

    Check cache flushing settings. Looks like you are flushing entire site cache whenever you are editing a page AND may be your site is too big!

  3. bocajuniors
    Member
    Posted 10 months ago #

    I've had the exact same problem. Using New Relic (a web application performance app) I was able to trace the issue to the cache purge that Nginx Helper implements. What Nginx Helper does is use wp_remote_get() to "fetch" the URL, with the /purge/ in the URL, to purge the cache. Slightly more than 90% of that update/publish time was due to this cache purging.

    Here is my output from New Relic, tracing what's taking time: http://cl.ly/image/2O242I0l3L3c

    You can check what your Nginx Helper is purging by setting Log to "Info" and looking at /wp-content/uploads/nginx-helper/nginx.log

    I minimized the load time doing two things.

    First, I unchecked the options for "Purge Archives", since it was fetching every related URL for the post (date archives, category archives, tags, etc).

    Second, in the purger.php file, on Line 205, I switched "feed =" to "false". I don't cache feeds. And what was happening is that Nginx Helper tries to purge the cache of every URL, plus adding /feed/, /feed/atom/, and /feed/rdf/ onto the end of every URL. Each of these requests took time.

    Here's the line I changed: https://github.com/rtCamp/nginx-helper/blob/master/purger.php#L205

    And voila! It only takes a fews seconds to update/publish a post now. This isn't a perfect solution, since any update will break the purger.php edit, but for now it's at least tolerable.

    Make sure to follow up and check what's being purged by looking again at /wp-content/uploads/nginx-helper/nginx.log

  4. rahul286
    Member
    Plugin Author

    Posted 10 months ago #

    Try adding your domain to /etc/hosts file with IP 127.0.0.1

    Like...

    127.0.0.1 example.com

    If long delay has to do with DNS above can fix it.

    You can also simply uncheck purging on post actions. Pages will automatically purge as per nginx config.

    In future, we may add "queue" to async "purging" part.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.