WordPress slow - Cannot find solution

Ok, so I have a fast dedicated server with 32GB Ram, 6 Cores, 15mb cache, 2x1 TB Harddrives, with RAID-1. Everything has been optimized and Nginx settings perfected. We have about 240 sites.

Here is the problem-
The sites are fast, but then...
When we are working on them they start slowing down, after a few hours it goes from 1.5 sec load time to about 15 seconds. If there are multiple people working then that time goes from 1.5 sec to about 30 sec within an hour or so.
When we are not working on them it takes about 24 hours to go from 1.5 sec to about 20 sec load time.

Found a temporary solution, but I need a permanent one.
The temp solution is:
I deactivate ALL plugins and then activate ALL plugins. It seems to reset something and it is fast again. Literally, like nothing is wrong.

When I look at NewRelic everything looks good except it says that about 95% of the load is in admin-ajax.

So my question is what is the long term solution? Why is it when I deactivate them all and then activate them all it gets back to being fast? Any help is very much appreciated! Thank you!

  • Adam Czajczyk
    • Support Gorilla

    Hello Brandi,

    I hope you're well today and thank you for your question!

    Hardware resources and web server (NGINX in this case) optimization are very important factors here but not the only ones. There are two often missed issues that can result in similar behavior and these are the number of connections/queries that server can handle at the time (though it's more important in case of Apache than NGINX) and the MySQL optimization.

    In this case however I'd say that a plugin (or some of them) is affecting performance, judging upon your "temporary solution". I suppose that something is causing a "flood" of "admin-ajax.php" calls (as you mentioned) and this gradually "clogs" server resources. Disabling all plugins simply "unclogs" it because it stops "admin-ajax.php" calls.

    The important part then would be to identify that particular plugin. That said, I'd like to ask you to enable WordPress debugging by adding following lines to the "wp-config.php" file of your site:


    After this id done, please go through a "slow down - reset" cycle one or two times and then
    - access your site via FTP
    - go to "/wp-content" folder
    - download the "debug.log" file
    - rename it to "debug.txt" and attach to your post here.

    I'd also like to take a closer look at the site so it would be great if you could grant me a support access to it using our WPMU DEV Dashboard plugin along posting debug file here.

    Here's a guide on granting access:

    Best regards,

  • Brandi
    • Site Builder, Child of Zeus

    I have enabled support access. I added the debug lines to the file, but no debug file has been generated yet. I have been working off and on trying to make it generate, but nothing so far. I am looking at the /wp-content/ folder and no other files have been added so far.

    This is part of the wp-config:
    define('WP_ALLOW_MULTISITE', true);
    define('WPMU_ACCEL_REDIRECT', true);
    define('WP_DEBUG', true); define('WP_DEBUG_LOG',true); define('WP_DEBUG_DISPLAY',false);

    So far the speed is not doing bad. About 4 hours ago it was 1.66 sec load on one of the sites and now the same site is 2.16 sec load time. So not bad at all, but I know it probably will creep up to 30+ seconds again by tomorrow afternoon.

  • Predrag Dubajic
    • Support

    Hi Brandi,

    Since the debug.log is not filling up with any info could you try asking your host to check server logs and see if there's anything that could tell us what's taking up the resources?

    Also, when your site slows down does it also happen if you open it in different browser?

    Best regards,

  • Brandi
    • Site Builder, Child of Zeus

    So for whatever reason the server is not generating a debug log and as far as server issues nothing is appear to according to our host.

    The sites all slow down regardless of what browser I am on and also appears slow on tools.pingdom.com

    On new relic it is still showing that the admin-ajax is what most of the time is spent on. When I deactivate all the plugins and then reactivate all the plugins back to back it temporarily fixes the problem. We generally have to do this about 3 times a day. (Attached is an image of what I see in NewRelic)

    Any other suggestions?

    Also, is there a way to create a cron job that deactivates all plugins and then reactivates them all like every 2 hours?

  • Brandi
    • Site Builder, Child of Zeus

    So I upgraded my subscription with NewRelic so I could find which of the plugins is causing the issue. It is the domain mapping plugin from you all. Attached is the screenshot. We have roughly 240 domains currently being mapped, and we are having to deactivate and activate every couple of hours.

    So the domain mapping plugin is currently taking all the time and the hook that is causing the issues admin_init. It seems to be causing an excess in the admin-ajax for whatever reason. When I deactivate then activate it, it seems to clear it out. Now we just need a permanent solution.

    Any ideas on how to fix this quickly?

  • Adam Czajczyk
    • Support Gorilla

    Hello Brandi,

    Thank you for this additional information.

    This is quite surprising, I must admit but we'll of course need to take a closer look. I feel I need to include Domain Mapping developer in this so I asked him for help here and am awaiting his response.

    Just in case he'd like to take a closer look at your setup: would you agree to provide me with full access credentials? Since it's a Domain Mapping/server related issue the support access may not be enough as it doesn't let us work with plugin's files. That said, please send in:

    Subject: "Attn: Adam Czajczyk"

    - Mark to my attention, the subject line should contain only: ATTN: Adam Czajczyk
    - Do not include anything else in the subject line, doing so may delay our response due to how email filtering works.
    - Link back to this thread
    - login URL and admin account login credentials (may be a temporary admin account) data
    - Include FTP log-in details (hostname, username & password)
    - Include hosting control panel access details (login address, username & password)
    -- cPanel's usually the control panel used for this, but your provider may use something else; I'll need this for accessing your site's database, preferably via phpMyAdmin
    - Include any relevant URLs for your site

    Please use our contact form here http://premium.wpmudev.org/contact/.
    Select "I have a different question" from the drop-down list.

    Please be sure to make a full backup of your entire site first!

    Please note also that developers response may be a bit slower than ours here on support forum as he deals with a lot of complex issues on daily basis.

    I'll keep you informed.

    Best regards,

  • petemaster5000
    • Design Lord, Child of Thor

    I'm having problems with wpmu domain mapping now too since upgrading wordpress from 4.5.1 to 4.5.2. I get the "domain is unavailable to access...dns" but the domain is guaranteed pointing to the correct IP. If I disable the "check for dns before" and "check after..." in the mapping settings, it will map the domain, but shows in red: Invalid.... but the website will work even despite the mapping thinks it's invalid.

    The really strange thing is, I mapped a different domain on same server, on hour earlier and it worked. no config changes since.

    Anyone else have this issue?

  • Brandi
    • Site Builder, Child of Zeus

    I had that same issue to, but if you do it three or four times in a row it will eventually make it valid. So what I did was add the domain, it says invalid, do it again, it says invalid, do it again and usually on the third or fourth try it will say Valid. That is just what I have experienced.

  • Brandi
    • Site Builder, Child of Zeus

    Hi Adam,
    I am getting everything ready to give you access to the website via FTP and phpadmin via the contact form. I am currently backing everything up before hand though, so that is what is taking a little time.

  • Adam Czajczyk
    • Support Gorilla

    Hello Brandi!

    I apologize for keeping you waiting. I know that Domain Mapping developer is looking into this and I'm sorry that it takes so long. I asked him again to updated me as soon as possible and I'll let you know immediately when I get information from him. I'll respond either here in the thread or directly via e-mail.

    Kind regards,

  • Milan
    • WordPress Wizard

    Hello Brandi ,

    Hope you are well today and won't mind me chiming here. :slight_smile:

    Unfortunately there isn't any update on this. As soon as there would be any update, you'll be notified. We appreciate your patience here.

    Thanks for being with us. :slight_smile:
    Kind Regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.