New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very BAD Performance with Magento 2 on Mac OS X #2924

Closed
jleplomet opened this Issue Jan 7, 2016 · 32 comments

Comments

Projects
None yet
@jleplomet

jleplomet commented Jan 7, 2016

Hello

Im trying to figure out how to develop a custom theme with Magento 2 and its been a huge pain so far. I have developer mode set with

bin/magento deploy:mode:set developer

The problem is that Magento takes over a minute to load any page, its almost unusable. My system specs are

Mac OS X 10.11.2
Apache 2.4.16
PHP 5.6.16 - memory_limit: 2048M
MySQL 5.6

I installed PHP/MySQL locally to avoid the virtual setup but it seems the slow performance is about the same. Is there any tips to increase page load time when set to developer mode?

@alankent

This comment has been minimized.

Show comment
Hide comment
@alankent

alankent Jan 8, 2016

That is very strange. Could you send me a direct email at akent at magento dot com? We are getting some reports of wildly different performance - trying to track down the common factor. E.g. my first load of home page is under 10 seconds, second load is under 1. That does not line up with over a minute for every page.

alankent commented Jan 8, 2016

That is very strange. Could you send me a direct email at akent at magento dot com? We are getting some reports of wildly different performance - trying to track down the common factor. E.g. my first load of home page is under 10 seconds, second load is under 1. That does not line up with over a minute for every page.

@markoshust

This comment has been minimized.

Show comment
Hide comment
@markoshust

markoshust Jan 8, 2016

Contributor

@jleplomet are any files hosted on an external/third-party/remote volume disk? i've noticed this can dramatically slow down m2.

Contributor

markoshust commented Jan 8, 2016

@jleplomet are any files hosted on an external/third-party/remote volume disk? i've noticed this can dramatically slow down m2.

@Vinai

This comment has been minimized.

Show comment
Hide comment
@Vinai

Vinai Jan 8, 2016

Contributor

Have you disabled caching? What is the output of $ bin/magento cache:status?
Being used to working with (some) disabled caches on Magento 1, it was a change I had to learn to live with when developing with Magento 2. Caching should practically never be disabled.

Also, is xdebug installed in your php? You can see by running php -m | grep xdebug. If that outputs xdebug it is installed.
If so, make sure it is not enabled for every request automatically, but instead only on request.
In the PHP settings, the value for xdebug.remote_autostart has to be set to Off and xdebug.remote_mode should be req.

Contributor

Vinai commented Jan 8, 2016

Have you disabled caching? What is the output of $ bin/magento cache:status?
Being used to working with (some) disabled caches on Magento 1, it was a change I had to learn to live with when developing with Magento 2. Caching should practically never be disabled.

Also, is xdebug installed in your php? You can see by running php -m | grep xdebug. If that outputs xdebug it is installed.
If so, make sure it is not enabled for every request automatically, but instead only on request.
In the PHP settings, the value for xdebug.remote_autostart has to be set to Off and xdebug.remote_mode should be req.

@bartdelvaux

This comment has been minimized.

Show comment
Hide comment
@bartdelvaux

bartdelvaux Jan 8, 2016

Contributor

Some time ago, I was having the same issue. I could solve this by disabling the merging of Javascript and CSS.

In some cases, the generation of these files slows down the site.

Contributor

bartdelvaux commented Jan 8, 2016

Some time ago, I was having the same issue. I could solve this by disabling the merging of Javascript and CSS.

In some cases, the generation of these files slows down the site.

@ishakhsuvarov ishakhsuvarov added the TECH label Jan 8, 2016

@jleplomet

This comment has been minimized.

Show comment
Hide comment
@jleplomet

jleplomet Jan 8, 2016

I have all caches disabled for development of my theme. I have pinpointed the issue to be server side compilation of static assets. Its taking 30s-1min to finish and display the page. This happens both on frontend and admin side.

I am not using any external/third-party/remote volume disk. I have Apache, PHP/MySQL running directly on my iMac/Macbook SSD

