perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Gifford <sgiff...@suspectclass.com>
Subject Re: mod_perl Filters: Selecting the most appropriate buffer size
Date Thu, 19 Jul 2012 14:43:09 GMT
On Tue, Jul 10, 2012 at 7:16 AM, Rommel Sharma <rsharma51@sapient.com>wrote:

>  Hi All,****
>
> ** **
>
> I am going through the documentation on mod_perl filters at the link below:
> ****
>
> ** **
>
> http://perl.apache.org/docs/2.0/user/handlers/filters.html****
>
> ** **
>
> ** **
>
> Examples set a buffer size to process the content held in the buffer like:
> ****
>
> ** **
>
> use constant BUFF_LEN => 1024;****
>
> ** **
>
> What is the best approach to reach most optimum buffer size? Is there a
> best practices like guideline here?
>

Not sure about mod_perl specifics, but the tradeoff with buffer sizes is
generally that larger buffers give better overall throughput, at the cost
of more memory and latency.  On a disk, using a number that is a multiple
of the filesystem block size will usually give the best performance.  With
data coming from the network or a script, I don't think it will matter
much.  You can certainly try different values and measure the results, but
anything 1K or more will probably be OK.

Hope this helps,

------Scott.

Mime
View raw message