-
Notifications
You must be signed in to change notification settings - Fork 707
New release #8630
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
New release #8630
Conversation
So now you're running with connection: close, aren't you? |
No, I use PS : This option prevent TCP connection reuse tho |
Though 2 solutions somehow still seems to find a way to cache or reuse connections? |
Thanks for your investigation @cyrusmsk. How have you figured this ? Just to find a propre solution, maybe we can ping @hubertshelley @sdogruyol. The idea is to ensure TSP connection is not reused |
I mean only 2 solutions that are showing 3 times higher values than anything else Also Latency data is broken in this release |
Of course, With plain
With
I always hope you also check how closely different clients adhere to the HTTP standard. For example, the spec requires all servers to include a |
So, you are not sure of what causing higher results
Indeed, thanks for catch |
I have a suspicion. When a client sends I tried sending a test request to a Crystal Kemal server, and it not only does not respond with Example: curl -H "Connection: close" -v http://localhost:3000
The response is missing Serverino:
|
(it was just one more case where we need some checks on implementation) |
I locally tried RESULT
CONCLUSIONIf a framework shows non-100.00% |
Nice catch! |
But Kemal's code seems correctly binding to port 3000 and I have no idea for reason of the result now |
I'm aware that checking http compliance is realy a must have. If you have any idea of industry level tools to check that, feel free to open a discussion about this. It is clearly on the roadmap but not so easy to implement with the bandwidth I have |
If you need an idea, try to run this against the server you tests. I use the same paths you define for tests. Just checkout that repo and run |
Yeah, I plan to do that but I mean I'm quite sure that it existe an app to valide http compliance, like https://smithy.io/2.0/additional-specs/http-protocol-compliance-tests.html |
The long term goal is to make some score for each frameworks with a mix of indicators, and http compliance is one of them |
If the client sends a request with header "connection: close", the spec requires that the server closes the socket but it does not require the server to echo back "connection: close" (it's only recommended). Hence, checking for the curl debug line
is not a valid diagnostic for http compliance - it just says that curl itself has not closed the socket due to not receiving "connection: close" in response headers. For example, with
...the server did not reply with |
Good point, you’re right. |
If this is the reason, from the next test you should see a spike for serverino, since I implemented it some days ago, adding a |
Wait, code it is not updated here and I'm out of home 😃 |
I found the same thing as I added As you see, every thing is failing, showing The reason of the failure seems some bug of
The heading part to
By the wayrequire "kemal"
Kemal.config do |cfg|
cfg.env = "production"
cfg.serve_static = false
cfg.logging = false
end
get "/" do |env|
nil
end
get "/user/:id" do |env|
env.params.url["id"]
end
post "/user" do |env|
nil
end
- System.cpu_count.times do |i|
- Process.fork do
- Kemal.run do |config|
- server = config.server.not_nil!
- server.bind_tcp "0.0.0.0", 3000, reuse_port: true
- end
- end
- end
-
- sleep
+ Kemal.run successfully works:
cf. original code: https://github.com/the-benchmarker/web-frameworks/blob/3c20cebf7b3358a573fcff4fc328b9aeb50a60b7/crystal/kemal/src/server.cr CONCLUSION (AGAIN)If a framework shows non-100.00% |
additionally, here System.cpu_count.times do |i|
Process.fork do doesn't seem an error factor: just - System.cpu_count.times do |i|
- Process.fork do
Kemal.run do |config|
server = config.server.not_nil!
server.bind_tcp "0.0.0.0", 3000, reuse_port: true
end
- end
- end
-
- sleep causes the same error:
|
The latest version is always taken since container are distroyed on each run, but I can expliclty set version condition 😛 |
Not sure why this code is here. Since official example use only Kemal.run https://github.com/kemalcr/kemal/blob/e684d2ec9fac727bf63865c738d6db7529a6924c/examples/hello-world/app.cr#L7 |
But I need to update the code here to enable the parallelism 😃 |
Missing frameworks
Replace #8577