xdebug is also installed but disabled on xdebug.remote_autostart

My solution is to enable all cache and have grunt compile less files. This seems to speed things up.

jleplomet commented Jan 8, 2016

I have all caches disabled for development of my theme. I have pinpointed the issue to be server side compilation of static assets. Its taking 30s-1min to finish and display the page. This happens both on frontend and admin side.

I am not using any external/third-party/remote volume disk. I have Apache, PHP/MySQL running directly on my iMac/Macbook SSD

xdebug is also installed but disabled on xdebug.remote_autostart

My solution is to enable all cache and have grunt compile less files. This seems to speed things up.

@rkhoury82

This comment has been minimized.

Show comment
Hide comment
@rkhoury82

rkhoury82 Jan 12, 2016

I also had the same issue, the solution was the same as @bartdelvaux - disable the merging of JS and CSS.

rkhoury82 commented Jan 12, 2016

I also had the same issue, the solution was the same as @bartdelvaux - disable the merging of JS and CSS.

@markoshust

This comment has been minimized.

Show comment
Hide comment
@markoshust

markoshust Jan 12, 2016

Contributor

@rkhoury82 this is odd, because from my experience, merging JS doesn't have any change on output? #2925

Contributor

markoshust commented Jan 12, 2016

@rkhoury82 this is odd, because from my experience, merging JS doesn't have any change on output? #2925

@jleplomet

This comment has been minimized.

Show comment
Hide comment
@jleplomet

jleplomet Jan 13, 2016

Any update to this? I cant edit layout xml files without disabling cache and therefore back at 30sec-1min page load.

jleplomet commented Jan 13, 2016

Any update to this? I cant edit layout xml files without disabling cache and therefore back at 30sec-1min page load.

@alankent

This comment has been minimized.

Show comment
Hide comment
@alankent

alankent Jan 13, 2016

Hi @jleplomet - which of the approaches other people have suggested have you tried? And did you send me an email as I requested? Sorry if I missed it.

Grunt is certainly the fastest approach. But it is not clear from your report how slow it is still going, and what you are doing that makes it slower than for other people. (I am not saying it is not slower, only there is not much information to work on.) Not everyone is having the same slow down as you, so 1 minute page loads is not a generic problem. So we have to work out what is different in your circumstance.

I was working with someone else - their machine was going a lot slower than expected. Never worked out why, but different people running exactly the same code were having different performance. Very hard to diagnose, but almost felt like maybe different anti-virus software or other background jobs could be kicking in (or machine thrashing etc). I was going to try the same experiments with you to try and see if we could identify the cause of the radically different results. The other person I worked with ended up with inconclusive results.

One area that has been reported to have a big impact is the number of locales. Are you developing a theme with multiple locales? If so, could you try again with a single locale and compare the speed difference.

If you have time, please send me a direct email as above - I have a Docker image I would like you to try which would guarantee identical software versions etc. I am hoping this can help identify the problem.

alankent commented Jan 13, 2016

Hi @jleplomet - which of the approaches other people have suggested have you tried? And did you send me an email as I requested? Sorry if I missed it.

Grunt is certainly the fastest approach. But it is not clear from your report how slow it is still going, and what you are doing that makes it slower than for other people. (I am not saying it is not slower, only there is not much information to work on.) Not everyone is having the same slow down as you, so 1 minute page loads is not a generic problem. So we have to work out what is different in your circumstance.

I was working with someone else - their machine was going a lot slower than expected. Never worked out why, but different people running exactly the same code were having different performance. Very hard to diagnose, but almost felt like maybe different anti-virus software or other background jobs could be kicking in (or machine thrashing etc). I was going to try the same experiments with you to try and see if we could identify the cause of the radically different results. The other person I worked with ended up with inconclusive results.

One area that has been reported to have a big impact is the number of locales. Are you developing a theme with multiple locales? If so, could you try again with a single locale and compare the speed difference.

