Run the test suite with keep-alive parking on in CI, and mark it experimental

CPPHTTPLIB_KEEPALIVE_PARKING makes every Server start with parking on.
The OpenSSL jobs on Ubuntu (epoll) and macOS (kqueue) now also run the
whole suite built with it, which used to be done only locally. The two
tests that check the blocking path turn parking off explicitly. README
and the cookbook call the feature experimental and say that a server
whose event loop cannot be set up serves as it does without it.
This commit is contained in:
yhirose authored and yhirose committed 2026-11-21 21:23:22 -05:00
1 parent f09081e320
commit 51b186974b
8 files changed
+42 -4

No files matched your search

+3 -1
View File
@@ -56,11 +56,13 @@ By default, a Keep-Alive connection holds a worker thread for its entire lifetim
## Keep idle connections off the threads
> **Note:** Keep-alive parking is experimental. Its behavior may change in a future release.
```cpp
svr.set_keep_alive_parking(true); // call it before listen()
```
With keep-alive parking, a connection waiting for its next request is handed to an event loop instead of keeping its worker thread, and goes back to a worker when the request arrives. An idle connection then costs a socket and some memory (a few kilobytes, more with TLS) instead of a thread, and connections that outnumber the threads take turns instead of waiting for one to close. `SSLServer` supports it too.
With keep-alive parking, a connection waiting for its next request is handed to an event loop instead of keeping its worker thread, and goes back to a worker when the request arrives. An idle connection then costs a socket and some memory (a few kilobytes, more with TLS) instead of a thread, and connections that outnumber the threads take turns instead of waiting for one to close. `SSLServer` supports it too. Defining `CPPHTTPLIB_KEEPALIVE_PARKING` as `true` turns it on for every server.
What changes with it: