Re: http webserver using select()



Hubble wrote:
Nils O. Selåsdal wrote:
Nils O. Selåsdal wrote:
Thr wrote:
Hi,

I read some books about network programming..
Still, I have some questions:

1. let's assume that we have http server written using nonblocking i/o
and select().
How is it possible to server many requests simultaneously?

I mean - we have, for example, static binary file that is 700 MB long
(and many other, much smaller files, that are, for example, html
webpages)
.
Let's assume that server found new socket descriptor with select(), and
accepted it..
after receiving data from client, and after parsing request header we
found that he want this big file, and we started to send him chunks of
data..

I think that this situation should block sending data for other
clients, does it (until this 700 MB file is send) ?
Depends on how you program the thing.

What one usually does is place the fd(set it to nonblocking first) in
the write set for select.
"usual" was perhaps not the best word here. For such servers it's
also common to fork a child or spawn a thread that handles each client.

AFAIK, squid (www.squid-cache.org) is a famous example which does use
neither thread nor fork and achieves very good performance.

Yaws is a better one, but performance wasn't my point :-)

For some applications you do need a seperate execution path per
client, as backends (e.g. PHP) that runs in the same process as
the serving one can do blocking calls.

.



Relevant Pages

  • Re: Embedded Software Engineers, needed in Seattle
    ... One of our client companies in Seattle, ... Create editor for NFN content and server application to import content ... Test server for applications relating to each of the aforementioned ... Experience with being part of a creativity workforce and programming ...
    (comp.arch.embedded)
  • Embedded Software Engineers, needed in Seattle
    ... One of our client companies in Seattle, ... Create editor for NFN content and server application to import content ... Test server for applications relating to each of the aforementioned ... Experience with being part of a creativity workforce and programming ...
    (comp.arch.embedded)
  • Re: Global variable
    ... Hope this help you ruca "Patrice" escreveu na mensagem ... > ASP.NET simulates the usual statefull event driven programming model but> it's worth to note that the server side "model" and what you have client> side is not the same "thing". ... The server side "model" is used to create the> client side code that will reproduce what> you modelled server side. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: http webserver using select()
    ... I read some books about network programming.. ... let's assume that we have http server written using nonblocking i/o ... How is it possible to server many requests simultaneously? ... sent to the client. ...
    (comp.unix.programmer)
  • Re: remote desktop in solaris
    ... that use solaris as server and linux suse 10.3 as client. ... tell us to do remote programming, ...
    (comp.unix.solaris)

Loading