public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "Øyvind Harboe" <oyvind.harboe@zylin.com>
To: ecos-discuss@ecos.sourceware.org
Cc: "Anthony Tonizzo" <atonizzo@gmail.com>
Subject: [ECOS] Idle timeout and maximum # of sockets for athttpd
Date: Thu, 13 Dec 2007 14:33:00 -0000	[thread overview]
Message-ID: <c09652430712130153r376ca740w654727269f92bb05@mail.gmail.com> (raw)

> > I don't quite understand CYG_HTTPD_SOCKET_IDLE_TIMEOUT
> > in detail, but it is hardwired to 300 seconds which appears to be
> > rather long for the default maxim # sockets (16).
>
> The time of 5 minutes before an inactive socket is closed was
> chosen without much concern to the maximum number of
> sockets. Its intentions were mainly to close sockets that have
> been inactive for more than 5 minutes, regardless of the reason:
> In other words I felt that with persistent connections (and very
> few sockets available to begin with) it is important to reclaim
> any and all resource you might think are not actively used.
>
> The sockets might be dead, or the user of the client might just be
> enjoying a sandwich before she comes back surfing: Either way
> if the socket is idle for 5 minutes I want to be able to reclaim it for
> connections that actually carry some traffic.
>
> We can make a case for making this a CDL option..

I hate options :-) I guess if it was to be an option I would like to
have a minimize # of
sockets option.

> > Could CYG_HTTPD_SOCKET_IDLE_TIMEOUT be set to 0?
> > What would happen?
>
> I can interpret this question two ways:
>
> 1) CYG_HTTPD_SOCKET_IDLE_TIMEOUT equal 0 means that
> there is no timeout (i.e. remove the call to
> cyg_httpd_close_unused_sockets(). In this case the sockets will
> be opened forever. You are now at the mercy of the stack to
> determine that a socket is dead. Might work, but I have not
> experimented with it. Now, your delay is even more hardcoded
> (this time inside the stack itself.)
> 2) CYG_HTTPD_SOCKET_IDLE_TIMEOUT is active and equal 0
> in which case, with the current code you would effectively resort
> to closing each connection after the request was served. In other
> words, you void the advantages of persistent connections by
> reverting to HTTP 1.0. If you think 16 sockets are not enough
> with persistent connections you will hate the alternative, where a
> single web page with a lot of pictures can exhaust the number of
> sockets.

Is there a reason I would not want to minimize the # of sockets used?
I guess athttpd would
typically be used for some sort of logging/configuration server.
Performance is not so
much an issue at that point.

The minimum # of sockets would then presumably be with
CYG_HTTPD_SOCKET_IDLE_TIMEOUT  being somewhat near the length
of processing a request. 5 seconds seems like a reasonable default at
that point...


-- 
Øyvind Harboe
http://www.zylin.com - eCos ARM & FPGA  developer kit

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

             reply	other threads:[~2007-12-13  9:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-13 14:33 Øyvind Harboe [this message]
2007-12-13 15:24 ` [ECOS] " Anthony Tonizzo
2007-12-13 15:33   ` Øyvind Harboe
2007-12-17 16:03     ` Tom Deconinck
  -- strict thread matches above, loose matches on Subject: below --
2007-12-12 11:07 [ECOS] " Øyvind Harboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c09652430712130153r376ca740w654727269f92bb05@mail.gmail.com \
    --to=oyvind.harboe@zylin.com \
    --cc=atonizzo@gmail.com \
    --cc=ecos-discuss@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).