Global Feed Post Login
Replying to Avatar dpc

BTW. The websocket thing is something I wonder about often. In a use-case with reasonably frequent updates, is it better to have clients hold an active but mostly idle tcp connection (like websocket), or make them do polling, or some long polling?

A proper async IO runtime can probably handle tons of connections at once anyway. 10k, 100k, maybe 1M.

Also with a gossip-like note fetching, it should be feasible to have lots moderately sized relays, without a loss to usability, so maybe worrying too much about scaling vertically a single relay is unnecessary.

Otherwise some client&application level load balancing might fix the problem. Eg when connecting to a relay it answers with a list of keyspace "shards" (possibly overlapping for redundancy), and then connects/queries to the actually node that holds the data. That would allow reasonably simple and flexible scaling of the relays without complex server side load balancing.

Avatar
Dr Maxim Orlovsky 2y ago

Just one note: none of the async runtimes can handle 100k due to POSIX limit on connection number which is 16 bit (number of ports per the underlying physical network card).

Async is a myth. It is nothing more than the threads, with semi-automatic allocation of procedures (“tasks”) over threads. And threads are limited and heavy - just a dozens per async runtime.

Reply to this note

Please Login to reply.

Discussion

No replies yet.