Scalable server framework in C++
Asked Answered
B

4

13

I am looking to write a server application in C++ that is meant to handle tens of thousands of clients simultaneously. It should run under Windows and Linux. I have been looking around for frameworks and libraries and have come across Boost Asio, which seems like a highly mature and widely used alternative. I just have trouble wrapping my head around strands/thread pools, mainly because of the millions of templates. My background is mainly in C, so am not really used to the template mess that Boost in general seems to be full of. I tried to find someone to develop a relatively thin wrapper around Boost Asio that would take care of the threading/synchronization aspect using strands, bind and the like, but have been unable to find someone yet who can do it within my budget (2 or 300 US dollars).

Can any of you recommend any other libraries that scale as well as Boost Asio (e.g. with IOCP on Windows and epoll on Linux etc), or a source where I might find skilled Boost developers looking for smaller freelance jobs?

Thanks very much in advance for any help.

Kind regards,

Philip Bennefall

Bowie answered 15/7, 2011 at 0:15 Comment(0)
W
11

Best 4 choices i know

I really like zeromq.. but libuv seems interesting.. (libev and libevent are very nice too)

Worshipful answered 15/7, 2011 at 15:48 Comment(0)
P
4

ACE is the framework you are looking for. Even boost Asio is just an implementation of Proactor pattern, which was introduced by Douglas C. Schmidt. He is best known as the author of POSA Vol.2 and the creator of ACE framework.

The Boost.Asio library offers side-by-side support for synchronous and asynchronous operations ... based on the Proactor design pattern [POSA2].

Although it is a cross-platform C++ network framework and uses template, just simple template is used. (or not at all)

My background is mainly in C, too, and I don't like Boost's massive template-programming style. However, ACE wasn't like that.

Pamilapammi answered 22/7, 2011 at 18:33 Comment(3)
My opinion of ACE is just for research network programming. Not for production use.Nuclease
ACE is horribly written, the most confusing networking framework I've ever worked with.Stamey
Ermm - agreed - ACE is fairly kludgy by modern standards, but please dont be too harsh on it. ACE evolved in a period before c++ compilers were even remotely standards compliant - hence the kludge. And there are tons of telcos out there running ACE based servers. That said - it's time in the sun is about done.Driskill
C
3

Try libevent on for size. Its whole raison d'etre is to address the C10K problem. I'd say it's probably more lightweight than boost.

Cykana answered 15/7, 2011 at 0:18 Comment(4)
Not like I care terrifically, but would the downvoter care to explain why he / she disagrees?Cykana
Thanks for the suggestion Chris. I've looked into the library and it seems interesting for sure. I'll start hacking on this. Thanks!Bowie
The problem for me is that I am using a so called screen reader because I am blind, and for some reason I am not able to invoke the accept answer command. It just appears as normal text, rather than a link or button or even a clickable area. So while I certainly would accept answers if I could, I currently do not know how.Bowie
Very interesting, that may be something to post to meta.stackoverflow.com. I'm sure you're not the only one with this problem.Cykana
W
0

Try Pulsar Server Framework. Main benefit is it is built over libuv network library (used by node.js) that uses asynchronous I/O based on event loops.

  1. It’s perfectly scalable. You can just go adding servers as your user base increases.

  2. It is designed to work with server farm.

  3. Highly configurable and easy to use

Currently it has been built for Windows x64 server.

Wry answered 4/7, 2018 at 6:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.