4

I'm aware this might not fall strictly into the stack exchange rules, however there seems to be growing frustration within the magento 2 world of development, but somewhere needs to try help people as the magento team are always shutting down tickets regarding performance.

--

This question is not about performance on production servers, so please no recommendations for things like varnish, redis, minifying/concatenating files etc.

--

What have people found to be the most optimal setups for having a fast streamlined magento 2.2+ development environment, for both Windows and OSX.

Keeping in mind the following

  • Docker
  • Vagrant
  • Mamp/Wamp
  • Native binaries with apache/nginx
  • Grunt/Asset generation performance
  • Postgres, MySQL, Maria etc

--

Personally we've found they've all been slow in the ways we've attempted, including using Laravel Valet, Vagrant, OSX apache/php-fcgi - and they're all terrible.

--

What have others found to be good setups as certain users seem to think we all must just be doing it wrong, without shedding any light onto their solutions.

  • What is the question? Why not use linux if speed is what you want? – vitoriodachef Mar 5 '18 at 16:26
  • This is really up for the developer to choose what env to use ... but in some cases we want dev environment to be exactly the same as prod therefore its easier to use docker or vagrant. I personally find it more productive to use nginx, fpm redis and varnish in dev. – André Ferraz Mar 5 '18 at 16:27
  • Docker in OSX doesn't work that well because you need docker-sync and docker-sync is slow :/ – André Ferraz Mar 5 '18 at 16:28
  • @vitoriodachef the question is about finding out what people have found to be a successful development environment for magento 2 which is what the chap below has done – Owen Mar 5 '18 at 17:11
  • @AndréFerraz please, explain me what is effect of using varnish for dev env? I have cache disabled all time... Why should I use varnish? Thanks – Stepan Furman Mar 5 '18 at 17:26
1

My solution is migrating to Linux without virtualization.

Equip:

  • ProBook 470 G0
  • i5 3230 IvyBridge (quite powerful but outdated)
  • RAM 12GB (8+4)
  • Kingston SSDNOW v300 120GB (for OS and servers) + HDD 500 (no matter in this case)

Env:

  • Ubuntu 16.04
  • Mysql or MariaDb or Percona
  • PHP-FPM 7.1
  • XDebug 2.6
  • PHPSTORM 17.3

Results (reloading homepage)

Preconditions:

  • Magento CE 2.2.3 with sample data
  • no custom modules
  • cache disabled
  • after static content deploy -f

with xdebug enabled ~10 seconds

with xdebug disabled ~7 seconds

And this is 3 times faster than it was on windows.

P.S. I'm not sure this is the best solution, but I feel much better after doing that. I also was wondered that nginx allows to run different php-fpm-es depending on hosts settings. this is really cool. Now I even don't need to switch between PHP versions.

  • Have you found that the different database systems make much difference regarding performance? or they all pretty much identical? But your feedback is appreciated, hopefully we can get more answers like this to help people find potential solutions to their development environment issues – Owen Mar 5 '18 at 17:19
  • I didn't test it properly, but I don't think there is some valuable performance increase. This dbms-s is pretty similar and even if some of them have an advantages we will not feel this on magento with sample data – Stepan Furman Mar 5 '18 at 17:24
  • why we all need to know this??? there is absolutely no useful information in your answer... – MagenX Mar 6 '18 at 16:19
  • @MagenX What exactly? – Stepan Furman Mar 6 '18 at 16:21
  • 1
    @MagenX this reply does contain useful information, it contains benchmarks against hardware specs 0- so others can gauge what they can expect – Owen Mar 7 '18 at 16:49
0

As far as the front-end development is concerned, it's best to use a plain css file and link it in:

app/design/frontend/vendor/theme/Magento_Theme/layout/default_head_blocks.xml

e.g. <css src="css/my.css"/>

You would then have that file in the app/design/frontend/vendor/theme/web/css folder.

The advantage with this approach is rapid prototyping without the need to ever flush the cache or wait for the LESS files to process or worry about the zombie remnants that sometimes survive in the pub folder.

A simple CMD+Shift+R in Chrome always shows the change instantaneously vs. waiting for 20+ seconds with each LESS change.

We've been able to trim down a week's worth of development to less than two days developing this way!

0

Concerning vagrant, best way to get great performance with M2 is to mount only app directory. You can also mount whole magento directory but your host machine must be very effective and NFS mount must enabled between guest and host machine.

I did a simple vagrant, give it a try: https://github.com/zepgram/magento2-fast-vm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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