> -----Ursprüngliche Nachricht----- > Von: Christophe JAILLET > Gesendet: Freitag, 14. Februar 2014 21:39 > An: dev@httpd.apache.org > Betreff: APR_FOPEN_BUFFERED and small files > > Hi, > > when a file is opened using apr_file_open with the flag > APR_FOPEN_BUFFERED, a 4096 bytes buffer is allocated in the pool. > 4096 is the half of a "pool block", so it often leads to the allocation > of a new 8k block. > > When opening .htaccess files, the APR_FOPEN_BUFFERED flag is set but in > most cases, I think that this file is much smaller than 4096 bytes. > This lead to potentially allocating much more memory than useful in the > request pool. > > > Do you think it would be interesting to teach apr_file_open to allocate > max(size of the file, 4096) when opening small files with
You mean min(size of the file, 4096) ? > APR_FOPEN_BUFFERED set ? > I expect .htaccess file to be a few hundreds of byte. So this would save > ~ 3 ko in the request pool. > > CJ Regards Rüdiger