Re: Design question

From: Willy Tarreau <w#1wt.eu>
Date: Fri, 1 May 2009 16:42:22 +0200


On Mon, Apr 27, 2009 at 02:38:27PM +0200, Dragan Zubac wrote:
> Hello
>
> 1. You said Your design is to use single-process event-driven
> architecture. Could You just give some info about the design of backend
> workers or callback that are called when an event occur ? Do You use
> fork(),pthreads or something else to achieve concurency among things
> that are supposed to be done at 'the-same-time' ?

an event-driven model consists in processing events as soon as they happen, and in very small and fast operations. For instance, it consists in reading data from a socket and storing it into a buffer, then calling a function to process those data. You should look around for more information about the "poll" system call and what is called "non-blocking I/O".

> 2. Is You software capable to handle 'long-lasting' TCP connections,for
> example far-end clients are supposed to connect to backend servers,they
> need to keep those TCP sockets open for a long time,and occasionally
> send/receive some data on those sockets ?

Yes, of course. You just have to configure large enough timeouts to ensure that connections will not be closed before your application speaks. What type of problem are you foreseeing with long-lasting TCP connections ?

Regards,
Willy Received on 2009/05/01 16:42

This archive was generated by hypermail 2.2.0 : 2009/05/01 16:45 CEST