1

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?

oers
  • 18,436
  • 13
  • 66
  • 75
Ben Usman
  • 7,969
  • 6
  • 46
  • 66

3 Answers3

2

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.

johnstok
  • 96,212
  • 12
  • 54
  • 76
  • That's a definitive answer - precisely what programming is supposed to be defeating: you estimate that no innovation is possible (and that developers sould become users) and this is quite a bad thing. – Gil Oct 14 '12 at 09:31
1

Don't choose and take both (compiled C scripts). G-WAN let you mix C scripts and compiled libraries with a simple '#pragma link' directive so you can choose which part of your code will be pre-compiled and which part will stay in a script.

Fred
  • 312
  • 3
  • 4
0

It will be quite difficult to write your own safe webserver. nginx is very extensively tested and fulfils the security aspect better. Speed is probably not a problem (nginx is lightning-fast). You can still use multiple nginx processes if the load gets to heavy.

Regarding programming language: If you are really dealing with a high-performance app, you are probably going to need a C++ module, but in most cases interpreted languages will suit the needs. I prefer interpreted languages, since development can be done much faster. If it gets too slow, you can still switch to C++.

jwueller
  • 30,582
  • 4
  • 66
  • 70
  • Is this really an answer for a developer Q & A site? It looks much like a reply dedicated to Webmasters (end-users rather than programmers). – Gil Oct 14 '12 at 09:29