Magento – New Magento 2 install very slow on both Windows and Ubuntu

developmentmagento2windows

I installed Magento 2.0.4 (composer) on Windows 10. Pages take up to 10 seconds or more to load.
I tried several solutions published here to speed up the loading process on WAMP environments but none of them worked.

Then I set up an Ubuntu virtual machine (on Windows 10 host) to check whether the issue was caused by Windows. I installed Magento 2.0.4 again on this virtual machine and the result is the same: 10 seconds to load pages.

Processes summary:

Windows – when loading a page the Apache process uses up to 50% CPU. I noticed that two apache process are running. However only one seems active (50%) when the page loads, the other one is at 0%.

Ubuntu – when loading a page the only 2 process showing activity are firefox 5% and gnome-shell up to 30%, however in the "Resources tab" the CPU usage goes to 100% and stays there until the page is fully loaded, then goes down to normal levels (15% – 20%).

I'm developing a new theme so I delete pub/static/ and var/view_preprocessed folders on a regular basis to see my changes. Just after deleting this folders, the loading time is 10 seconds or more (i think because of the recompiling process). Subsequent loading of pages takes a little less (6 – 8 seconds).

I've tested enabling/disabling cache but that makes no difference.

Best Answer

That's just the way it is unfortunately to a large extent. There's a lot of processes there when loading without the cache that do all the hard work of building dynamic classes so you don't have to.

Is your database local or external? That could be causing a slowdown if it's the latter, but a lot will be the process of rebuilding the different files needed.

With the cache disabled it takes around 5/6 seconds for loading for me, but with cache enabled it is significantly quicker. Something's not quite right if the load times are the same for you with or without the cache enabled.