-
Notifications
You must be signed in to change notification settings - Fork 3
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
Running application code Inline reduces performance of JSON benchmark #41
Comments
@tmds @adamsitnik I collected traces + speedscope json for this issue into the EDIT: updated the link |
Thanks for running these benchmarks. I hope they tell us what this weirdness is with |
@adamsitnik I had a look at the trace file, this is what I noticed: A lot of time is spent in CLRLifoSemaphore::Wait: This is called by ThreadPool threads. Zooming in on a thread: What do you make of this? |
Based on dotnet/runtime#33669 (comment), it may be interesting to see what happens if we set |
I believe these traces are from this benchmark:
@antonfirsov @adamsitnik
Note: the first is the default value, and matches the benchmark we ran already. |
@tmds looks like it makes big difference:
|
Most probably these are the thread pool threads that are waiting for some work to execute. |
Even without
|
When we run application code inline, the IoQueue is challenging the ThreadPool.
This is the first benchmark where we see batching sends improving performance! |
Based on dotnet/runtime#33669 (comment), I also tried |
@antonfirsov can you run these accross a range of
|
@antonfirsov can you perform this benchmark also with ThreadPool as output scheduler (added in #71)?
|
That's expected. ioqueue gets used because it improves performance compared to threadpool. Though it varies based on
|
We've observed in #76 that when using Looking at trace from:
When we look at the whole application: we see system is loaded 50%, and load is spread across the epoll threads: And if we look at a single epoll thread, it loads a full core: @antonfirsov can you create a trace for |
See: |
These traces look very similar to What happen when we increase parallelism for requests? How does that affect Max CPU and RPS?
@antonfirsov this sets connections to 512. Can you run it for a range of |
@antonfirsov as we've discussed, we'll run the same benchmark on Citrine and see at what nr of t, RPS flatlines. |
@antonfirsov when you run these benchmarks. Probably we'll get a similar graph as the one above. It would be interesting to have traces for lowest |
Some observations from the previous benchmark worth calling out:
|
Although there is still a slowdown at
There are trace files for Update |
--path "/json" --arg "-e=epoll" --arg "-t=4" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=true" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
--path "/json" --arg "-e=epoll" --arg "-t=5" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=true" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
--path "/json" --arg "-e=epoll" --arg "-t=6" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=true" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
--path "/json" --arg "-e=epoll" --arg "-t=7" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=true" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
--path "/json" --arg "-e=epoll" --arg "-t=8" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=true" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
--path "/json" --arg "-e=epoll" --arg "-t=9" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=true" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
--path "/json" --arg "-e=epoll" --arg "-t=10" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=true" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
--path "/json" --arg "-e=epoll" --arg "-t=11" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=true" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
--path "/json" --arg "-e=epoll" --arg "-t=12" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=true" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
|
--path "/json" --arg "-e=epoll" --arg "-t=13" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=true" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
--path "/json" --arg "-e=epoll" --arg "-t=14" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=true" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
--path "/json" --arg "-e=epoll" --arg "-t=15" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=true" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
--path "/json" --arg "-e=epoll" --arg "-t=16" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=true" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
--path "/json" --arg "-e=epoll" --arg "-t=17" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=true" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
--path "/json" --arg "-e=epoll" --arg "-t=18" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=true" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
--path "/json" --arg "-e=epoll" --arg "-t=19" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=true" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
--path "/json" --arg "-e=epoll" --arg "-t=20" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=true" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
--path "/json" --arg "-e=epoll" --arg "-t=21" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=true" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
--path "/json" --arg "-e=epoll" --arg "-t=22" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=true" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
--path "/json" --arg "-e=epoll" --arg "-t=23" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=true" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
--path "/json" --arg "-e=epoll" --arg "-t=24" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=true" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
--path "/json" --arg "-e=epoll" --arg "-t=25" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=true" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
|
--path "/json" --arg "-e=epoll" --arg "-t=26" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=true" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
--path "/json" --arg "-e=epoll" --arg "-t=27" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=true" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
--path "/json" --arg "-e=epoll" --arg "-t=28" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=true" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
--path "/json" --arg "-e=epoll" --arg "-t=28" --arg "-s=false" --arg "-r=false" --arg "-c=false" --arg "-a=false" --arg "-w=false" --arg "-i=true" --arg "-o=inline" --connections 512
|
"-t=28", with AIO
"-t=28", without AIO
+17%, that's a nice difference! |
Closing. Benchmarks (see #78) will give us an overview of how this behaves with different schedulers, and |
See #25 (comment)
What is the root cause?
The text was updated successfully, but these errors were encountered: