I have been running a fairly new site on Local 2.2.4 on one Mac that has maybe 21 plugins active in WordPress. While not super fast, the backend loads reasonably quickly. I have another older, larger site that I am redesigning in Local 2.2.4 on another Mac. This site has about 70 plugins active. This site runs very slow in Local, especially the backend admin.
Here are the results of some tests on this larger site:
Time to load Plugins page in backend (70 plugins active, disconnected from internet) = 30 seconds
Time to load Plugins page in backend (29 plugins active, disconnected from internet) = 22 seconds
Time to load Plugins page in backend (9 plugins active, disconnected from internet) = 4 seconds
Time to load Plugins page in backend (70 plugins active, CONNECTED TO INTERNET) = 35 seconds
Time to load Dashboard page in backend (70 plugins active, CONNECTED TO INTERNET) = 5 to 10 seconds
My live site on PHP 7 and php-fpm generally loads the Plugins page in no more than 2 to 3 seconds with the 70 plugins enabled. I would think that Local should be able to match that at least.
Iāve tried many of the tweaks offered here in the forums and the only thing I see that makes Local run lightning fast on this Mac running the latest version if High Sierra is to disable all plugins which obviously is not an option.
You described those 3 situations where you have 9, 29 and 70 plugins active. Thatās quite a scenery for Wordpress comparison on high load.
29 plugins is fairly ok for Wordpress running smoothly, but 70 plugins is something else. Plugins generally have more utilities than you often use (and they still load), and thereās the issue with updates and compatibility too, running all those plugins means that if even 5 of them are using deprecated functions from Wordpress, they hang on errors a lot, causing it to have slow loads, and running 70 means that you increase that possibility.
The only way to prevent that (on front-end) in some cases is caching. There are several methods of caching, you know if your live site with 70 plugins runs any kind of caching? If not, loading in 2 - 3 seconds with 70 active plugins is quite a feat, I wanna know what you did haha.
Local supports OPCache, I didnāt find anything about how to enable it specifically on Local, but that generic post might help you: https://kx.cloudingenium.com/technologies/wordpress/install-zend-opcache-php-wordpress/
Some kinds of caching can prevent some plugins from working properly (so configurations must be made to be sure that everything works), so if your live site uses caching, try to use the same kind of caching as it.
Also, different versions of PHP means faster and more efficient loads, so check if your Local environment matches perfectly the live environment. Earlier versions of PHP are faster, but donāt use a different version from your live environment, as it can cause problems after a deploy from local to staging or directly to live.
As I said, in addition to running PHP 7 on the live server (VPS), Iām also have php-fpm enabled. When php-fpm was enabled on the live server, it really made my site load fast on both the frontend and backend. Not sure that php-fpm can be set up and used in Local. Also, I use WP Rocket for caching on the live server. Iāve tested in Local with WP Rocket enabled and disabled but the load times are still slow either way. I think that OpCache is enabled on the live server too, BTW.
In comparing to the latest version of DesktopServer (3.9.0 release candidate), I get acceptable load time on the backend in Airplane Mode (the Plugins page loads in about 3 seconds). With Airplane Mode enabled (via a plugin) in Local, the Plugins page still takes about 30 seconds to load so there seems to be something specific to Local as being the issue from what Iām seeing.
Well, in comparison to DesktopServer, I canāt really say that much, cause Iāve never used it. But the virtual machine that Local creates in order to be able to best replicate the live/staging environment is more resource heavy than installing apache/mysql/etc in your own computer/system like XAMPP, MAMP (and most likely DesktopServer too). So it indeed takes a blow from that in load time I guess.
Each of those apps have different kinds of approaches to local development, as XAMPP, MAMP focus on giving a basic environment to work locally, DesktopServer seems to do the same (like I said, never used it), but focused on Wordpress. Local tries to go beyond that, creating ease on the configuration behind those environments. One thing I read on a topic here is that they are working to move away from VirtualBox, so those slow loads can come to an end at some point.
BTW try OPCache on Local to see if it helps anything!
Iāve recently tested Local vs. Laravel Valet a bit, and found that Local isnāt really that much slower anymore, if at all.
However, Iāve also seen instances where a site on a ārealā remote server felt quite a bit faster than Local on my MacBook Pro (which is the scenario described by @midihead7 above). This I find a bit hard to understand, especially when said remote server is a run-of-the-mill shared server, not some fancy VPS. Iām really looking forward to the VirtualBox-free Local and hope weāll get a nice performance boost, be it with 10 or with 70 active plugins.
Local already uses PHP-FPM in both the Preferred and Custom environments (even with Apache). Also, Zend OPcache is enabled for both environments.
With that said, there are most likely VM CPU/RAM or disk I/O bottlenecks. Hereās what you can try:
Close Local if itās running
Open VirtualBox
Right-click on local-by-flywheel and go to Settings
Go to System
Increase the Base Memory to 2GB
Go to Process
Bump up the CPU cores to 2 if possible
Make sure Faster Docker Volumes is enabled under Local Ā» Preferences Ā» Advanced. If itās already enabled, you can try disabling it and see what happens.
Finally, what environment is the site running in Local?
Speed up Word Press by Increasing the Memory allocated to run PHP by adding the following to the wp-config.php file:
/* -------------------------------------------------- /
/ CUSTOM SETTINGS FOR WP-CONFIG.PHP /
/ INCREASE PHP MEMORY TO 256 MB /
/ INSET AT FRONT OF THE WP-CONFIG.PHP file */
Also, checking what exactly makes things run slow might be interesting.
You could try running Debug Bar and Debug Bar Slow Actions, or P3 ā note however that it was not compatible with PHP 7+ when I last tried it.
I tried your suggestions but I see no improvement in performance. Disabling Faster Docker Volumes only made the site and WP admin load even slower. I did check my Activity Monitor and I see that the āVBoxHeadlessā process is using 100% or more of the CPU. Iāve seen the CPU usage get as high as 184.5% (see screenshot). As long as the site is running, I see this high usage. When I stop the site, CPU usage for this process drops to about 3.6%. I also see that the process āunfsdā uses a lot of CPU as well while Local is running. Shutting down Local appears to make the āunfsdā process stop running.
While youāre at it, it may be worth bumping up the RAM for the VM to 2GB by running VBoxManage modifyvm local-by-flywheel --memory 2048 right after step #5 in the FAQ I linked.
If the issue persists and the CPU usage of VBoxHeadless is high, can you run the following command and provide the output?
/Applications/Local\ by\ Flywheel.app/Contents/Resources/extraResources/virtual-machine/vendor/docker/osx/docker-machine ssh local-by-flywheel top
I donāt see that a solution was reached in the āMake HTTPS workā article you linked to. I donāt know how to SSH in and run the command in that article. If I run that command in Terminal, it returns the source code of my home page. I have the same slowness whether Iām running HTTP or HTTPS.
I already have the RAM for the VM set to 2GB.
If I run the last command you gave me in Terminal, I get the below (note that Iām still on the Preferred setup):
Mem: 876996K used, 1173160K free, 254744K shrd, 9800K buff, 530088K cached
CPU: 0.5% usr 3.5% sys 0.0% nic 94.7% idle 0.0% io 0.0% irq 1.1% sirq
Load average: 0.70 0.47 0.26 2/503 2545
PID PPID USER STAT VSZ %VSZ CPU %CPU COMMAND
2385 2009 docker D 383m 19.1 1 3.4 php-fpm: pool www
842 2 root SW< 0 0.0 1 1.3 [kworker/1:1H]
2015 2013 104 S 1261m 62.8 0 0.0 /usr/sbin/mysqld
1378 1 root S 513m 25.5 1 0.0 /usr/local/bin/dockerd -D -g /var/
1387 1378 root S 432m 21.5 1 0.0 docker-containerd -l unix:///var/r
11 2 root SW 0 0.0 1 0.0 [ksoftirqd/1]
155 2 root SW 0 0.0 0 0.0 [kworker/u4:29]
2052 2009 docker S 382m 19.0 0 0.0 php-fpm: pool www
2051 2009 docker S 378m 18.8 0 0.0 php-fpm: pool www
2009 1728 root S 294m 14.6 0 0.0 php-fpm: master process (/conf/php
2102 2008 root S 293m 14.6 0 0.0 varnishd -F -f /etc/varnish/defaul
1915 1387 root S 261m 13.0 0 0.0 docker-containerd-shim a00b7d7fe8e
1714 1387 root S 197m 9.8 1 0.0 docker-containerd-shim 61b5da67cc0
1290 1 root S 160m 7.9 0 0.0 VBoxService --disable-automount
2008 1728 root S 124m 6.1 0 0.0 varnishd -F -f /etc/varnish/defaul
1728 1714 root S 56888 2.7 0 0.0 {supervisord} /usr/bin/python /usr
2044 2011 docker S 43052 2.0 0 0.0 nginx: worker process
2011 1728 root S 42176 2.0 1 0.0 nginx: master process nginx -g dae
2013 1728 104 S 38740 1.8 1 0.0 {pidproxy} /usr/bin/python /usr/bi
1978 1929 docker S 32696 1.5 0 0.0 nginx: worker proc
I had previously changed the CPU cores from 1 to 2. FYI, my Mac has 4 cores. I just tried setting the VM CPU to 4 but for some reason the Plugins page ONLY still takes forever to load and periodically displays a Local Router Error message. The rest of the WP Admin links seems to be noticeably faster as far as speed but when I try to view or click on anything on the Plugins page, I have to wait 25 to 30 seconds every time and sometimes it errors out as I said.
UPDATE: I should note that I have 94 plugins installed, 74 of which are currently active. Pagination on the Plugins page was set to display all of the installed plugins on one page. I just dropped the pagination down to 10 or 20 per page and now the Plugins page loads faster than it did but still takes around 10 seconds to load (and about 5 seconds to load i Airplane Mode). Is this normal for the Pagination to have this kind of affect on load time in Local? My live siteās Plugins page loads quickly like the rest of the WP Admin dashboard does. Still, Local isnāt running as fast as I think it should locally.
See attached screenshots of my current VM settings.