<div dir="ltr">Awesome! Can't wait gen_tcp rewritten with new socket module available in public and stable.<div>And at which version will be available? at 22.X or 23 ?</div><div><br></div><div>@Thomas Pircher facing another new problem with socket module. It looks like we hijacked his thread question ^^ :D</div><div><br></div><div> <br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Pada tanggal Sel, 29 Okt 2019 pukul 18.09 Micael Karlberg <<a href="mailto:micael.karlberg@ericsson.com">micael.karlberg@ericsson.com</a>> menulis:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">No, its on the todo list, there is actually a ticket for this.<br>
I would be good for completeness, if nothing else.<br>
<br>
/BMK<br>
<br>
On 2019-10-29 11:33, pablo platt wrote:<br>
> Micael, are there similar tests for udp?<br>
> <br>
> On Tue, Oct 29, 2019 at 12:12 PM Micael Karlberg <<a href="mailto:micael.karlberg@ericsson.com" target="_blank">micael.karlberg@ericsson.com</a> <br>
> <mailto:<a href="mailto:micael.karlberg@ericsson.com" target="_blank">micael.karlberg@ericsson.com</a>>> wrote:<br>
> <br>
> Hi,<br>
> <br>
> Its not a secret :) You will find it in the emulator test catalog.<br>
> The only problem is that it was never intended for public "consumption"<br>
> and is therefor not documented:<br>
> <br>
> socket_test_ttest_tcp_socket.erl (uses socket.erl)<br>
> socket_test_ttest_tcp_gen.erl (uses gen_tcp.erl)<br>
> <br>
> The idea here is that they should have an "identical" interface (so<br>
> the users should work with both transports).<br>
> Obviously the "socket" is different (a gen_tcp socket is a port and<br>
> a socket socket is a term()).<br>
> <br>
> The other socket_test_ttest_tcp* modules "can" be used to see how to<br>
> use these...<br>
> <br>
> Also, there is work on making gen_tcp work with the new socket module.<br>
> This is ongoing. There is a lot of special options that gen_tcp/inet<br>
> manages (packaging for instance).<br>
> <br>
> Regards,<br>
> /BMK<br>
> <br>
> On 2019-10-29 10:54, Loïc Hoguin wrote:<br>
> > Hello,<br>
> ><br>
> > I would like to do a similar experiment with RabbitMQ. Would you mind sharing the code that<br>
> makes<br>
> > 'socket' work similar to 'gen_tcp'? That may give me a head start, even if the code is not<br>
> complete.<br>
> ><br>
> > Thanks,<br>
> ><br>
> > On 25/10/2019 12:39, Micael Karlberg wrote:<br>
> >> Hi,<br>
> >><br>
> >> Its early days still, but the goal is definitely that it should<br>
> >> be faster.<br>
> >><br>
> >> Here is some figures from a (time) test tool which is part of the<br>
> >> test suite (its basically a ping-pong case), both server and client<br>
> >> running on the same host (but in different VMs):<br>
> >><br>
> >> Two transports:<br>
> >> gen: gen_tcp<br>
> >> sock: socket (tcp)<br>
> >><br>
> >> The socket active mode is a simulation of gen_tcp active mode<br>
> >> (no active = N).<br>
> >><br>
> >> The tables are the exchange from the client side.<br>
> >><br>
> >> With server side using gen (active = false):<br>
> >><br>
> >> Transport Active Data<br>
> >> gen false 10192 byte/ms, 154 msgs/ms<br>
> >> gen true 10383 byte/ms, 157 msgs/ms<br>
> >> gen once 6003 byte/ms, 90 msgs/ms<br>
> >> sock false 14050 byte/ms, 212 msgs/ms<br>
> >> sock true 14772 byte/ms, 223 msgs/ms<br>
> >> sock once 14050 byte/ms, 210 msgs/ms<br>
> >><br>
> >><br>
> >> With server side using gen (active = true):<br>
> >><br>
> >> Transport Active Data<br>
> >> gen false 9447 byte/ms, 143 msgs/ms<br>
> >> gen true 22345 byte/ms, 338 msgs/ms<br>
> >> gen once 5532 byte/ms, 83 msgs/ms<br>
> >> sock false 15316 byte/ms, 232 msgs/ms<br>
> >> sock true 23693 byte/ms, 358 msgs/ms<br>
> >> sock once 22068 byte/ms, 334 msgs/ms<br>
> >><br>
> >><br>
> >> With server side using sock (active = false, async = true):<br>
> >><br>
> >> Transport Active Data<br>
> >> gen false 11260 byte/ms, 170 msgs/ms<br>
> >> gen true 22273 byte/ms, 337 msgs/ms<br>
> >> gen once 7703 byte/ms, 116 msgs/ms<br>
> >> sock false 15211 byte/ms, 230 msgs/ms<br>
> >> sock true 24778 byte/ms, 375 msgs/ms<br>
> >> sock once 23086 byte/ms, 349 msgs/ms<br>
> >><br>
> >><br>
> >> With server side using sock (active = true, async = true):<br>
> >><br>
> >> Transport Active Data<br>
> >> gen false 11351 byte/ms, 171 msgs/ms<br>
> >> gen true 22469 byte/ms, 340 msgs/ms<br>
> >> gen once 7407 byte/ms, 112 msgs/ms<br>
> >> sock false 15484 byte/ms, 234 msgs/ms<br>
> >> sock true 24885 byte/ms, 377 msgs/ms<br>
> >> sock once 23570 byte/ms, 357 msgs/ms<br>
> >><br>
> >><br>
> >> There is of course a bit of overhead since the socket transport<br>
> >> is trying to emulate (part of) gen_tcp.<br>
> >><br>
> >> This is run on a Dell Precision T1700 running SLES 12 SP2 (not that<br>
> >> that effects the relative performance).<br>
> >> Run with a snapshot from the maint branch.<br>
> >><br>
> >> This is obviously not a real use case, but it can be a guideline.<br>
> >> Also no UDP test (at the moment).<br>
> >><br>
> >> /BMK<br>
> >><br>
> >> On 2019-10-24 18:48, Frank Muller wrote:<br>
> >>> Hi Thomas<br>
> >>><br>
> >>> Is the socket module faster than gen_tcp/gen_udp in your case? If yes, can you please share<br>
> some<br>
> >>> numbers.<br>
> >>><br>
> >>> /Frank<br>
> >>><br>
> >>> > case socket:recvfrom(Sock, 0, nowait) of<br>
> >>> > {ok, {#{family := Domain,<br>
> >>> > port := Port,<br>
> >>> > addr := Addr}, Data}} -><br>
> >>> > .<br>
> >>><br>
> >>> Hi Micael, Mark,<br>
> >>><br>
> >>> thanks for your replies. The snippet above helped me getting the record<br>
> >>> matched.<br>
> >>><br>
> >>> I'm quite impressed with the socket module, it seems to be pretty<br>
> >>> complete, at least for my application.<br>
> >>><br>
> >>> Thanks,<br>
> >>> Thomas<br>
> >>><br>
> ><br>
> <br>
</blockquote></div>