Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions frameworks/aegon/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN pacman -Syu --noconfirm --needed \

ARG AEGON_REPO=https://github.com/UdayKhare09/Aegon.git
ARG AEGON_REF=main
ARG AEGON_COMMIT=1a75f92
ARG AEGON_COMMIT=4f0fbdb

WORKDIR /src
RUN echo "Building Aegon commit: ${AEGON_COMMIT}" && \
Expand All @@ -29,6 +29,7 @@ RUN echo "Building Aegon commit: ${AEGON_COMMIT}" && \
WORKDIR /src/aegon-src
RUN cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
-DAEGON_BUILD_TESTS=OFF \
-DAEGON_BUILD_SAMPLES=OFF \
-DAEGON_BUILD_BENCHMARKS=OFF \
Expand All @@ -40,7 +41,8 @@ WORKDIR /app
COPY CMakeLists.txt main.cpp ./
COPY proto/ ./proto/
RUN cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release && \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON && \
cmake --build build -j$(nproc)

FROM archlinux:latest
Expand Down
1 change: 1 addition & 0 deletions frameworks/aegon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
| `/echo` | POST | TLS | 8Gbit verbatim binary stream echo |
| `/static/*` | GET | TLS, HTTP/2 & HTTP/3 | High-throughput static file delivery via `router.static_files` |
| `/ws` | Upgrade | HTTP/1.1 (RFC 6455) | Full-duplex WebSocket echo with SIMD unmasking and `io_uring` batching |
| `/spec`, `/spec/headers` | GET, HEAD, OPTIONS, POST | HTTP/1.1, HTTP/2 & TLS | Compliance suite target (`Http11Probe`, `h2spec`) |
| `/benchmark.BenchmarkService/GetSum` | POST | gRPC over h2c & h2+TLS | Native zero-overhead unary gRPC sum RPC (`unary-grpc`, `unary-grpc-tls`) |

