-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Throttling data transfers #24
Comments
Hello. It's possible to use an async generator as a source of data. I think this should be enough to implement any throttling logic: async def gen(source):
async for chunk in source:
yield chunk
await asyncio.sleep(1) # change to a proper throttling logic here
async with client.put("bucket/file", gen(source)) as resp:
assert resp.status == HTTPStatus.OK |
Hi @rzvoncek the best option as I can imagine is use IP_TOS socket option. These are Linux-specific parameters, and the kernel will ensure that traffic passes through as expected.
For using it you should build |
Thank you both for the quick responses! This gives us something to work with. |
Hello, I'd just like to circle back and clean up after myself. Thanks for hte help once again. |
Hello. In thelastpickle/cassadra-medusa we use the cloud storages a lot. Initially, we built our thing atop libcloud. As the time has passed, it turned out most of the cloud storages are S3-compatible (even GCS). So we we are basically left with S3 and Azure APIs that we need to support.
We stumbled across this S3 client and we like it enough to use it to cover our cloud storage interaction. But we're missing a few features.
Mostly, we would need the capability to throttle data transfers. Medusa is doing backups of a database and we cannot have it exhaust the network capacity.
We have some thoughts on how to tackle this, but none of them are good enough. That's why I'd like to reach out and see if you have any thoughts on how this could be achieved.
The text was updated successfully, but these errors were encountered: