Thread (14 messages) 14 messages, 5 authors, 2005-02-21

Re: many outgoing tcp sockets are slower than a few

From: Lennert Buytenhek <hidden>
Date: 2005-02-21 17:29:43

On Mon, Feb 21, 2005 at 06:17:16PM +0100, Christian Schmid wrote:
quoted
quoted
Outgoing data. I am using sendfile() to send the file on a non-blocking 
socket but the call blocks for 100 ms per socket if I get over 3000 
sockets. Thats causing the massive slowdown in sum. I first thought its a 
disk-issue but I tried with pure-cache data as well and it still blocks.
O_NONBLOCK send() is really nonblocking, but O_NONBLOCK sendfile()
really isn't, as it still does the disk read (if any) synchronously.

How are you making sure that you're sending "pure-cache data"?
Because thats the first I excluded. I changed the program by replacing 
sendfile with a caching-routine plus syswrite. And it was really 
interesting that the syswrite was the one which needs most of the 
real-time, not the caching-routine. syswrite blocked 100 ms per socket.
'syswrite'.

Is your application written in C or perl?


--L
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help