I'm developing an ASP.NET application that will be run under Linux/Mono for various reasons (mostly to stay away from IIS, quite frankly). Of course the first web server I had in mind was Apache. But Apache, for all its advantages, adds a lot of overhead. Also, the application I'm building needs to be highly scalable and performance is one of the main concern.
Apache has, obviously, a very good reputation and its record speaks for itself, but I don't need things like Reverse Proxy or Load Balancing because dedicated network devices would be used for that. So those modules from Apache will never be used.
So basically my question is: since Nginx seems to fit exactly needs, is there any caveat I should be aware of? For instance, is Nginx renowned to be particularity safe? When security flaws are detected, how fast are they patched?
Any insight on the pros and cons of using either of those servers in conjunction with Mono is welcome.
ask yourself WHAT the application will be doing
lots of file I/O? well then apache's threading model is just fine, file I/O is blocking
long-running connections with clients? then nginx's event model is more appropriate, network I/O can be nonblocking
the most honest answer is that its unlikely you will be hitting the architectural limits of ANY webserver. just use whatever you are most comfortable with. the "overhead" arguments directed against apache's thread model are only meaningful in high-traffic scenarios.
Sergey Sysoev -- the author of nginx -- releases patches quite often. The webserver is very nice, and is capable of effectively running anything with the help of FCGI, either PHP or Mono or whatever. Nginx is also exteremely efficient in serving static content, and uses very little memory for all these keep-alives and slow ones. Additionally, it has nice features&modules available to resist DDoS attacks.
But look, every scripting language is slow. If performance is the main concern, maybe you'll better try to create a FCGI app in C?
Cheers! :)
I personally replaced my Nginx setup with Cherokee
So far everything is running just as fast and I have a web interface on top of that. It also support Mono.
@ABrown: You're wrong on the point that ASP.Net is interpreted.
Applications/websites can be written in C# for example which are then compiled to an intermediate bytecode (IL). That's phase 1.
When a user initially visits the website, the byte code is then compiled to machine code.
Subsequent visits to the website invoke the machine code (it is not parsed or interpreted, it is executed natively).