-
Notifications
You must be signed in to change notification settings - Fork 7
Write a benchmark to compare against the default scheduler #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…ing and request processing
… response handling
…ate parameter for throughput control
…add SERVER_POLLER_MODE and SERVER_FJ_PARALLELISM support
…ndoffHandler and improve error handling
…zation in HandoffHttpServer and MockHttpServer
…all child threads in run-benchmark.sh
|
The results so far are great:
|
…nt latency distributions
|
@He-Pin And it's not finished yet...
Latencies are fluctuating because the custom scheduler has such a lower CPU usage that go idle much more, but still p99 is halved |
|
Would it be better to run on a bare metal box? |
|
@He-Pin for cpu bound scenarios like this, I would expect a quite similar behaviour tbh - cost of syscalls could be less (but NAPI poll can still kicks in) and additional context switch due to IRQ handling. If it's related the latencies, my "local" box at home is a Threadripper heavily tuned for low latency, disabling tubo boost, setting fixed frequencies etc etc |
This pull request introduces a new comprehensive benchmarking module for evaluating handoff strategies between Netty event loops and virtual threads. It provides a full implementation of an HTTP server (
HandoffHttpServer) that demonstrates handoff logic, a mock backend server, configuration via environment variables, and a benchmarking script. The module is packaged as a Maven project with all dependencies and includes POJOs for JSON serialization/deserialization.Benchmarking infrastructure and documentation
README.mddescribing the benchmarking module, usage instructions, environment variable configuration, example runs, output files, and manual server invocation.Maven project setup
benchmark-runner/pom.xmlto define the new Maven module, including dependencies for Netty, Jackson, Apache HttpClient, and test libraries. Configured the Maven Shade Plugin to produce a fat JAR with the correct main class.Server implementation
HandoffHttpServer.java, an HTTP server that receives requests on Netty event loops, hands off processing to virtual threads (with optional custom scheduler), makes blocking HTTP calls to a mock backend, parses JSON responses, and writes results back to clients. Includes argument parsing and usage help.Data model for JSON handling
Fruit.javaandFruitsResponse.javaPOJOs to represent the mock server's JSON response structure, using Jackson annotations for robust serialization/deserialization. [1] [2]Fixes #64