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
asynchat push always sends 512 bytes (ignoring ac_out_buffer_size) #46345
Comments
In asynchat, 'push' doesn't specify 'buffer_size', so the default of 512 |
ac_out_buffer_size value is already used when sending data. def initiate_send (self):
obs = self.ac_out_buffer_size
...
if self.ac_out_buffer and self.connected:
try:
num_sent = self.send (self.ac_out_buffer[:obs])
... |
The value is used there, but this is not effective in causing larger In addition, I see at least one other place in the code where the Looking at the big picture, though, I don't understand why we're trying (In my application, send's of size >200K are regularly succeeding, as |
Sorry, you're right.
Where? Aside from simple_producer.__init__ I don't see other places |
The other place I see the constant is in asyncore.py: class dispatcher_with_send(dispatcher):
def __init__(self, sock=None, map=None):
dispatcher.__init__(self, sock, map)
self.out_buffer = ''
def initiate_send(self):
num_sent = 0
num_sent = dispatcher.send(self, self.out_buffer[:512])
self.out_buffer = self.out_buffer[num_sent:] This code seems to be undocumented and perhaps unused, but until/unless |
I know nothing about asyncore. Does this problem still exist in the |
[Tracker bounced this the first time...]
|
As discussed on python-dev patch bpo-1736190 should be committed before |
When push is called in the current trunk (as of 2.6), the data is In order to force the use of the asynchat.simple_producer class (which Closing as out of date. |
Just to confirm, the real problem here was that tiny packets were being Looking at the code, it appears that the change by Josiah Carlson Should that 4096 be larger? MTU for jumbo packets is ~9000, I think, Also, there are still two constants '512' in asyncore/asynchat. |
In my experience I noticed that 65536 is a pretty good compromise, at |
The spare 512 values are for code that I expect no one is actually In terms of increasing the buffer size from 4096 to something larger, Considering how easy it is to adjust, and considering that the value is |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: