You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Randall Stewart <ra...@stewart.chicago.il.us> on 2002/11/01 17:58:04 UTC

Patch for listen.c

Hi all:

Attached is a patch to add support for SCTP to apache for those
O/S's that have it.

Now a note about this patch..

The idea behind this is that SCTP is automatically enabled if
available... i.e. there is no flag to turn it on/off.. if you say
listen 80

and have sctp.. you get a listener on both TCP and SCTP port 80.

Now the reason I picked this method is:

a) A port/socket listening is a small amount of overhead...
b) TCP and SCTP are both congestion controlled protocols so
    there should be no threat to the stability of the Big I due
    to the use of SCTP and http (unlike using http with UDP).
c) It seemed like a logical thing to do :-)

Now I suppose the alternative is to expand the config file with
a

listen,tcp: 80
listen,sctp: 80

etc...

But this seemed a bit overkill to avoid listening on one additional
socket...

Comments would be most welcome..

R
-- 
Randall R. Stewart
randall@stewart.chicago.il.us 815-342-5222 (cell phone)

Re: Patch for listen.c

Posted by Jeff Trawick <tr...@attglobal.net>.
Randall Stewart <ra...@stewart.chicago.il.us> writes:

> hmmm so what I think you are saying is that if only one
> port is listened to all children can do a poll() on the sd otherwise
> you must have only one thread to the poll() I guess so it could
> dispatch out the work...

Bill answered this.

> Do you suggest then a
> 
> Listen, tcp:80
> Listen, sctp:80
> 
> type syntax... or what would be the format wanted in the config...

I would suggest following/participating in this thread:

  multiple protocols - Patch for listen.c

I haven't had a chance to look over the conversation yet.

-- 
Jeff Trawick | trawick@attglobal.net
Born in Roswell... married an alien...

RE: Patch for listen.c

Posted by Bill Stoddard <bi...@wstoddard.com>.
> Jeff Trawick wrote:
> > Randall Stewart <ra...@stewart.chicago.il.us> writes:
> >
> >
> >>The idea behind this is that SCTP is automatically enabled if
> >>available... i.e. there is no flag to turn it on/off.. if you say
> >>listen 80
> >>and have sctp.. you get a listener on both TCP and SCTP port 80.
> >>
> >>Now the reason I picked this method is:
> >>
> >>a) A port/socket listening is a small amount of overhead...
> >
> >
> > unfortunately, it can be meaningful overhead, enough so that IMHO it
> > isn't reasonable to enable SCTP automatically
> >
> > when Apache has more than one listening socket, it is forced to poll()
> > in addition to accept(), and the use of poll() prior to accept() means
> > it has to serialize all threads/processes such that only one is in
> > poll() at a time
>
> hmmm so what I think you are saying is that if only one
> port is listened to all children can do a poll() on the sd otherwise
> you must have only one thread to the poll() I guess so it could
> dispatch out the work...
>

If you are only listening to one port, you can can skip the poll() and have all
threads block on the accept().  poll(), unlike accept(), does not work correctly
if you allow multiple threads to call it.

Bill



Re: Patch for listen.c

Posted by Randall Stewart <ra...@stewart.chicago.il.us>.
Jeff Trawick wrote:
> Randall Stewart <ra...@stewart.chicago.il.us> writes:
> 
> 
>>The idea behind this is that SCTP is automatically enabled if
>>available... i.e. there is no flag to turn it on/off.. if you say
>>listen 80
>>and have sctp.. you get a listener on both TCP and SCTP port 80.
>>
>>Now the reason I picked this method is:
>>
>>a) A port/socket listening is a small amount of overhead...
> 
> 
> unfortunately, it can be meaningful overhead, enough so that IMHO it
> isn't reasonable to enable SCTP automatically
> 
> when Apache has more than one listening socket, it is forced to poll()
> in addition to accept(), and the use of poll() prior to accept() means
> it has to serialize all threads/processes such that only one is in
> poll() at a time

hmmm so what I think you are saying is that if only one
port is listened to all children can do a poll() on the sd otherwise
you must have only one thread to the poll() I guess so it could
dispatch out the work...


> on most current OSs, this serialization is not necessary when there is
> only one listening socket
> 

Do you suggest then a

Listen, tcp:80
Listen, sctp:80

type syntax... or what would be the format wanted in the config...

I will find some cycles soon and dig into the config but I would like
a pointer to what would be the right choice...



-- 
Randall R. Stewart
randall@stewart.chicago.il.us 815-342-5222 (cell phone)


Re: Patch for listen.c

Posted by Jeff Trawick <tr...@attglobal.net>.
Randall Stewart <ra...@stewart.chicago.il.us> writes:

> The idea behind this is that SCTP is automatically enabled if
> available... i.e. there is no flag to turn it on/off.. if you say
> listen 80
> and have sctp.. you get a listener on both TCP and SCTP port 80.
> 
> Now the reason I picked this method is:
> 
> a) A port/socket listening is a small amount of overhead...

unfortunately, it can be meaningful overhead, enough so that IMHO it
isn't reasonable to enable SCTP automatically

when Apache has more than one listening socket, it is forced to poll()
in addition to accept(), and the use of poll() prior to accept() means
it has to serialize all threads/processes such that only one is in
poll() at a time

on most current OSs, this serialization is not necessary when there is
only one listening socket

-- 
Jeff Trawick | trawick@attglobal.net
Born in Roswell... married an alien...