Closed appetito closed 8 years ago
Hello @appetito,
this code is a sample on how to do some RPC using asyncio, but imho it's not good enough:
The client waits on yield from self.waiter.wait()
so your code is not really async :(
The client call
function should return an ayncio.Future()
with the expected result, then you probably want to do an ayncio.wait([futures...])
that will return when all futures are completed.
Hi @dzen, the problem is that the Nagle algorithm is enabled by default for socket. You can see another discussion here.
Confirming. On my laptop, disabling Nagle boosts the performance of your sample clients from 25 req/s to about 1600 req/s. Definitely a nice improvement. Will push a fix ASAP.
hi!
i have modified rpc server aand client and they are very slow:
Client - sends requests in infitite loop:
Server - no calculations, just echo:
And i have only 25 requests per second
Why so slow? why exactly 25?
Thanks