We are in the process of planning for a project, an eCommerce project. The client already has a working project, for some reason they decided to rebuild from scratch with some additional functionalities. Their major concern was to handle high traffic at all times because their current version fails so.

We chose to go with Magento 2.x for building up the e-commerce project.

But really confused with which web server to proceed. Nginx or Apache?

And what are the steps to be taken care of to speed up Magento store?

2 Answers 2


I'd go for Nginx, because this is faster then Apache. There are several benchmarks on the internet about the differences and the pros and cons of them. I'd suggest to read some of them, like this one by HostingAdvice.com.

To speed up Magento more, you should be using your build in caches, of course and you should consider using Varnish, which is available by default in Magento 2. Together with KnockoutJS, it works pretty fast. Of course, you can also use Redis, which is also available by default in Magento 2.

And of course you should have performance on your mind for every change you make in your Magento project. When benchmarking every single change, you can speed up all your changes as well.

So, there should be more then enough ways to speed up Magento 2, question is if you should setup hosting yourself. There are a lot of hosting solutions for Magento 2 out there, which are managed, so the guys there should be aware of the best specs for a proper Magento 2 project. I don't know all of them, but I could recommend companies like Byte (Hypernode), Nexcess and Sonassi. They're all specialised in Magento hosting and know what they're doing. Maybe getting in touch with one of these companies will help you out a lot as well.

  • thanks for the elaborate answer, seems like the client are fixed on hosting it by themselves. Btw one more thing to ask, currently we are configuring our development server, we are using CentOS 7.x, and it comes with MariaDB. i was thinking about going for MySQL, what is your thought on that?
    – Karthik Nk
    May 22, 2017 at 6:05
  • I doubt if hosting themselves is a valid argument here. They want to have a solid hosting solution and since other companies can give them this solution out of the box or as a custom solution for them, why stick to hosting yourself and reinvent the wheel. We had clients like that as well and in the and they all moved to specialised Magento hosting. About the development environment, I think your best approach here is to use a solution that's (as much as) a copy of your production environment, so you're sure that your features work on that setup. May 22, 2017 at 6:29
  • I would rather say that Magento is built with Apache "in mind", hence, the .htaccess files all over the directories.
    – Supersonic
    Mar 2, 2018 at 11:33
  • Sure, you can use Apache as well, it's not something that's impossible. My choice for Nginx is, apart from the benchmarks I mentioned, also a personal choice. I'm working with Nginx way more often then with Apache, both on development and production environments. But in the end, it's a choice you have to make for yourself. But I think benchmarking and a representative development environment are stuff you should take into consideration. Mar 2, 2018 at 19:58

neither one is faster, because nginx or apache is just reading files, they have nothing to do with processing them. you will end up with php and mysql. only these two are responsible for speed.

and to speedup magento you must use profiler, if you have any serious speed issues, cause redis or varnish alone wont help you with speed...

p.s. the difference in apache and nginx is only your skills and knowledge to manage one of them better.

  • 1
    And where did you get your information from? Feb 24, 2018 at 5:09
  • 1
    i would say experience but, in fact this is just how webstack works. nginx or apache both working with php-fpm are the same. speed depends on your final code, because nginx and apache just pass request to php manager.... simple to understand.
    – MagenX
    Feb 24, 2018 at 13:03
  • I see, thank you for your reply. I got confused because the hosting I'm using "Cloudways" claims that they use a combination of Apache+Nginx+php-fpm where nginx serves static files. I went with your insights (supported by a couple of articles on the net) as it seems nginx will add complexity to the setup (never used it but considered it for a new project). I was under the assumption that PHP will run under Apache, similar to how OS runs Applications. Fast OS fast applications. Feb 24, 2018 at 22:19
  • Hi, what's this profiler you mention? The one in Magento? Isn't that just a report?
    – Typo
    Aug 21, 2018 at 19:33

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