this is an effect of the following (examples for "write", the same applies for "read")... in the client.py, ThrottlingStorageClient has...
def write(self, data): """Transport API to capture bytes written."""
if self.factory.client is self: self.factory.registerWritten(len(data)) StorageClient.write(self, data)
...that writes whatever data it got, and just tells the throttler the amount of data written. So, if the limit is X bytes per second, and twisted wants to write 10*X, it just writes that (probably saturating the tcp link), and then the throttler waits 9 seconds more to be below the limit.
The way to fix this is not write the whole amount at once, but mix that with the throttling scheme.
this is an effect of the following (examples for "write", the same applies for "read")... in the client.py, ThrottlingStora geClient has...
def write(self, data):
"""Transport API to capture bytes written."""
self. factory. registerWritten (len(data) )
StorageClient. write(self, data)
if self.factory.client is self:
...that writes whatever data it got, and just tells the throttler the amount of data written. So, if the limit is X bytes per second, and twisted wants to write 10*X, it just writes that (probably saturating the tcp link), and then the throttler waits 9 seconds more to be below the limit.
The way to fix this is not write the whole amount at once, but mix that with the throttling scheme.