Skip to content
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

Performance issues #122

Open
danielbaud opened this issue Oct 5, 2022 · 0 comments
Open

Performance issues #122

danielbaud opened this issue Oct 5, 2022 · 0 comments

Comments

@danielbaud
Copy link

Description

I have faced performance issues with Lithium when using it on a linux 12-core server
Even though some benchmarks showed good results (approx 5000 requests per second, 0.3 ms response time), a real conditions scenario resulted in long response times and difficulties with keeping up with the incoming requests
The main difference between the two scenarios is that each request is made by a new connection in the second scenario whereas the benchmarks use the same 200 connections during the whole process
Also, when using 12 threads (by default), the cpu is barely used. Some tests using up to 800 threads improved the benchmarks but did not solve the problem in the real conditions scenario

Code

The server used in those tests is from this code

li::http_api api;

api.get("/route1") = [&](li::http_request& request, li::http_response& response) {
    response.set_header("Connection", "Keep-alive");
    response.write("\n");
  };

api.get("/route2") = [&](li::http_request& request, li::http_response& response) {
  response.set_header("Connection", "Keep-alive");
  response.write("\n");
};

li::http_serve(api, 12345);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant