3

I'm looking for an existing library to develop C++ web services where:

  1. Data is not copied from one process to another (this rules out some FastCGI options). I'm opposed to this because copying data between processes is an avoidable performance hit I'd rather avoid.
  2. The web server itself has received a lot of security scrutiny and is known for being secure.
  3. The web server handles thousands of concurrent connections simultaneously.
  4. The web server is competitive with nginx and netty.

I'm looking for a recommendation of an existing framework, library, or application I can plug my web services into.

This Lighttpd page[1] has an interesting approach to FastCGI where responses can be served from memory shared between the web server and the FastCGI process.

I'm wondering if I should just develop my services as nginx modules for security and speed.

[1] http://blog.lighttpd.net/articles/2006/11/29/faster-fastcgi/

  • 1
    This question is better suited for Programmers.SE – user416 Oct 7 '14 at 15:02
  • 3
    This question appears to be off-topic because it is about a programming implementation, rather than an existing software product. See Dan Doggen's suggestion. – user2813274 Oct 7 '14 at 15:53
  • Thanks. I am looking for an existing implementation. Either a library or a framework, or a program that I can plug my services in. Does that make this more relevant here? Thanks! – Tim Stewart Oct 7 '14 at 17:15
  • 3
    What are the closers thinking about? This question is clearly on-topic, great question actually. – Nicolas Raoul Oct 8 '14 at 9:05
  • I added a note that I was looking for an existing framework, library, or application I can plug my web services into. – Tim Stewart Oct 8 '14 at 19:01
2

I guess you want some C++11 compatible HTTP server library (for Linux I suppose), not only for some earlier C++ standard.

(If you don't want a library but want something communicating with another HTTP server process, I don't understand how you could avoid FASTCGI - or some other protocol like SCGI -; I don't believe that shared memory would be a reasonable IPC between your process and the web server since synchronization is a major issue in that case; however tmpfs file systems are quick!)

You could try libonion, but its C++ support is poor in march 2015 (to the point to be barely usable in practice, see its issue#105)

You could try cpp-netlib, but its C++11 web server side is IMHO not enough documented, see my question on StackOverflow

You could try POCO; I don't know it enough if it suits your needs.

There is also Wt

| improve this answer | |
1

One option is Cutelyst so:

  1. With cutelyst-wsgi you can avoid a front-end server
  2. To the moment no security issue has being found, the code has been written with a lot of caution to not have buffer overflow issues
  3. You can check it's performance with TechEmpower Benchmarks.
  4. On TechEmpower you can also see how well it performs using FastCGI and NGINX, although local tests using NGINX with proxy pass had better performance
| improve this answer | |
  • Thanks Daniel. Impressive TechEmpower results! – Tim Stewart Jan 30 '18 at 21:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.