Too many articles on Magento 2 Performance, lots of debate, and as always its subjective. I remember on Magento 1.x when I was training my colleague Genevieve in Perth (2010) on what I thought was a powerful IBM laptop – within 3 weeks it was thrown out of the window and I invested in a 2K MacBook Pro. Magento needs some sauce to run, it always has.
On Magento 2 definitely seems harder, so I want to just break it down.
Okay enough talk. I should say all the info here is taken from me reading online, i.e. taking other ideas. I’m not pretending to be the performance expert, I just want somewhere to write down how I have it configured in the hope it helps others in my team and outside.
What I care about
I care about a couple of things:
- Speed when developing
- Speed for demos
Thats what I’m covering here. Demos can be near production mode but at WebShopApps/ShipperHQ we run over 80 demos, we don’t want to be having to do major tuning here, setting up redis, etc etc, we just want out of the box that works and is fast.
For development I get bored very very quickly. So if that browser is not responding I’m off doing something else.
Well apparantly Mac OSX isn’t supported according to some! Looking around any Magento conf the past few years there were a lot of mac users and I’m pretty sure they werent all running Vagrant. Installation needs to be sorted, we tried out docker but right now its just too slow and the whole persistent db/file thing is just plain confusing for our staff, I’m in favor of simple. So we are running a local PHP/Apache/mySQL stack installed via Mac Ports. I would have thought it would be fastest/simplest.
Installed Magento via composer.
There is a ton of caching going on in Magento 2 (Big full stop). I’m not covering all here, plenty of articles on this.
- Vinai says run with caching in admin switch ON. V. diff stance to M1.x
- XDebug – If enabled then ensure
remote_mode=req(on mine it is by default, I’ve not set)
- OpCache –
This seems to be Magento’s way of helping you out. I’m confused tbh and have seen confusion on diff with default, deveoper, production. Logic would say set this to developer mode.
But if you are just running the server for say a customer demo then needs to be in production mode.
I’m not a frontend person so I apologise in advance for being total idiot here. This is to my point tho, I don’t want to care about this, I just want to write code. I’m not interested in becoming a LESS expert.
Worth mentioning testing. WebShopApps/ShipperHQ does a lot of automated and TDD, primarily away from Magento. My background is very much in the agile TDD space so really looking forwards to understanding on Magento2 and using. I’m assuming, like on Java, that once we expand this out then the fact we can ‘lose’ the browser for a lot of our unit tests will mean we get faster at dev, we just need to build out our frameworks to sit on top of magento. Selinium will always be slow (and I ‘hate’ it for that reason!).
Dev Performance Discussion – Vinai mainly on XDebug, Caching
Magento2 Performance Guide – FireBear Studio
Developer Modes – Magento 2 Docs