cloudflare / quiche

🥧 Savoury implementation of the QUIC transport protocol and HTTP/3
https://docs.quic.tech/quiche/
BSD 2-Clause "Simplified" License
9.4k stars 709 forks source link

Is it possible to limit the rate of a stream? #1354

Open keepsimple1 opened 1 year ago

keepsimple1 commented 1 year ago

I'm using quiche to run a QUIC/H3 server. Sometimes we wanted to rate limit (say, at most 2Mbps) a stream (Http POST) from a client, is it possible with quiche?

LPardue commented 1 year ago

Flow control is given back to the peer (in your example the client) when the application reads data via stream_recv. So you can rate limit a stream by managing your read rate in the application.

keepsimple1 commented 1 year ago

In this case I'm focusing on POST requests from the client, which uploads big files to the server. The client will also be using quiche. Is there something in quiche API to set max rate (via pacing maybe?) for the upload in the client?

Or did you mean any rate limit can only be done in application itself?