Re: optimizing sendfile

1 view
Skip to first unread message

Alan Menegotto

unread,
Apr 27, 2007, 6:15:29 PM4/27/07
to Yaar, kernel...@nl.linux.org
On 3/28/07, Yaar <ya...@pando.com> wrote:
> Hi,
>
> How can I control the size of the block requests the sendfile() syscall performs
> against the disk?
>
> I'm using sendfile to copy 1M file chunks into a socket. The socket send buffer
> size is 2M, and I verify that its empty before making the call. Indeed, 1M chunk
> is being sent, but from iostat, I can tell that the average request size is
> around 128K.
>
> Help will be appreciated.
>
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to eca...@nl.linux.org
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>

Some questions:

- Have you tried to use the TCP_CORK feature? According to the
sendpage man page you can use it to fine tune the transmission;

- Have you tried to increase the sending and receiving output thru'
the SO_SNDBUF and SO_RCVBUF setsockopt parameters?

--
Best Regards

Alan Menegotto

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to eca...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

Yaar Schnitman

unread,
May 1, 2007, 6:56:28 PM5/1/07
to Alan Menegotto, kernel...@nl.linux.org
Hi Alan,

> - Have you tried to use the TCP_CORK feature? According to the
> sendpage man page you can use it to fine tune the transmission;
Yes, I tried that, but it didn't change the read sizes.

> - Have you tried to increase the sending and receiving output thru'
> the SO_SNDBUF and SO_RCVBUF setsockopt parameters?
Yes, I use 2MB send and receive buffer sizes, which is 4x times the size
of the read operations I intend to do, but it does not change the file
system read sizes either, which are still ~128K.
Reply all
Reply to author
Forward
0 new messages