Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I recently started developing on magento2 new extensions or customizations, and my first impression was a nightmare. I have to wait about 20-30s for every change I make? really?

I'm talking about development mode, I know that in production with cache enabled and other things the website can be smooth. But when I'm working with an extension or layout problem I need to be removing static files, clearing cache, etc.

My question is, how you all M2 developers work? because I don't believe you have to wait 20s-30s for refreshing the page...

My environment: My pc is "good" i5 with 8gb RAM. I need to work with Windows so I use vagrant:

  • Use of all 4 cores CPU
  • Use 5120MB of RAM
  • Ubuntu/trusty64 - Ubuntu 14.04
  • PHP Version 7.0.12-1+deb.sury.org~trusty+1
  • MariaDB - 10.1.18-MariaDB-1~trusty
  • Magento 2.1.2 is installed only with sampledata (no more modules are installed)
  • (Ask me if you wanna know sth more)

What is happenning exactly? Usually M2 responds okay, slow but okay, about 5-10s to load the pages, but sometimes (more usually than sometimes) it just stucks forever! sometimes is the first page and sometimes are the css,js,html files but always the problem is with TTFB.

I saw a problem going to setup wizard too... with angular.js these files lasts forever...

These 2 pictures are about navigating inside setup wizard.

http://imgur.com/Izoyuhj http://imgur.com/Vs5q8eT

Then another one navigating on frontend catalog: http://imgur.com/oXYC52D

What am I asking exactly? Is this normal? you guys work with this timing? I commented this with some colleagues and we just don't believe, I have to be working like this? I sometimes despair of waiting all the time watching the screen...

If someone asks me for show him a test, like creating a new product or something like that he just freaks out... Creating a new order, filling the fields and every field executes a js that lasts for 5-6s...

I don't know but I feel so bad developing with this stuff...

share|improve this question
    
Haven't had the chance to play with magento 2: but id assume that most of the performance issues comes from your vagrant environment. Do you use virtualbox with vagrant or something else. Using multiple cores with virtualbox degrades performance. Do you run the magento from a shared folder on the vagrant > magento writes files back to the same share you get performance issues. – FinBoWa Oct 18 '16 at 12:03
    
Also you also might be running out of memory on your system what leads to using swap on the host if you give the vagrant 5gigs. only increase the amount if you actually need it. – FinBoWa Oct 18 '16 at 12:08
    
A big part of your problem is that you are on Windows. I was on Windows for years and it was super slow with vagrant/magento. This is because of the file synching mode, its not up to par with nfs. I started dual booting into Ubuntu desktop and my magento sites were very fast, then a while later I got a mac, which uses NFS, and it is also very fast. – Shawn Abramson Oct 18 '16 at 13:04
    
Yes, it's vagrant with virtualbox. Why using more cores have to degrade performance? I assume giving all resources to VM may be slow "my pc" but faster my VM... And the folder I'm using is /var/www (I tried to not use shared folder, it's only "linux" what is running now). How can I see what is failing? I can execute top, or commands like that.... but don't know how to interpret... – slayerbleast Oct 18 '16 at 13:08
    
@ShawnAbramson Yep... we suggested to install dual boot just to try it because as I said we don't believe M2 developers are working like I'm currently doing hehe... – slayerbleast Oct 18 '16 at 13:48

Turn on your cache.

Go to <your magento 2 directory>/bin and run this command magento cache:enable.

Clean the cache when you edit the frontend to see what you've edited.

Go to <your magento 2 directory>/bin and run this command magento cache:clean.

My Reference

I'm new to magento 2 too. I hope someone has a way to make magento 2 fast even when the cache is disabled.

share|improve this answer
    
Don't know if this is a viable solution... Everywhere it says to disable cache on development mode... – slayerbleast Oct 18 '16 at 13:55
    
Of course if I enable cache, site will go faster... but every change I will have to clean the cache... still a waste of time I think... – slayerbleast Oct 18 '16 at 13:57

disable CSS/JS merging and minifying:

Stores > Configuration > CSS Settings (Javascript Settings) > Merge CSS (Merge JS) > NO

Stores > Configuration > CSS Settings (Javascript Settings) > Minify CSS (Minify JS) > NO
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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