If you have time, please send me a direct email as above - I have a Docker image I would like you to try which would guarantee identical software versions etc. I am hoping this can help identify the problem.

@markoshust

This comment has been minimized.

Show comment
Hide comment
@markoshust

markoshust Jan 14, 2016

Contributor

@alankent i think i have replicated this consistently with my docker images when js merging (& bundling) is turned on. i'll confirm shortly.

Contributor

markoshust commented Jan 14, 2016

@alankent i think i have replicated this consistently with my docker images when js merging (& bundling) is turned on. i'll confirm shortly.

@alankent

This comment has been minimized.

Show comment
Hide comment
@alankent

alankent Jan 14, 2016

Thanks @markoshust. I guess the next question is during development, is there any need to have JS merging turned on? I would have said no, that is a production setting. Seem reasonable?

alankent commented Jan 14, 2016

Thanks @markoshust. I guess the next question is during development, is there any need to have JS merging turned on? I would have said no, that is a production setting. Seem reasonable?

@markoshust

This comment has been minimized.

Show comment
Hide comment
@markoshust

markoshust Jan 14, 2016

Contributor

Yes, to be able to test in same environment as staging + production. I don't think this ticket is mac-related.

Contributor

markoshust commented Jan 14, 2016

Yes, to be able to test in same environment as staging + production. I don't think this ticket is mac-related.

@jleplomet

This comment has been minimized.

Show comment
Hide comment
@jleplomet

jleplomet Jan 14, 2016

Just want to note that I do have merging turned off. My issue is mostly related to the server generating less files, and processing theme files when caching is turned of during theme development. I'm trying to edit layout files, less files, and template files.

jleplomet commented Jan 14, 2016

Just want to note that I do have merging turned off. My issue is mostly related to the server generating less files, and processing theme files when caching is turned of during theme development. I'm trying to edit layout files, less files, and template files.

@markoshust

This comment has been minimized.

Show comment
Hide comment
@markoshust

markoshust Jan 14, 2016

Contributor

@jleplomet your initial ticket was in regards to page load time, not dev building

| The problem is that Magento takes over a minute to load any page,

Contributor

markoshust commented Jan 14, 2016

@jleplomet your initial ticket was in regards to page load time, not dev building

| The problem is that Magento takes over a minute to load any page,

@jleplomet

This comment has been minimized.

Show comment
Hide comment
@jleplomet

jleplomet Feb 23, 2016

@markoshust Yes that is correct.

I have noticed that due to server generation of files, this slows down Magento to load on any page.

What is the ideal setup/settings to run Magento 2 while developing custom themes on a local install of Apache/PHP/MySQL?

jleplomet commented Feb 23, 2016

@markoshust Yes that is correct.

I have noticed that due to server generation of files, this slows down Magento to load on any page.

What is the ideal setup/settings to run Magento 2 while developing custom themes on a local install of Apache/PHP/MySQL?

@jk2081

This comment has been minimized.

Show comment
Hide comment
@jk2081

jk2081 Feb 29, 2016

@jleplomet I would be curious to know what setup/settings you are using and if you've found an answer to your question.

jk2081 commented Feb 29, 2016

@jleplomet I would be curious to know what setup/settings you are using and if you've found an answer to your question.

@gazjoy

This comment has been minimized.

Show comment
Hide comment
@gazjoy

gazjoy Mar 4, 2016

+1 I also have this problem on my Mac.

gazjoy commented Mar 4, 2016

+1 I also have this problem on my Mac.

@crantron

This comment has been minimized.

Show comment
Hide comment
@crantron

crantron commented Mar 31, 2016

same

@JDavidVR

This comment has been minimized.

Show comment
Hide comment
@JDavidVR

JDavidVR Apr 8, 2016

Contributor

I'm havign performace problem too, when I enable profiler, loading magento takes like 35 secs, matching the routes another 15 sec, laoding layout 20 secs.

Is there any aditional configuration?

