Linus Meierhoefer
unread,Jul 11, 2023, 11:18:10 AM7/11/23Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Cap'n Proto
Hi,
I am trying to setup an rpc server in order to integrate it into my custom publisher-subscriber library. For this I need a flow control mechanism that doesn't depend on individual streams but on a global disk writing speed. That is: The flow limit should adapt to the in-flight-bytes of the disk IO. Moreover, if the flow limit is exceeded the rpc server should effectively stop reading packets from client sockets, pushing the backpressure logic to TCP. This should prevent memory overhead for the broker when a publisher tries to flood the server.
I saw that there is flow control logic implemented in capnp but wonder how it actually operates? The header-documentation of RPCSystem says that "the RpcSystem will not read further messages from the stream" but does this imply that these overflow messages will reside in the sockets buffer and don't get transferred to the receivers memory? And how is backpressure implemented then?
If the default flow control logic does not fit my use case, I guess I have to setup a custom event loop that stops polling from sockets fds when the disk flow limit is exceeded.
It would be really helpful if you could share some of your knowledge.
Thanks in advance