Skip to content
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

AsyncIO: Different Server/Client Reader Limits #1196

Closed
drewrisinger opened this issue Nov 19, 2018 · 3 comments
Closed

AsyncIO: Different Server/Client Reader Limits #1196

drewrisinger opened this issue Nov 19, 2018 · 3 comments

Comments

@drewrisinger
Copy link
Contributor

Bug Report

One-Line Summary

Async co-routines have different reader limits. Related: #285

Issue Details

Steps to Reproduce

AsyncioClient:

self.__reader, self.__writer = \
await asyncio.open_connection(host, port, limit=100*1024*1024)

AsyncioServer:

self.server = await asyncio.start_server(self._handle_connection,
host, port,
limit=4*1024*1024)

Expected Behavior

I would expect these limits to be the same. Is there any reason why they aren't? If I'm transferring this much data, is PYON not the right tool and I should use something else (like a client as mentioned in developing an ndsp.rst)

Actual (undesired) Behavior

This caused me some errors when sending large numpy arrays (~2 MB of raw data) via PYON RPC. Actual code is too complex, but changing the AsyncioServer limit to ~16 MB fixed it for me.

@drewrisinger drewrisinger changed the title Different Server/Client Limits AsyncIO: Different Server/Client Reader Limits Nov 19, 2018
@sbourdeauducq
Copy link
Member

No good reason. If you have better numbers, test them, and send a PR, I will merge it.
Note that the two code snippets you mention are not necessarily always talking to each other; the first one is for pc_rpc only whereas the second one factors out some generic asyncio server boilerplate. Look at the file names and not just the class names.

@sbourdeauducq
Copy link
Member

@drewrisinger Did you figure out better numbers and can you send a PR?

@drewrisinger
Copy link
Contributor Author

I used 16 MB for asyncio_server and that worked for my data. Think this is highly data-dependent, and I don't have a good handle on when it's worth increasing the limit vs moving to a different non-PYON protocol. The raw data that the numpy array was constructed from was ~2-4 MB of text, so it makes sense that 4 MB was too tight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants