[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] Hard-coded limit on read/write data size?



Hi Nick! Thanks for answering!

>Ugh.  It looks like you're running into EVBUFFER_MAX_READ, defined in
>buffer.c .  You can edit the source and redefine it as high as you
>want, but there's no way to change it programmatically right now.  I'd
>love to make the "how much to read or write" logic more -- well,
>logical -- in the future, but as the code stands now I'm worried that
>fiddling with it now in 2.0 would break somebody, somewhere.

Yes, indeed i've found another limiting factor besides EVBUFFER_MAX_READ.
On bufferevent_ratelim.c there is another limit called MAX_TO_READ_EVER with default value 16384 bytes.
To make an analogy, EVBUFFER_MAX_READ would be a soft limit and MAX_TO_READ_EVER a hard limit.

>You could pretty easily also turn it from a macro into a static
>variable, and add a function to set it.  I'd be leery of doing that in
>the main codebase right now, since it's not the right interface
>long-term.  In 2.1, I think the answer is for somebody take the risk
>and refactor the "how much to read or write" logic entirely, probably
>removing the notion of EVBUFFER_MAX_READ along the way.

I edited those values and compiled again to make some tests, but i don't know why my memory usage during the simulation went up to quickly making my computer swap ;(

I don't know if there is some leak inside libevent or these values are the base of internal allocation, but it's very dangerous touching those values right now. I prefer, by now, stick with old plain read/write syscalls instead buffervent for my test purpose.

It would be great to modify during runtime the read/write data packet size window using bufferevent and evbuffer facility!

Thanks again for all your support!

Best regards,
Raine