FastCGI or HTTP server for C++ daemon behind nginx proxy

Acting as HTTP server will force you to implement some things which is unrelated to your app's business logic. This includes but not limited to: keep-alive, chunked encodings, decoding forms data and many other little or big things. I'd prefer to stick with fastcgi since its requires less knowledge about transport-level protocol.


On the other hand, making your C++ application a specialized Web server (e.g. with libonion or Wt library, or even POCO) would make it quite easy to debug. Both can be used in a session aware way and will deal with the nitty-gritty details (caching, chunked encoding, transport-compression, ...). I guess (but don't know) that their HTTP performance might be slightly lower (both libraries are probably not as optimized as nginx is rumored to be). And they probably are best suited with a few dozens (or perhaps hundreds) of simultaneously active users, not thousands of ones (but I don't know, and never used them with that much users...).

And perhaps you might have real user cases for that (it really depends what the application is actually doing, and if you have users running Linux or some other POSIX systems...)

BTW, if you know (or want to learn) Ocaml, you might even use ocsigen; if you know Scheme or some other Lisp, consider HOP; if you are willing to learn a new language consider OPA (or maybe Haxe). All of these beasts enable you to easily mix server-side and browser-side computations.

Tags:

C++

Http

Fastcgi