Welcome! Log In Create A New Profile

Advanced

Is sendfile_max_chunk needed when using aio on FreeBSD 9?

Maxim Khitrov
February 08, 2012 07:52AM
Hi all,

Following Igor's advice [1], I'm using the following configuration for
file handling on FreeBSD 9.0 amd64:

sendfile on;
aio sendfile;
tcp_nopush on;
read_ahead 256K;

My understanding of this setup is that sendfile, which is a
synchronous operation, is restricted to sending only the bytes that
are already buffered in memory. Once the data has to be read from
disk, sendfile returns and nginx issues a 1-byte aio_read operation to
buffer an additional 256 KB of data.

The question is whether it is beneficial to use sendfile_max_chunk
option is this configuration as well? Since sendfile is guaranteed to
return as soon as it runs out of buffered data, is there any real
advantage to further restricting how much it can send in a single
call?

By the way, is tcp_nopush needed here just to make sure that the first
packet, which contains headers, doesn't get sent out without any data
in it? I think this would also prevent transmission of partial packets
when sendfile runs out of data to send and nginx has to wait for the
aio_read to finish. Wouldn't it be better in this case to send the
packet without waiting for disk I/O?

- Max

[1] http://mailman.nginx.org/pipermail/nginx/2011-May/026651.html

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Is sendfile_max_chunk needed when using aio on FreeBSD 9?

Maxim Khitrov February 08, 2012 07:52AM

Re: Is sendfile_max_chunk needed when using aio on FreeBSD 9?

Maxim Dounin February 08, 2012 08:48AM

Re: Is sendfile_max_chunk needed when using aio on FreeBSD 9?

Maxim Khitrov February 08, 2012 09:50AM

Re: Is sendfile_max_chunk needed when using aio on FreeBSD 9?

Maxim Dounin February 08, 2012 10:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 161
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready