Re: mod_perl Filters: Selecting the most appropriate buffer size
Scott Gifford <[email protected]>
| Newsgroups | gmane.comp.apache.mod-perl |
|---|---|
| Message-ID | <CADzP0NxcUKEhcgPXXewS4k52XpjgHWPRy2OWDj8qQq8QFU5E4g@mail.gmail.com> |
On Tue, Jul 10, 2012 at 7:16 AM, Rommel Sharma <[email protected]>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.