github uNetworking/uWebSockets v20.57.0

latest releases: v20.66.0, v20.65.0, v20.64.0...
8 months ago

Experimental cross-platform uWS::LocalCluster

We've always supported multi-CPU scaling as detailed in the HelloWorldThreaded.cpp example and benchmarking blog posts. However, this example has only been properly supported on Linux systems and contained some really ugly boiler plate code.

This release adds the uWS::LocalCluster helper that works properly on Windows, macOS, Linux and makes it easy to take any single-CPU app and make it scale over all available CPU-cores by default:

uWS::App(options).get(pattern, handler).listen(port, handler).run();

simply becomes

uWS::LocalCluster(options, [](uWS::App &app) {
  app.get(pattern, handler).listen(port, handler);
});

This is reflected in the updated HelloWorldThreaded.cpp example and works for both SSL and non-SSL clusters.

v20.56.0 on macOS (capped at 99% CPU-time)

Screenshot 2024-01-22 at 11 46 36

v20.57.0 on macOS (approaches 800% CPU-time)

Screenshot 2024-01-22 at 11 43 57

Don't miss a new uWebSockets release

NewReleases is sending notifications on new releases.