3 ms·
As an Apache user for relatively simple websites (wordpress, laravel, not high-load web-apps), under moderate load, should I ever migrate to NGINX? I love how e
by michelb 5y ago
As an Apache user for relatively simple websites (wordpress, laravel, not high-load web-apps), under moderate load, should I ever migrate to NGINX? I love how easy Apache is to configure. I'm using the event module with PHP-FPM, would I even notice a performance improvement?
- porker 5y agoSlowloris attacks are the only reason I've switched from Apache to nginx. AFAIK Apache using event/worker still has no protection.
- shantnutiwari 5y agoSometime ago there was a big push "Apache is old fashioned and clunky! Nginx is sooooo powerful! Move to Nginx!!" Now we are seeing the opposite backlash. As someone who doesnt know much about this topic, I also wish there was an easy answer :/
- sgjohnson 5y agoIt’s always worth learning NGINX, as it is a truly powerful tools, but it’s often PITA to configure, and there are a lot of pitfalls if you use virtualhosts.
- gjvc 5y agoLinux distributions of nginx sometimes have their conf.d/ and available-sites.d/ directories in /etc/nginx/ which sometimes can confuse matters. With software packages such as nginx (in general, not in the context of Linux distributions mentioned above), it's sometimes easier / clearer to start with a completely empty configuration file, and add just enough to make it work (TDD-style), and / or stop it complaining. If you can explain / defend / justify the presence of every line, you stand a much better chance of knowing how it will behave.
- mekster 5y agoPerhaps some benchmark would convince one.
- thejohnconway 5y agoI'm just a hobbyist, so take this as you will, but my experience with NGINX is bad. Sure it might be fast (does that even matter at normal scales?), but it configuration is a pain in the neck, as this article conveys. Common things seemed hard and fragile to me, like getting the reverse proxy set up with Let's Encrypt. As it's just a thin layer on what I am actually doing, spending days or weeks learning the proper way to do things felt like an imposition on my time. At some point I broke my config and gave up on it – I moved my whole site to a new VPS without a reverse proxy and encrypted through Cloudflare. I've since moved to Caddy, and uh, wow, this is what it's supposed to be like!
- NorwegianDude 5y agoApache is fine. No reason to switch to nginx unless there is something nginx offers that apache doesn't. In earlier days a lot of people was under the impression that nginx was much faster for PHP, but that was not true. Apache with mod_php was faster, but the issue was memory consumption for non php files as the php module was loaded on every request, even if it wasn't php. When using php-fpm you don't need the php module on every request as php-fpm is contacted as needed. This does increase latency and decrease performance for php requests, but the difference is indistinguishable for most people. Slowloris attacks was/is one issue with non event-based webservers. Both nginx and apache can handle a six digit number of php requests each second on a low end server. You application(Wordpress, Laravel) will without a doubt be a bottleneck before the webserver becomes the bottleneck.
- tyingq 5y agoMost of the benchmarks I'd seen showing Nginx as significantly faster than Apache boiled down to configuration. Having mod_rewrite turned on with AllowOverride for Apache, for example, slows it down quite a lot.
- matja 5y agoI remember one of the early "selling points" of nginx was it didn't traverse the directory tree for a .htaccess file to dynamically load config from, for each request, when that was specifically a "selling point" of Apache, which is very useful for shared hosting contexts when users don't have access to change the webserver config.
- NorwegianDude 5y agoConsidering that that's something you can choose to do with apache isn't a selling point for nginx. It's an optional feature nginx lacks. But yeah, there was a lot of weird and misinformed reasons for why people recommended others to use nginx no matter what the use case was.
- 2000UltraDeluxe 5y agoIf you need to proxy the requests to your Apache server(s), then sure, Nginx is really nice. It's got proper HTTP/2 support unlike Apache, and it also supports proxying mail and other connections if needed. There's little reason to replace Apache completely, though.