• by sinzone on 11/24/2015, 1:39:52 AM

    Lua support in nginx is phenomenal, especially when combined with LuaJIT. It basically allows to transform nginx into an application server and run arbitrary code that can pretty much do anything.

    I would like to mention agentzh and his team that did an amazing job in releasing OpenResty[1] which makes it easy to extend nginx with custom Lua functionality, which also happens to be the backbone of CloudFlare architecture, and the core technology being used by projects like Kong[2] when it comes to microservices management.

    [1] http://openresty.org/

    [2] https://github.com/Mashape/kong

  • by nisa on 11/23/2015, 10:23:42 PM

    I really enjoy nginx, as it's more flexible to configure but I've never understood why Apache got this slow label...

    FTA: In February 2012, the Apache 2.4.x branch was released to the public. Although this latest release of Apache has added new multi-processing core modules and new proxy modules aimed at enhancing scalability and performance, it's too soon to tell if its performance, concurrency and resource utilization are now on par with, or better than, pure event-driven web servers. It would be very nice to see Apache application servers scale better with the new version, though, as it could potentially alleviate bottlenecks on the backend side which still often remain unsolved in typical nginx-plus-Apache web configurations.

    I'm using Apache 2.4 with mpm_event + mod_proxy_fcgid and it's doing fine - 99% of the work and time spend is done in the FastCGI application anyway and for static content mpm_event is good enough. I wouldn't run a dedicated static CDN box on Apache but for everything that can run on a single server Apache can also do the job... even HTTP/2 with mod_h2 works fine as of 2.4.17

    A problem with nginx is to figure out what matches in a complex config... it's not straightforward. .htaccess is nice and simple for a shared server with lot's of users.

    I really like nginx but I guess most people just don't really need it. Migrating to 2.4 and mpm_event should be good enough.

  • by evincarofautumn on 11/23/2015, 8:59:07 PM

    No matter how many times I see “nginx”, and know that it’s supposed to be “engine X”, I always pronounce it as [ŋɪŋks] in my head!

    The way nginx handles requests and responses in an implicit event loop reminds me of a recent talk by Brian Kernighan, in which he mentions the ubiquity of the “pattern–action” model in many domains. I think it’s a very useful architectural pattern to have in mind when you’re designing a configuration system or a DSL.

    I also liked this quote:

    > …it is worth avoiding the dilution of development efforts on something that is neither the developer’s core competence or the target application.

  • by arca_vorago on 11/23/2015, 10:05:35 PM

    While I like nginx over apache because I've been burned too many times by strange apache configs, I have recently found and am growing to love Hiawatha. It's a GPL webserver focused on security, uses PolarSSL which jut got bought out and is now mbed, and it's pretty fast. All the benchmarks I've seen show it comparable to stock nginx, apache, but once you tack on some of the optimizations nginx will beat Hiawatha. It also has a very easy config syntax.

    Just for anyone interested: https://www.hiawatha-webserver.org/

    The dev doesn't do much advertising, so word of mouth on a place like HN really helps.

  • by alexandrerond on 11/23/2015, 11:06:07 PM

    Every "new" webserver tries to fix apache configuration syntax mess, and imho they all fail. Yes, setting up a reverse proxy looks simpler with nginx or haproxy for that matter. Now when it comes to complex configurations they all suck, and I'm not sure a json/yaml config format is going to fix that as long as webservers have such wide scopes (from serving static pages, to proxying traffic, authorizing, authenticating, encrypting...). At least apache is very modular on this regard and some credit should be given to it having survived and evolved along with all the newer options.

  • by davidmichael on 11/23/2015, 10:17:51 PM

    I wish there was more input as to why Apache 2.4 isn't suitable. It's been 3 years since its event driven model was released and it is a perfectly acceptable web server even for static content.

  • by davidw on 11/23/2015, 10:10:57 PM

    > Although Apache provided a solid foundation for future development, it was architected to spawn a copy of itself for each new connection

    That's not really correct:

    https://httpd.apache.org/docs/2.2/mod/prefork.html

    Nginx makes it easier to handle a bunch of concurrent connections, but it's not as if Apache simply forks for each new connection.

  • by jrochkind1 on 11/23/2015, 11:01:07 PM

    > In February 2012, the Apache 2.4.x branch was released to the public. Although this latest release of Apache has added new multi-processing core modules and new proxy modules aimed at enhancing scalability and performance, it's too soon to tell if its performance, concurrency and resource utilization are now on par with, or better than, pure event-driven web servers.

    When was this written? Is it still too soon to tell? 2.5 years seems like enough time to tell?

  • by maattdd on 11/24/2015, 9:17:18 AM

    More impressive in the same book, how another server (Warp) written in Haskell (GCed lazy functional language, supposedly way slower than C over epoll) achieves the same performance as nginx!

    http://www.aosabook.org/en/posa/warp.html

  • by gtrubetskoy on 11/24/2015, 3:30:31 AM

    Back when I was tinkering with mod_python performance[0] there was this web server called nxweb[1], which out-performed nginx consistently by quite a bit.

    [0] http://grisha.org/blog/2013/11/07/mod-python-performance-rev... [1] https://bitbucket.org/yarosla/nxweb/overview

  • by anowlcalledjosh on 11/23/2015, 8:56:00 PM

    Why do web servers always seem to invent their own config file format? Whilst nginx seems to do it slightly more sanely than Apache, it still doesn't use something like YAML or JSON; is there a good/obvious reason for this I'm missing?

  • by losvedir on 11/24/2015, 5:40:58 AM

    Does anyone know how this architecture compares to cowboy? I know erlang is known for concurrency, but I'm assuming erlang isn't as fast as the custom-tailored C here. OTOH, I feel slightly less concerned about security issues with erlang.

  • by DonnyV on 11/24/2015, 2:13:40 AM

    I love using nginx but it seems that all the new features lately are only accessible through their enterprise service.

  • by ferbivore on 11/24/2015, 7:02:20 AM

    Sort of unrelated, but I would love to see one of these for Unreal Engine. If there's an internal architecture overview somewhere, I haven't found it.

  • by jsprogrammer on 11/23/2015, 8:49:13 PM

    >These days the Internet is so widespread and ubiquitous it's hard to imagine it wasn't exactly there, as we know it, a decade ago. It has greatly evolved, from simple HTML producing clickable text, based on NCSA and then on Apache web servers, to an always-on communication medium used by more than 2 billion users worldwide.

    The Internet[0] has a much richer history and larger ecosystem than just the World Wide Web. The Internet started nearly six decades ago, the web has only been around for a bit more than two.

    [0] https://en.wikipedia.org/wiki/Internet