Simple, secure & standards compliant web server for the most demanding of applications
APACHE-2.0 License
Bot releases are visible (Hide)
Published by uNetworkingAB over 1 year ago
With more features added, more optimizations and more examples working properly, here's the current performance metrics comparing uWS v21 against latest denoland/fastwebsockets v0.4.2. As an aside, uWS can now do URL routed HTTP requests at 350k req/sec, which is even faster than what an optimized epoll server can do raw TCP echoing (325k msg/sec) on this machine. Just think about that for a moment - uWS is serving standards compliant HTTP faster than you could do even raw TCP a few years ago. Mind blown.
Published by uNetworkingAB over 1 year ago
uWS never cared to optimize non-SSL, non-compressed semi-big WebSocket message sending, and so was a bit slower than what denoland/fastwebsockets v0.4.2 presented. This release adds such optimization and is now reliably and significantly faster in all cases.
Also, keep up to date for news on the v21 release where io_uring will be default and we see even bigger outperformance.
Published by uNetworkingAB over 1 year ago
This alpha release adds initial (still to be further optimized) io_uring support in uWS. It is still very incomplete, but EchoServer, HelloWorld and even HelloWorldThreaded work. As do load_test and http_load_test and possibly other examples.
Here's a comparison against the (minimal) fastwebsockets project, and against uWS v20. We still have a bunch of optimizations to add, zero-copy for instance.
You can build it with LDFLAGS=/usr/lib/liburing.a WITH_IO_URING=1 make
Published by uNetworkingAB over 1 year ago
Published by uNetworkingAB over 1 year ago
Fixes an edge case where URI querystrings with keys with no value gets interpreted as invalid querystring.
Now the querystring "?one=&two=hello%20world" is considered valid, and HttpRequest.getQuery("two") will return "hello world" like it should.
This release also adds testing for the above case.
Published by uNetworkingAB over 1 year ago
Published by uNetworkingAB over 1 year ago
Fixes an edge case where calling HttpResponse::upgrade inside HttpResponse::cork from inside a third-party callback would crash.
Full Changelog: https://github.com/uNetworking/uWebSockets/compare/v20.37.0...v20.38.0
Published by uNetworkingAB over 1 year ago
Full Changelog: https://github.com/uNetworking/uWebSockets/compare/v20.36.0...v20.37.0
Published by uNetworkingAB almost 2 years ago
Published by uNetworkingAB almost 2 years ago
Published by uNetworkingAB almost 2 years ago
Calling this new function will:
This call can be used to gracefully close and release an App that needs maintenance.
Published by uNetworkingAB almost 2 years ago
A reworked timeout system now allows two lightweight timeout settings for WebSockets; idleTimeout
(up to 16 minutes) and maxLifetime
(up to 4 hours):
idleTimeout
is how long (in seconds) a WebSocket may be idle (have no traffic) before it is considered closed.maxLifetime
is how long (in minutes) a WebSocket may be connected, before being gracefully closed by the server.Specifying a value of 0 disables respective feature (the default for maxLifetime
).
The idea here is to enforce a partial rebalancing, constantly forcing a few connections to reconnect via whatever load balancer in use. This is a strategy used by Netflix where they found success in having maxLifetime = 30
minutes.
Good values for the settings should be somewhere around 30-120 seconds idleTimeout
and 30-120 minutes maxLifetime
.
Published by uNetworkingAB almost 2 years ago
A new kind of event has been added. Whenever a WebSocket::subscribe
or WebSocket::unsubscribe
call is made, or when implicit unsubscription happens (such as when a WebSocket has subscriptions and gets closed in any way), a subscription event will fire with:
These events can be used to easily manage external subscriptions such as when using Redis to orchestrate multiple instances of uWS. Whenever a subscription event with new subscription count == 1; you can create the corresponding Redis subscription. Whenever a subscription event with new subscription count == 0; you can free the corresponding Redis subscription.
Published by uNetworkingAB almost 2 years ago
Published by uNetworkingAB almost 2 years ago
Published by uNetworkingAB almost 2 years ago
Published by uNetworkingAB almost 2 years ago
Published by uNetworkingAB almost 2 years ago
Contributed by Ciro Spaciari (@cirospaciari) - there is now a quite complete C API that can be used from Zig, Rust and the like. Some form of this C API is already in use by Bun.
Published by uNetworkingAB almost 2 years ago
HTTP/1.1 has been around since late stone age and there is now a new RFC9112 that updates it further, released this very summer. This is a good time to go over said spec. and make uWS as compliant as practically possible. This is going to be a gradual shift over time, making uWS more strict in this area, but here are some of the fixes in this release:
Some of these fixes are due to a report by FFRI Security, Inc. If you consider spec. compliance a security factor; then update to latest uWS.
Published by uNetworkingAB about 2 years ago