Search code examples
webserverhigh-load

High-load: Own light web-server vs module for nginx


How do you think, is it a good idea to write own web-server for a high-loaded project with built-in native code comparing to nginx + C++ module? Probably, productivity gains will be negligible?

And what about the safety of this approach (С++ module for nginx) compare to usage of interpreted programming languages?


Solution

  • Don't do it.

    Your time will be better spent investigating how you can improve the caching of your resources. Investigate HTTP's Cache-Control, conditional GET, Transfer-Encoding (ie gzip) & Range headers (in that order).

    If you use ORM investigate wether you can enable persistence caching to eliminate network hops to your DB.

    Also, investigate the use of a CDN and caching reverse proxy such as Varnish.