feat(nexus): HTTP/1.1 keep-alive (~2× throughput)
Reuse TCP connections for multiple requests, honor Connection close, and raise wrk health RPS from ~45k to ~80k+ on the same machine. - Loop HandleConnection up to 1000 reqs/fd with Connection keep-alive - RawRequest_WantsKeepAlive (HTTP/1.1 default; HTTP/1.0 needs keep-alive) - Nexus 0.3.0 banner; benches note before/after RPS
This commit is contained in:
@@ -63,16 +63,17 @@ module Handlers {
|
||||
|
||||
pub func HandleApiHealth() -> HttpResponse {
|
||||
return Http_NewResponse(200, "application/json; charset=utf-8",
|
||||
"{\"status\":\"ok\",\"server\":\"Nexus\",\"version\":\"0.2.0\"}");
|
||||
"{\"status\":\"ok\",\"server\":\"Nexus\",\"version\":\"0.3.0\"}");
|
||||
}
|
||||
|
||||
pub func HandleApiInfo() -> HttpResponse {
|
||||
return Http_NewResponse(200, "application/json; charset=utf-8",
|
||||
"{\"name\":\"Nexus\",\"language\":\"Bux\",\"features\":[\"HTTP/1.1\",\"thread-pool\",\"algebraic-enums\"]}");
|
||||
"{\"name\":\"Nexus\",\"language\":\"Bux\",\"features\":[\"HTTP/1.1\",\"keep-alive\",\"thread-pool\",\"algebraic-enums\"]}");
|
||||
}
|
||||
|
||||
pub func HandleWebSocketUpgrade(req: HttpRequest) -> HttpResponse {
|
||||
let wsKey: String = RequestHeader_Get(req, "Sec-WebSocket-Key");
|
||||
var reqMut: HttpRequest = req;
|
||||
let wsKey: String = RequestHeader_Get(&reqMut, "Sec-WebSocket-Key");
|
||||
|
||||
var resp: HttpResponse;
|
||||
resp.statusCode = 101;
|
||||
|
||||
Reference in New Issue
Block a user