Chase Douglas wrote:
I have a question about the implementation of sendfile. In my current configuration of a server, when requests are made for a file, a new thread is spawned and sendfile is called to complete the request (We realize that spawning a thread for every request is a bad way to do this, but that's just our current situation). If I am serving many requests concurrently, and I try to send about 3 MB of each request at a time through sendfile, and assuming that the speed of each connection is sufficient, would each sendfile send all 3 MB at once, or would each call try to send maybe 512 KB, then another 512 KB, then another 512 KB and so on? If it is the latter, then would it be that each thread might be switched after only 512 KB of data is sent from a file?

IIRC, sendfile() will behave rather like say send() - the call will block until all the data is in the socket buffer, it will "put" as much data as it can into the socket at a time, subject to the socket being "full." TCP will then put as much of that data onto the network as it can, bound by the constraints of his calculated congestion window and the remote's advertised receive window.

rick jones
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to