Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

mod_perl Filters: Selecting the most appropriate buffer size

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


rsharma51 at sapient

Jul 10, 2012, 4:16 AM

Post #1 of 3 (658 views)
Permalink
mod_perl Filters: Selecting the most appropriate buffer size

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?

Thanks,
Rommel.


sgifford at suspectclass

Jul 19, 2012, 7:43 AM

Post #2 of 3 (586 views)
Permalink
Re: mod_perl Filters: Selecting the most appropriate buffer size [In reply to]

On Tue, Jul 10, 2012 at 7:16 AM, Rommel Sharma <rsharma51 [at] sapient>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.


rsharma51 at sapient

Jul 19, 2012, 9:15 PM

Post #3 of 3 (580 views)
Permalink
RE: mod_perl Filters: Selecting the most appropriate buffer size [In reply to]

Scott,

Many thanks for the inputs. This definitely helps. Will be testing out the performance with different buffer size 1K and higher.

Rommel.

From: Scott Gifford [mailto:sgifford [at] suspectclass]
Sent: Thursday, July 19, 2012 8:13 PM
To: Rommel Sharma
Cc: mod_perl list
Subject: Re: mod_perl Filters: Selecting the most appropriate buffer size

On Tue, Jul 10, 2012 at 7:16 AM, Rommel Sharma <rsharma51 [at] sapient<mailto:rsharma51 [at] sapient>> 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.

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.