hashrocket / websocket-shootout

A comparison of websocket servers in multiple languages and frameworks
MIT License
429 stars 76 forks source link

cpp uWebSockets impl is single threaded #33

Closed moshen closed 7 years ago

moshen commented 7 years ago

The uWebSockets server implementation is single threaded. Please take a look at the uWebSockets multi-threaded example.

jackc commented 7 years ago

Unfortunately, it's not so simple as the example. The worker servers need to communicate, and the documentation does not declare what is thread-safe. However, I got an answer from the author in https://github.com/uWebSockets/uWebSockets/issues/244 and was able to implement an (ugly) multi-threaded implementation.

That said, it doesn't seem to make much difference for a simple broadcast benchmark. I think it is hitting the a OS/networking stack/network ceiling.