I'm using php 5.6.11, mysql 5.6.25, apache 2.4.17

Contributor

JDavidVR commented Apr 8, 2016

I'm havign performace problem too, when I enable profiler, loading magento takes like 35 secs, matching the routes another 15 sec, laoding layout 20 secs.

Is there any aditional configuration?

I'm using php 5.6.11, mysql 5.6.25, apache 2.4.17

@jhon-MT

This comment has been minimized.

Show comment
Hide comment
@jhon-MT

jhon-MT Apr 8, 2016

+1 any tips are welcomed.. same configurations.. just on a LAMP environment

jhon-MT commented Apr 8, 2016

+1 any tips are welcomed.. same configurations.. just on a LAMP environment

@alankent

This comment has been minimized.

Show comment
Hide comment
@alankent

alankent Apr 8, 2016

For Less files, I strongly recommend looking at Gulp - e.g. https://github.com/SnowdogApps/magento2-frontools. Much faster. I have a few different development approaches listed at http://alankent.me/gsd which have different pros and cons. We are looking to reduce this to "one approach to rule them all" (also known as a "default recommendation").

alankent commented Apr 8, 2016

For Less files, I strongly recommend looking at Gulp - e.g. https://github.com/SnowdogApps/magento2-frontools. Much faster. I have a few different development approaches listed at http://alankent.me/gsd which have different pros and cons. We are looking to reduce this to "one approach to rule them all" (also known as a "default recommendation").

@MikaRinneAmbientia

This comment has been minimized.

Show comment
Hide comment
@MikaRinneAmbientia

MikaRinneAmbientia May 2, 2016

Experiencing the same. Comparing to Magento 1 on the same machine very slow (Magento 1 running on nginx, Magento 2 on apache not at the same time, though). Haven't touched any configs yet basically, development mode is enabled I think as: SetEnv MAGE_MODE developer

MikaRinneAmbientia commented May 2, 2016

Experiencing the same. Comparing to Magento 1 on the same machine very slow (Magento 1 running on nginx, Magento 2 on apache not at the same time, though). Haven't touched any configs yet basically, development mode is enabled I think as: SetEnv MAGE_MODE developer

@markoshust

This comment has been minimized.

Show comment
Hide comment
@markoshust

markoshust May 2, 2016

Contributor

I think this ticket should be closed. Mac OS X isn't listed as supported platforms of M2:
http://devdocs.magento.com/guides/v2.0/install-gde/system-requirements.html

Contributor

markoshust commented May 2, 2016

I think this ticket should be closed. Mac OS X isn't listed as supported platforms of M2:
http://devdocs.magento.com/guides/v2.0/install-gde/system-requirements.html

@hshar7

This comment has been minimized.

Show comment
Hide comment
@hshar7

hshar7 May 2, 2016

Contributor

Exactly @markoshust that's why you should give this a try: https://github.com/paliarush/magento2-vagrant-for-developers
This will allow you to develop on an OS supported by Magento without leaving the comfort of your own OS. However, I also use a LAMP stack on my mac using Macports which seems to be fast and reliable but this vagrant setup works on most systems.

Contributor

hshar7 commented May 2, 2016

Exactly @markoshust that's why you should give this a try: https://github.com/paliarush/magento2-vagrant-for-developers
This will allow you to develop on an OS supported by Magento without leaving the comfort of your own OS. However, I also use a LAMP stack on my mac using Macports which seems to be fast and reliable but this vagrant setup works on most systems.

@hshar7 hshar7 closed this May 2, 2016

@MikaRinneAmbientia

This comment has been minimized.

Show comment
Hide comment
@MikaRinneAmbientia

MikaRinneAmbientia May 2, 2016

Yes, I can try vagrant next. But happy to say it works on OSX.

MikaRinneAmbientia commented May 2, 2016

Yes, I can try vagrant next. But happy to say it works on OSX.

@MikaRinneAmbientia

This comment has been minimized.

