-
Notifications
You must be signed in to change notification settings - Fork 9.3k
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Magento 2 running very slow on local envirement #2999
Comments
Got the same issue, installed a VM with kubuntu for work, and it is too slow, disabled cache of magento 2 as well. |
For linux enviroment i think it work faster than in window. Try to use minify js css or merge theme to one line for better performance. You should try varnish for cache instead default |
Magento MUST be fast! At the moment, it is just impossible to develop on Magento without keep caches enabled. |
For now, using Grunt is the fastest UI development approach. If you google "grunt magento 2" multiple blog posts come up. There is also our documentation at http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/css-guide/css_quick_guide_mode.html#server-side-grunt if you have not seen it. |
Reading back on this thread I am not sure if original question was for development vs production. I think some suggestions are good for development, other for production. Varnish is good for production. Grunt is best available for development if you are talking about CSS/Less etc. |
Ok, for theme customization, and for use of the CSS/Less the best way is by using Grunt? @alankent, i have a VM with a kubuntu ambient configured, so i have to install node.js too, if i follow the documentation of the devdocs.magento.com, am i right? |
We try not to dictate tools for developers, but the answer to the most responsive "edit, test" cycle for CSS today that Magento provides is Grunt. If the community finds a better way, cool! |
thanks! @alankent |
Hi All I have create this issue for development environment. When We disabled cache and and doing changes then magento works very slow . |
I've noticed a few of these "slow" issues, so I'm unsure which to comment on. I'm using this one since it specifically says "local environment" since that best matches our situation. I'm running Magento 2 using a local Docker VM with the memory set to 2048MB. Even with caching enabled, it would take several minutes to load the default homepage with a fresh install. Others on my team also tried with the same results. I'm using the Docker Image from Chadrien as my base image. I changed the php.ini-developement values to:
We're currently using AWS EC2 instances to bypass this using the same Docker configuration, but it isn't ideal. Let me know any information I can provide to help troubleshoot this. Thanks! |
Could you do me a favor and try the alankent/gsd Docker image and time how long the home page takes to load. (I am more familiar with this image.) Then please let me know how many seconds it took to load and the hardware spec you are running on, thx! |
Thanks for your prompt reply @alankent! I used that image and it's significantly faster, or "normal speed". I don't see a Dockerfile on the Docker Hub page. Can you send it to me so I can compare? Thanks! |
Interesting. My Dockefile is a bit of a hack job at present, and does things like preload Luma - good for play, not good for building a new site. I am travelling at present, so here are some snippets from the Dockerfile that I can get to you quickly as a point of comparison - I will try to make something cleaner if needed, but that will have to wait until after my current trip ends. Oh, and have you tried https://github.com/mageinferno/ ? That might be your easiest solution. Oh, and check XDEBUG is off - that slows things down a lot. I have not tested (sneaking a few mins in), but here are the relevant bits I think from my Dockerfile. Dockerfile
php.ihi
apache_default_vhost
magento2-install.sh
apache2.conf (I think I just took default one and changed home directory to /magento2, so probably don't need this.)
|
Thanks again @alankent for your prompt reply! The two major differences are the PHP version and database. I'll go through yours and Mage Inferno to see if anything stands out and let you know. |
@alankent - After some testing, I found out that if I leave the Magento files in the container, and then only mount the folders I need from my machine, I can get it down to 18 seconds vs 5+ minutes. It's still not ideal, but way better than it was. Before I had the Magento files on my machine. I hope that makes sense. If you have any additional suggestions, do let me know! Thanks! |
@aaronsturm Yes, its the "vboxfs" in Virtual box that is a dog. I mount a subset like you say (but it rules out grunt/gulp file watching), or use fswatch/WinSCP-keep-up-to-date to copy inside the container, or more recently NFS/CIFS mount the drive via Samba (latest variation). http://alankent.me/gsd lists a few options I have tried. |
Ok, I'll look into those. I didn't have these issues with Magento 1. I know it's different, just letting you know for a comparison. |
I suspect (I should go measure it) that M2 has more smaller files. Larger coarse grain files made it hard to decouple modules, which in turn makes upgrades a bigger effort in M1. That is where extension conflicts etc come from. M2 with one module per package sometimes means you have to get configuration from lots of locations on disk during development (we merge the smaller files in production mode for speed). Thus M2 is impacted more during development by the slow vboxfs file system. (This is an educated theory by the way, I have not actually measured it.) Lots of people on lots of projects have complained about vboxfs performance, but Oracle has not fixed it in the free Virtual box product to date. |
👍 That makes sense, and I appreciate your educated theory. Hopefully with the upcoming native Docker client this won't be an issue any more (no more VirtualBox!). I'm going to call this "fixed" on my end. |
@alankent do you believe its a good idea to use gulp instead grunt on M2? |
Both work, but gulp appears to be a bit faster (at the moment - I heard Grunt was adding support for pipelines as well which may catch up with Gulp). |
I am having long load times on development as well (page load times from 30s - 1min) running locally on OSX. I'm not sure why, but stopping the event clean_cache_by_tags from firing on any given page decreased the page load time to 5s on average. This is with all caches disabled. |
It is extremely slow on my vagrant despite having a $8000 computer and devoting lots of resources to my vagrant and php. Of course every time this question is asked people assume its for live and tell them to enable caching but this does not help while developing/theming. Infact magneto 1 is much faster on my local vagrant at work on a much worse computer to develop in. Its just impossible. |
@alankent I'm sorry did you mention a solution for this yet? Should I be using docker instead of vagrant? I am on OSX btw. and yes already using gulp its php that is slow I think. I have everything at high settings. I am very excited for magento 2, and I am very happy that it is way more modern now in workflow however the frontend development is painfully slow, I spend days and get nothing done because I am still warming up to it but I am getting very worried I will not be able to complete any of the 5 magento 2 jobs we have on the books now. |
Hi, Maybe you can try turning on PHP Opcache and see if it helps. |
how do you enable the Opcache. Sorry im new to this |
I'm closing this ticket as the GitHub issue tracker is intended for technical issues only. And this one transformed to some kind of discussion. Please transfer the discussion to the Community Forums. If you have any specific issues please create a new ticket formatting it according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result. If you have any questions which do not relate to some kind of issue in Magento, please refer to the Community Forums or the Magento Stack Exchange site for technical questions. |
Partial disable cache. |
@theskillwithin it helped me. |
Magento 2 is not slow. Now you can make it fast following these steps. |
On this occasion I did not use Vagrant and the docker dev box is not available for download so I'm running magento in Xammp. I experienced a very slow website until I enable opcache which has improved the speed significantly. https://codingtrabla.blogspot.com/2016/06/xampp-5621-enable-opcache.html |
XAMMP/WAMP must not be used at all as Windows OS is not supported and there are known issues. There are quite many options nowadays to have some Ubuntu VM for development with WIndows as a host OS only. |
On windows i use Bitnami. |
Same situation as #1726 (comment). Such kind of issue, especially related to unsupported OS, are out of scope for this repo. |
Hi
I am using magento 2 and found admin , frontend loading is very slow after disable cache . Additionally jQuery is not working in default luma theme for custom features .
The text was updated successfully, but these errors were encountered: