<html><head></head><body><div class="ydpff19584eyahoo-style-wrap" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 13px;"><div></div>
<div>I think OTHER is something to do with Ports / polling, because I just removed the inet_drv and wrote a simple c nif to do TCP networking, and the throughput doubled. I did not get around to recompiling erlang with microstate accounting but without inet driver using an unoptimized nonblocking tcp nif I got the msacc report to look like<br><br><span><div> scheduler( 1) 0.68% 0.00% 89.85% 3.46% 6.01% 0.00% 0.00%</div><div> scheduler( 2) 0.66% 0.01% 90.43% 3.40% 5.50% 0.00% 0.00%</div></span><br>Using 2 schedulers because 10 physical cores generating load now just barely fully saturated. now 90% of the time is spent in emulator, 6% is other, I am guessing 6% other is the NIF calls to the socket calls?<br><br>The throughput was 250k for 2 physical cores. If all scales linearly that is 1.25m RPS for simple GET hello world benchmark.<br><br>The NIF is PoC <a href="https://gist.github.com/vans163/d96fcc7c89d0cf25c819c5fb77769e81" rel="nofollow" target="_blank">https://gist.github.com/vans163/d96fcc7c89d0cf25c819c5fb77769e81</a> ofcourse its only useful in the case there is constant data on socket, otherwise this PoC will break if there is idle connections that keep getting polled. This opens the possibility though to using something like DPDK.<br></div>
</div><div id="yahoo_quoted_5559651919" class="yahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
On Tuesday, December 18, 2018, 2:32:21 a.m. EST, Lukas Larsson <lukas@erlang.org> wrote:
</div>
<div><br></div>
<div><br></div>
<div><div id="yiv9733242232"><div><div dir="ltr"><br clear="none">Hello,<div><br clear="none"><div class="yiv9733242232gmail_quote"><div class="yiv9733242232yqt4650922346" id="yiv9733242232yqt71447"><div dir="ltr">On Tue, Dec 18, 2018 at 2:36 AM Vans S <<a rel="nofollow" shape="rect" ymailto="mailto:vans_163@yahoo.com" target="_blank" href="mailto:vans_163@yahoo.com">vans_163@yahoo.com</a>> wrote:<br clear="none"></div><blockquote class="yiv9733242232gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex;"><div><div>If anyone is interested here is the writeup <span><span style="color:rgb(36,41,46);font-family:-apple-system, BlinkMacSystemFont,;"> </span><a rel="nofollow" shape="rect" target="_blank" href="https://elixirforum.com/t/300k-requests-per-second-webserver-in-elixir-otp21-2-10-cores/18823" style="color:rgb(3,102,214);font-family:-apple-system, BlinkMacSystemFont,;">https://elixirforum.com/t/300k-requests-per-second-webserver-in-elixir-otp21-2-10-cores/18823</a>.<br clear="none"><br clear="none">tl;dr; <span><span style="color:rgb(36,41,46);font-family:-apple-system, BlinkMacSystemFont,;">About 22% of time the scheduler spent in poll. to serve 30k~ HTTP Get requests. I think its a little much still?</span></span></span></div></div></blockquote></div><div><br clear="none"></div><div>Firstly, it is not poll that you spend 22% in, it is PORT, i.e. the work done by gen_tcp to call writev/read. Polling shows up in the state CHECK_IO. The optimizations introduced in 21.2 were mainly done to reduce the time spent doing polling.</div><div><br clear="none"></div><div>Secondly, I'd say it is too little. As you saw in the edit that you made, if your remove/optimize the Erlang parts you will get higher a throughput rate as the system can spend more time doing port work. What you are seeing as OTHER is most likely the system spinning looking for work to do. You can get more states if you are interested in digging deeper by passing --with-microstate-accounting=extra to configure.</div><div><br clear="none"></div><div>The inet_driver (the port driver that is used for TCP/UDP/SCTP) is not perfect, but almost 2 decades have been spent improving it, so there are very few low hanging fruits left.</div><div><br clear="none"></div><div>Lukas</div></div></div></div></div></div></div>
</div>
</div></body></html>