Show comment
Hide comment
@MikaRinneAmbientia

MikaRinneAmbientia May 3, 2016

I know this is closed, my apologizies for posting, but I did a "clean" composer install without sample data on OSX, it feels faster now. Also added local server name ::1 to etc/hosts not sure if has an affect but it was advised around.

MikaRinneAmbientia commented May 3, 2016

I know this is closed, my apologizies for posting, but I did a "clean" composer install without sample data on OSX, it feels faster now. Also added local server name ::1 to etc/hosts not sure if has an affect but it was advised around.

@rehoehle

This comment has been minimized.

Show comment
Hide comment
@rehoehle

rehoehle Jun 28, 2017

With MAMP it takes 30 seconds for every page load and thats very annoying. Is there a solution to fix the performance?

rehoehle commented Jun 28, 2017

With MAMP it takes 30 seconds for every page load and thats very annoying. Is there a solution to fix the performance?

@markoshust

This comment has been minimized.

Show comment
Hide comment
@markoshust

markoshust Jun 29, 2017

Contributor

make sure you have opcache installed. noticed a huge performance increase with m2 with my docker images + opcache.

Contributor

markoshust commented Jun 29, 2017

make sure you have opcache installed. noticed a huge performance increase with m2 with my docker images + opcache.

@jefflenz

This comment has been minimized.

Show comment
Hide comment
@jefflenz

jefflenz Feb 23, 2018

Make sure you have config cache enabled (at the very least) because every asset (image/js/css) is parsed by magento, so each and every request for an asset has to load up magento individually.

jefflenz commented Feb 23, 2018

Make sure you have config cache enabled (at the very least) because every asset (image/js/css) is parsed by magento, so each and every request for an asset has to load up magento individually.

@reillo

This comment has been minimized.

Show comment
Hide comment
@reillo

reillo Jun 5, 2018

I am also developing in mac and it was very slow. Disabling JS/Css merging makes it faster.

reillo commented Jun 5, 2018

I am also developing in mac and it was very slow. Disabling JS/Css merging makes it faster.

@nidheesh-eglobeits

This comment has been minimized.

Show comment
Hide comment
@nidheesh-eglobeits

nidheesh-eglobeits Aug 27, 2018

Check whether OPCache is enabled. I had the same issue when using docker and enabling OpCache solved this.

nidheesh-eglobeits commented Aug 27, 2018

Check whether OPCache is enabled. I had the same issue when using docker and enabling OpCache solved this.

@zepgram

This comment has been minimized.

Show comment
Hide comment
@zepgram

zepgram Sep 10, 2018

I made this vagrant which allow you to customize mount options and has great performance:

  • nfs mount or regular mount
  • directory mount /var/www/magento/app or whole project /var/www/magento

https://github.com/zepgram/magento2-fast-vm

You can work on a fast magento installation and adapt parameters depending on your work practice and your host machine perf.

For example, if your host machine doesn't support NFS option and has bad performance you can mount only app directory which is enough for development.

zepgram commented Sep 10, 2018

I made this vagrant which allow you to customize mount options and has great performance:

  • nfs mount or regular mount
  • directory mount /var/www/magento/app or whole project /var/www/magento

https://github.com/zepgram/magento2-fast-vm

You can work on a fast magento installation and adapt parameters depending on your work practice and your host machine perf.

For example, if your host machine doesn't support NFS option and has bad performance you can mount only app directory which is enough for development.

magento-team pushed a commit that referenced this issue Sep 18, 2018

Merge pull request #2924 from magento-qwerty/2.2.6-bugfixes-250718
Fixed issues:
- MAGETWO-92175: [Backport for 2.2.x] Wrong product grid behavior in admin panel
- MAGETWO-72051: [Backport for 2.2.x] Wrong file upload behavior
- MAGETWO-88658: [Backport for 2.2.x] Incorrect category attributes displaying
- MAGETWO-93272: [Backport for 2.2.x] Product Video feature not GDPR compliant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment