[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [Libevent-users] Hard-coded limit on read/write data size?
- To: libevent-users@xxxxxxxxxxxxx
- Subject: Re: [Libevent-users] Hard-coded limit on read/write data size?
- From: Nick Mathewson <nickm@xxxxxxxxxxxxx>
- Date: Tue, 26 Oct 2010 22:51:37 -0400
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Tue, 26 Oct 2010 22:51:45 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=YMI3M9uK9VlCa1aiqecQ7bGmDU73R0Z78F+H4nmI5ZU=; b=JIulWXUZm18V9YmqhmjXg6QE4uk8TrKMXArprni5AZHgLJacdTAanC2SCuBOcdsFQT gZuCJuAqhDm4tyFtN01gft+Eay2lP0QpW5GDShjmsHHaKGj1mCguvCa5g3xPHcoyCHe8 jUd5WU1czioyRXbvOpxtUuTg3emZ9tu2eH+TI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=Wt1bwLLSh+EepL5/oPW5w3SEzjjciqENnA4Z58MRjFjVyxLVgxAsiJLFGy6Ku+RcOB 5jrKpXHBVDGcZdCInatUuKbd2TcX7vccWnMYBayjM21qgnfBiMRUgqKoIa5hCcZuYkxL kO/O3v1rMIZ4nyvXXgUDwtzh+erPEtQ1pP6mU=
- In-reply-to: <533323.92841.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- References: <533323.92841.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
On Thu, Oct 14, 2010 at 12:26 AM, Raine Fan <rainefan@xxxxxxxxx> wrote:
> Hi, I'm programming a libevent2 based app that measures read/write
> efficiency from a remote (TCP) server using event based paradigms.
> Since I'm new to libevent's and event based paradigm, I'm also using
> 'buffervevent' and 'evbuffer' interfaces to gather and push data onto
> sockets instead of plain old read/write syscalls.
> My app is being limited by (it seems) a hardcoded limit of 4096 bytes when i
> fully drain a evbuffer on a single call. Instead, i would like to know if
> there is any special function/interface to modify this limit.
> I know there is a specialized call 'bufferevent_setwatermark(...)' and even
> rate limit interfaces, that would allow a read or write event be dispatched
> to my callback whenever a low/high watermark level was being reached. The
> problem is that when using this kind of calls, libevent core aggregate and
> wait until this limit comes true what would confuse the stats i'm measuring,
> and also would not be as efficient as changing the read/write data len
> bucket directly and getting more data in a single roll/call (this premise is
> for my study case).
> Is any other interface available on libevent 2.0 that would allow to change
> this 4096 byte limit? If not, would be possible including it on the 2.0
> release timeframe?
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.
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.
yrs,
--
Nick
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.