ysbaddaden / execution_context

10 stars 2 forks source link

Adding an example of a dedicated ST EC dispatching to a MT EC #31

Open beta-ziliani opened 2 months ago

beta-ziliani commented 2 months ago

Benchmarks (all of them with 30s and 40 connections):

preview_mt:
  Requests/sec:  79505.69
  Transfer/sec:     82.72M
ec:
  Requests/sec:  64983.74
  Transfer/sec:     67.61MB
preview_mt:
  Requests/sec:  73082.06
  Transfer/sec:     76.04MB
ec:
  Requests/sec:  86116.64
  Transfer/sec:     89.60MB 
preview_mt:
  Requests/sec:  44979.04
  Transfer/sec:    175.48MB
ec:
  Requests/sec:  45267.99
  Transfer/sec:    176.61MB
ysbaddaden commented 2 months ago

I recall an attempt to isolate the http server to its own thread didn't fare well with preview_mt, but it's apparently working a little better with EC.

Now, wrk keeps the connections alive, so the dispatch only happens at the beginning, then everything happens in the MT context while the ST context sleeps. It could be interesting to have another client that regularly closes & reconnects the connections (e.g. every dozen ones).

beta-ziliani commented 2 months ago

In the last commit I separated the main thread only when running -Dec (no -Dmt).