10

After installing, my magento2 is extremely slow thought I did not install sample data?

I am working on magento community 2.0.1

I created virtual box with 2GB Ram & 2Gb Swap.

I just want to note: All cache are enabled by default after setting up magento.

  • It is because of m2 has too many files and vagrant mount the folder using NFS that was very slow in reading file. I copied (rsync to /home/vagrant/htdocs) all files into linux virtual machine instead of placing source files at mounted folder (/vagrant/htdocs), it worked well, speed is nearly m1. I hope this helps you guys to fix the same issue. – phanvugiap Oct 22 '16 at 17:06
6

I see other guys also have faced the same problem (https://github.com/magento/magento2/issues/3123).

Actually, magento 2 default mode and developer mode are very slow. According to @tecjam, we can improve speed if we are on product mode. But with other modes it's still slow.

Please try to this commandline in magento2 directory :

php bin/magento setup:static-content:deploy

With all caches are enabled and static contents are deployed, it might improve speed of site.

  • 1
    Please note that the static-content is not used if you are not in production mode. Changing to production mode using the command below will actually deploy the static-content for you as well, hence I didn't include that command it in my answer. – tecjam Feb 2 '16 at 13:53
3

First check which deploy mode you are running:

php bin/magento deploy:mode:show

if in developer all files will be generated on each page load. To speed it up,

php bin/magento deploy:mode:set production

this should also recompile the files for you

  • 1
    those commands are run in a terminal or command prompt right? So for example on Windows, I would CD into the php/bin/php.exe folder and run those commands? – NuWin Sep 1 '16 at 6:13
  • 2
    Under windows it would make sense to add the path to your php.exe to your Environment Variables. That way you can simply use php ... in your cmd without having to specify the path every time. Please see this following link on how this is done: willj.co/2012/10/run-wamp-php-windows-7-command-line – tecjam Sep 1 '16 at 9:50
  • Thanks. I was thinking of adding a path as well. I asked because I installed a Bitnami Magento stack and for some reason the php/bin folder does not have php.exe. I guess I will install a WAMP and install Magento manually. – NuWin Sep 1 '16 at 17:56
  • @tecjam ...can you please explain in steps? My magento2 installation is in D:\php\htdocs\MG\m2. and using xampp on windows. Looking for response. – Jai Nov 21 '16 at 12:06
  • @Jai: First make sure you can execute php from the command line, cmd or terminal. Then open cmd, browse to your magento directory D:\php\htdocs\MG\m2 and simply enter the commands above, setting the correct deploy mode. Then deploy the static content. Read more about deployment modes here: devdocs.magento.com/guides/v2.0/config-guide/bootstrap/… – tecjam Nov 21 '16 at 12:30
2

Disabling JS and CSS merging while developing helps:

Stores > Configuration > Advanced > JavaScript Settings / CSS Settings

You can also enable caching for the things you are not currently changing.

0

I have seen a lot of people have issues with the speed of Magento 2. Well, Magento 2 is not slow by default. I have produced a tutorial to make Magento 2 fast in which I have described some steps which are:

  1. First, ensure that the server and system requirements are accurate.

  2. Update the Magento version with the latest version.

  3. Enabling Cache

  4. Resolve read speed of the database by enabling Flat Catalog.

  5. Image Optimization

  6. Optimization of Javascript and CSS.

  7. To speed Magento, setup CDN.

  8. Always try to use light weight theme.

  9. Make sure that all the extensions on your store are bugs free.

-1

Adding to the answers:

Increasing PHP memory_limit in php.ini file will make good difference. However it won't make it very very smooth(Although it will save time).

The default value is 512M. On my local machine I set this at "-1"(unlimited) and it gives better loading time.

Magento is heavy and needs high performance hardware like SSD to be smooth :(

  • memory_limit has no relation to performance whatsoever. It's obvious from the name of the directive. – Danila Vershinin Mar 15 '17 at 6:39

protected by philwinkle Jul 5 '16 at 19:37

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.