On 20 April 2010 22:02, Willy Tarreau <[email protected]> wrote: > Hi Laurie, > > On Tue, Apr 20, 2010 at 04:45:33PM +0100, Laurie Young wrote: > > Hi Willy > > > > I am sure I want the client timeout :-) > > > > One hostname is for normal http connections, which should disconnect > after a > > short period of client inactivity. > > > > The other hostname is for websockets, which need to be held open even if > the > > client (or server for that matter) sends no data for a long period of > time. > > I don't completely agree. If you consider that the client timeout you want > for websockets is fine and cannot cause any sort of trouble with clients > that disconnect from the net in a dirty way, then there is no reason you > cannot use the same timeout for the other HTTP connections if they come > from the same set of clients, which is apparently the case since you want > to have the same frontend. > > And if you consider that the websockets timeout is too large for regular > HTTP connections (eg: because it may needlessly eat resource with some > problematic clients), then it is too large for the websockets too for > the exact same reason. > > Willy > > There is a required difference in behaviours.
The websocket has to be kept open when there is no data-transfer for some time. So that the connection is still open the server attempts to send data, even if there has been a period of inactivity. This does expose us to dirty connections, but is required for the functionality we need from websockets, and we we have no choice but to accept this - or find a different solution. Normal HTTP connections on the other hand can be re-established by the client when it wants to pull some more data from the server, so we can close it after a period of inactivity. Meaning we can set a lower timeout to kill off dirty connections. Unfortunately I am still no closer to knowing if HAProxy can do this :-( Laurie -- Dr Laurie Young Scrum Master New Bamboo Follow me on twitter: @wildfalcon Follow us on twitter: @newbamboo Creating fresh, flexible and fast-growing web applications is our passion. 3rd Floor, Gensurco House, 46A Rosebery Avenue, London, EC1R 4RP http://www.new-bamboo.co.uk

