I send a patch again the last CVS version. The changes are: - Configurable prebuffer, in seconds. - prebuffering parameter in configurable in <limits>...<prebuffer>seconds</prebuffer>... - Created a new function (send_client_queue) to send the client->queue. Better modularisation. - Moved queue_lenght verification to send_client_queue(). - instead of disconnecting when the client-queue > 25, it discards packages wich are older than prebuffer*2 (maxlag, in seconds). All clients I tried have recovered very well. - To avoid stalled connections, they are closed if the last package was sent before maxlag*2 (in seconds, which is prebuffer*4). - The server didn't check for the status of the client's socket before the unblocking send(). This caused a disconnection at a minimun network congestion, causing a broken pipe error (Linux 2.4 behaviour?) in the network. I've just added a poll in sock.c. - Added TCP_NODELAY to a nonblocking socket. It is said that it's improve performance in Linux. TODO: check Win32 compatibility. - Solved a bug in source.c, when checking for recoverable error. It has to be done _only_ when result < 0. <p>I was very careful checking connection and memory leaks, the maximum RSS reported by ps is 1288 KB (after running several days). 000 0 4500 1 9 0 10768 1288 select S ? 0:16 /usr/bin/icecast2 -c /etc/icecast/icecast.xml 040 0 4501 4500 9 0 10768 1288 poll S ? 0:00 /usr/bin/icecast2 -c /etc/icecast/icecast.xml 040 0 4506 4501 10 0 10768 1288 select S ? 0:18 /usr/bin/icecast2 -c /etc/icecast/icecast.xml 040 0 4507 4501 9 0 10768 1288 rt_sig S ? 0:00 /usr/bin/icecast2 -c /etc/icecast/icecast.xml 040 0 4508 4501 9 0 10768 1288 rt_sig S ? 0:00 /usr/bin/icecast2 -c /etc/icecast/icecast.xml 040 0 4514 4501 10 0 10768 1288 select S ? 0:40 /usr/bin/icecast2 -c /etc/icecast/icecast.xml <p>Regards, -- ricardo "I just stopped using Windows and now you tell me to use Mirrors?" - said Aunt Tillie, just before downloading 2.5.3 kernel. -------------- next part -------------- A non-text attachment was scrubbed... Name: patch2.diff Type: text/x-diff Size: 12878 bytes Desc: patch2.diff Url : http://lists.xiph.org/pipermail/icecast-dev/attachments/20020223/88dc822d/patch2.bin
> - Configurable prebuffer, in seconds. > > - prebuffering parameter in configurable in > <limits>...<prebuffer>seconds</prebuffer>...We're in the process of redoing some of this. We will prebuffer some etc, so in the end this functionality will be there. I apologize that this patch won't get applied for that reason.> - Created a new function (send_client_queue) to send the client->queue. > Better modularisation.This is a good idea, and one I figured would get done. I'll take a look at this closer.> - The server didn't check for the status of the client's socket before the > unblocking send(). This caused a disconnection at a minimun network > congestion, causing a broken pipe error (Linux 2.4 behaviour?) in the > network. I've just added a poll in sock.c.Can you send me this patch alone? I still can not tell what you're doing, as no one else has reported these kinds of problems.> - Added TCP_NODELAY to a nonblocking socket. It is said that it's improve > performance in Linux. TODO: check Win32 compatibility.What's it supposed to do in general? I've had varying success with the advanced socket options.> - Solved a bug in source.c, when checking for recoverable error. It has to > be done _only_ when result < 0.Can I see this patch separate too?> I was very careful checking connection and memory leaks, the maximum RSS > reported by ps is 1288 KB (after running several days).Which I assume means you didn't find any :) In normal operation, I think we're fine. I suspect there may be a few on the error conditions (ie, you'll se a leak if you do 10000000 bad header connections or something). I plan to test this more thoroughly. jack. --- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
On 24/02/02 05:02, Jack Moffitt shaped the electrons to say:> > - The server didn't check for the status of the client's socket before > > the unblocking send(). This caused a disconnection at a minimun network > > congestion, causing a broken pipe error (Linux 2.4 behaviour?) in the > > network. I've just added a poll in sock.c.> > Can you send me this patch alone? I still can not tell what you're > doing, as no one else has reported these kinds of problems.It the first problem I found when I started to use the server and the reason I began to modify it. The patch is sock.diff> > - Added TCP_NODELAY to a nonblocking socket. It is said that it's improve > > performance in Linux. TODO: check Win32 compatibility. > > What's it supposed to do in general? I've had varying success with the > advanced socket options.Turn the Nagle algorithm off, so there it doesn't introduce delays (although it can generate more messages). Should be tested in severeal conditions. <p>> > - Solved a bug in source.c, when checking for recoverable error. It has> > to be done _only_ when result < 0. > > Can I see this patch separate too?No completely because I moved part of it to the new send_queue() function, but basically is: - if (!sock_recoverable(bytes)) { + if (sbytes < 0 && !sock_recoverable(bytes)) { <p><p><p>> > I was very careful checking connection and memory leaks, the maximum RSS> > reported by ps is 1288 KB (after running several days). > > Which I assume means you didn't find any :)Nope. <p> -- ricardo "I just stopped using Windows and now you tell me to use Mirrors?" - said Aunt Tillie, just before downloading 2.5.3 kernel. -------------- next part -------------- A non-text attachment was scrubbed... Name: sock.diff Type: text/x-diff Size: 2292 bytes Desc: sock.diff Url : http://lists.xiph.org/pipermail/icecast-dev/attachments/20020224/fb5b482e/sock.bin