## Ports & Protocols
Expand Down
64 changes: 41 additions & 23 deletions frameworks/aegon/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,37 @@ void register_routes(Router& router) {
// 8. WebSocket Echo endpoint
router.ws("/ws");

// 9. gRPC BenchmarkService (unary-grpc, unary-grpc-tls)
// 9. Compliance routes (/spec and /spec/headers)
auto handle_spec_text = [](Context& ctx) {
ctx.res().text("spec ok");
};
router.get("/spec", handle_spec_text);
router.add_route(Method::HEAD, "/spec", handle_spec_text);
router.add_route(Method::OPTIONS, "/spec", [](Context& ctx) {
(void)ctx.req().body();
ctx.res().status(StatusCode::Ok)
.header("Allow", "GET, HEAD, POST, OPTIONS")
.body_view("");
});
router.post("/spec", [](Context& ctx) {
ctx.res().header("Content-Type", "application/octet-stream");
ctx.res().body_view(ctx.req().body());
});
auto handle_spec_headers = [](Context& ctx) {
(void)ctx.req().body();
std::string out;
for (const auto& h : ctx.req().headers()) {
out.append(h.name);
out.append(": ");
out.append(h.value);
out.push_back('\n');
}
ctx.res().text(out);
};
router.get("/spec/headers", handle_spec_headers);
router.post("/spec/headers", handle_spec_headers);

// 10. gRPC BenchmarkService (unary-grpc, unary-grpc-tls)
auto grpc_svc = router.grpc_service("/benchmark.BenchmarkService");
grpc_svc.unary<benchmark::SumRequest, benchmark::SumReply>("GetSum", [](grpc::UnaryContext<benchmark::SumRequest, benchmark::SumReply>& ctx) {
benchmark::SumReply reply;
Expand Down Expand Up @@ -316,37 +346,25 @@ int main() {
const std::string keyFile = "/certs/server.key";
bool has_certs = std::filesystem::exists(certFile) && std::filesystem::exists(keyFile);

struct rlimit rl{};
bool low_memlock = false;
if (getrlimit(RLIMIT_MEMLOCK, &rl) == 0 && rl.rlim_cur != RLIM_INFINITY && rl.rlim_cur < 64 * 1024 * 1024) {
low_memlock = true;
}

Server server;
if (low_memlock) {
server.ring_entries(256);
server.buffer_pool_entries(256);
} else {
server.ring_entries(2048);
server.buffer_pool_entries(512);
}
server.ring_entries(4096);
server.buffer_pool_entries(2048);
server.tcp_nodelay(true);
server.h2_max_concurrent_streams(2000);
server.h2_initial_window_size(1048576);
register_routes(server.router());

// Port 8080: Plaintext HTTP/1.1 (main benchmarks)
server.listen(8080);
// Port 8082: Plaintext HTTP/2 prior-knowledge (baseline-h2c, json-h2c)
server.listen(8082);
// Port 8080: Plaintext HTTP/1.1 + WS + h2c (baseline, ws, unary-grpc)
server.listen(8080, Protocol::H1 | Protocol::H2c);
// Port 8082: Strict cleartext HTTP/2 prior-knowledge (baseline-h2c, json-h2c)
server.listen(8082, Protocol::H2c);

if (has_certs) {
server.enable_tls(certFile, keyFile);
server.enable_http3(true);
// Port 8081: TLS HTTP/1.1 (json-tls, 8gbit)
server.listen_tls(8081);
// Port 8443: TLS HTTP/2 & HTTP/3 (baseline-h2, static-h2, baseline-h3, static-h3)
server.listen_tls(8443);
// Port 8081: TLS HTTP/1.1 only (json-tls, 8gbit, static-tls, connections-1m-tls)
server.listen(8081, Protocol::H1Tls);
// Port 8443: TLS HTTP/2 & HTTP/3 QUIC (baseline-h2, static-h2, baseline-h3, static-h3, unary-grpc-tls)
server.listen(8443, Protocol::H2 | Protocol::H3);
}

server.run(threads);
Expand Down
6 changes: 6 additions & 0 deletions frameworks/aegon/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
"echo-ws-pipeline",
"echo-ws-limited"
],
"spec": [
"h1",
"h2",
"h3",
"ws"
],
"maintainers": [
"UdayKhare09"
]
Expand Down
83 changes: 83 additions & 0 deletions site/data/spec/aegon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"framework": "aegon",
"dir": "aegon",
"suites": {
"h1": {
"tool": "http11probe",
"version": "d50d818",
"passed": 159,
"total": 159,
"warnings": 10,
"failed": []
},
"h2": {
"tool": "h2spec",
"version": "2.6.0",
"passed": 145,
"total": 146,
"failed": [
{
"id": "http2/5.1/8",
"test": "closed: Sends a DATA frame after sending RST_STREAM frame",
"expected": "GOAWAY Frame (Error Code: STREAM_CLOSED) or RST_STREAM Frame (Error Code: STREAM_CLOSED) or Connection closed",
"got": "Timeout"
}
],
"listeners": {
"tls": {
"passed": 146,
"total": 146,
"failed": []
},
"h2c": {
"passed": 145,
"total": 146,
"failed": [
{
"id": "http2/5.1/8",
"test": "closed: Sends a DATA frame after sending RST_STREAM frame",
"expected": "GOAWAY Frame (Error Code: STREAM_CLOSED) or RST_STREAM Frame (Error Code: STREAM_CLOSED) or Connection closed",
"got": "Timeout"
}
]
}
}
},
"h3": {
"tool": "h3spec",
"version": "v0.1.15",
"passed": 80,
"total": 85,
"failed": [
{
"id": "HTTP/3 servers treats a repeated setting identifier as an error whatever its value [HTTP/3 7.2.4]",
"got": "did not get expected exception: QUICException"
},
{
"id": "HTTP/3 servers MUST send H3_ID_ERROR if CANCEL_PUSH names a push ID not allowed [HTTP/3 7.2.3]",
"got": "predicate failed on expected exception: QUICException / ApplicationProtocolErrorIsReceived (ApplicationProtocolError 261) \"\""
},
{
"id": "HTTP/3 servers MUST send H3_ID_ERROR if MAX_PUSH_ID goes down [HTTP/3 7.2.7]",
"got": "predicate failed on expected exception: QUICException / ApplicationProtocolErrorIsReceived (ApplicationProtocolError 262) \"\""
},
{
"id": "HTTP/3 servers MUST send H3_FRAME_ERROR if MAX_PUSH_ID has octets after its push ID [HTTP/3 7.1]",
"got": "did not get expected exception: QUICException"
},
{
"id": "HTTP/3 servers MUST NOT buffer an over-long frame on a control stream [HTTP/3 7.1]",
"got": "did not get expected exception: QUICException"
}
]
},
"ws": {
"tool": "autobahn-testsuite",
"version": "25.10.1",
"passed": 244,
"total": 244,
"non_strict": 2,
"failed": []
}
}
}
Loading