Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Dev

Httpd 3.0 or something else

 

 

First page Previous page 1 2 3 Next page Last page  View All Apache dev RSS feed   Index | Next | Previous | View Threaded


gstein at gmail

Nov 10, 2009, 3:20 PM

Post #51 of 69 (280 views)
Permalink
Re: Httpd 3.0 or something else [In reply to]

On Tue, Nov 10, 2009 at 17:30, Akins, Brian <Brian.Akins[at]turner.com> wrote:
> On 11/10/09 1:56 PM, "Greg Stein" <gstein[at]gmail.com> wrote:
>
>
>> But some buckets might be performing gzip or SSL encryption. That
>> consumes CPU within the network thread.
>
> You could just run x times CPU cores number of "network" threads.  You can't
> use more than 100% of a CPU anyway.

One of those buckets might (ahem) block on a file read. While it is
doing that, you want to pass control to another bucket.

The buckets should be avoiding indetermine blocks like a socket or a
pipe, we've basically stated that a file is okay. If we had async I/O,
then we'd want to disallow that, too.

Mutexes/semaphores can be used in a bucket, as long as they attempt to
lock with "nowait" semantics.

> The model that some of us discussed -- Greg, you may have invented it ;) --
> was to have a small pool of acceptor threads (maybe just one) and a pool of
> "worker" threads. The acceptor threads accept connections and move them into
> worker threads - that's it.  A single fd is then entirely owned by that
> worker thread until it (the fd) goes away - network/disk io, gzip, ssl, etc.

Those worker threads are what we have today. It means that you have a
1:1 mapping of client connections to threads. That places serious
bounds on your scaling.

I'd like to see a few "network" threads multiplexing all the writing
to clients. Then you have "worker" threads parsing the request and
assembling the response buckets. The resulting buckets might
generate-as-they-go, so the worker thread will complete very quickly.
Or the worker thread could build a response bucket that already has
all of its data, taking a while to do so. It all depends upon the
implementation of the buckets and their construction.

Then take all of *that*, and spread it across several processes for
solid uptime, with a master monitor process.

Cheers,
-g


wrowe at rowe-clan

Nov 10, 2009, 9:11 PM

Post #52 of 69 (277 views)
Permalink
Re: Httpd 3.0 or something else [In reply to]

Graham Leggett wrote:
> - Supporting prefork as httpd does now; and

I'm very happy to see prefork die it's timely death.

Let's go about working out where out-of-process magic happens.
Gated, single threaded handlers may be sensible in some cases.
But for the core server it makes async worthless, and supporting
both digs us deeper into the bad-old-days of the 1.3 codebase.


wrowe at rowe-clan

Nov 10, 2009, 9:17 PM

Post #53 of 69 (277 views)
Permalink
Re: Httpd 3.0 or something else [In reply to]

Greg Stein wrote:
> On Mon, Nov 9, 2009 at 14:21, Paul Querna <paul[at]querna.org> wrote:
>> ...
>> I agree in general, a serf-based core does give us a good start.
>>
>> But Serf Buckets and the event loop definitely do need some more work
>> -- simple things, like if the backend bucket is a socket, how do you
>> tell the event loop, that a would block rvalue maps to a file
>> descriptor talking to an origin server. You don't want to just keep
>> looping over it until it returns data, you want to poll on the origin
>> socket, and only try to read when data is available.
>
> The goal would be that the handler's (aka content generator, aka serf
> bucket) socket would be process in the same select() as the client
> connections. When the bucket has no more data from the backend, then
> it returns "done for now". Eventually, all network reads/writes
> finalize and control returns to the core loop. If data comes in the
> backend, then the core opens and that bucket can read/return data.
>
> There are two caveats that I can think of, right off hand:
>
> 1) Each client connection is associated with one bucket generating the
> response. Ideally, you would not bother to read that bucket
> unless/until the client connection is ready for reading. But that
> could create a deadlock internal to the bucket -- *some* data may need
> to be consumed from the backend, processed, and returned to the
> backend to "unstick" the entire flow (think SSL). Even though nothing
> pops out the top of the bucket, internal processing may need to
> happen.
>
> 2) If you have 10,000 client connections, and some number of sockets
> in the system ready for read/write... how do you quickly determine
> *which* buckets to poll to get those sockets processed? You don't want
> to poll 9999 idle connections/buckets if only one is ready for
> read/write. (note: there are optimizations around this; if the bucket
> wants to return data, but wasn't asked to, then next-time-around it
> has the same data; no need to drill way down to the source bucket to
> attempt to read network data; tho this kinda sets up a busy loop until
> that bucket's client is ready for writing)
>
> Are either of these the considerations you were thinking of?
>
> I can certainly see some kind of system to associate buckets and the
> sockets that affect their behavior. Though that could get pretty crazy
> since it doesn't have to be a 1:1 mapping. One backend socket might
> actually service multiple buckets, and vice-versa.
>
>> I am also concerned about the patterns of sendfile() in the current
>> serf bucket archittecture, and making a whole pipeline do sendfile
>> correctly seems quite difficult.
>
> Well... it generally *is* quite difficult in the presence of SSL,
> gzip, and chunking. Invariably, content is mangled before hitting the
> network, so sendfile() rarely gets a chance to play ball.

This brings us straight back to our discussions from 2000-01 timeframe
when we discussed poll buckets. Pass it up as metadata that we are stalled
on an event (at the socket, ssl, etc) - sometimes multiple events (ext_filter
blocked and either needs to read more from the socket, or was blocked on its
read, or now has something to write).


Basant.Kukreja at Sun

Nov 10, 2009, 10:06 PM

Post #54 of 69 (277 views)
Permalink
Re: Httpd 3.0 or something else [In reply to]

On Tue, Nov 10, 2009 at 05:30:34PM -0500, Akins, Brian wrote:
> On 11/10/09 1:56 PM, "Greg Stein" <gstein[at]gmail.com> wrote:
>
>
> > But some buckets might be performing gzip or SSL encryption. That
> > consumes CPU within the network thread.
>
> You could just run x times CPU cores number of "network" threads. You can't
> use more than 100% of a CPU anyway.
>
> The model that some of us discussed -- Greg, you may have invented it ;) --
> was to have a small pool of acceptor threads (maybe just one) and a pool of
> "worker" threads. The acceptor threads accept connections and move them into
> worker threads - that's it. A single fd is then entirely owned by that
> worker thread until it (the fd) goes away - network/disk io, gzip, ssl, etc.
Sun Web Server (originated from Netscape) (Also Open Web Server) currently
handle this way. It has a pool of acceptor threads which accepts connections,
acceptor threads pushes the connection to a connection queue, worker threads
pulls connection from connection queue and serves the request. Keep alive
daemon is also multi-threaded. So multiple keep alive threads polls for the
various sets of connection for future HTTP requests. The above architecture is
highly scalable. Recently Sun published a specweb record using this Web Server
for 128 CMT threads (32 cores system).
http://www.spec.org/web2005/results/res2009q4/web2005-20091013-00143.txt

You can see the sources from Open Web Server code if you are interested.
http://wikis.sun.com/display/wsFOSS/Open+Web+Server

Regards,
Basant.


minfrin at sharp

Nov 11, 2009, 3:09 AM

Post #55 of 69 (270 views)
Permalink
Re: Httpd 3.0 or something else [In reply to]

William A. Rowe Jr. wrote:

>> - Supporting prefork as httpd does now; and
>
> I'm very happy to see prefork die it's timely death.
>
> Let's go about working out where out-of-process magic happens.
> Gated, single threaded handlers may be sensible in some cases.
> But for the core server it makes async worthless, and supporting
> both digs us deeper into the bad-old-days of the 1.3 codebase.

I disagree strongly, for a number of reasons.

The first is that in our experience of a very high traffic collection of
websites, the more "hops" you have, the more performance starts to suck,
with the added complication that you run the risk of bumping your head
into the ceiling of filehandle limits, and other issues.

If you move from "httpd-prefork" to "httpd-something proxied to
random-appserver-X-doing-prefork-for-you" you aren't removing prefork -
you just moving it somewhere else and adding an extra hop.

You're also making it more complicated, and more complicated means less
reliable.

People like to harp on about how they want "speed speed speed". Right up
to the point where it first starts becoming unreliable. At that point
they suddenly start crying "reliable reliable reliable".

Apache httpd does lots of things right.

We must resist the temptation to throw out what we do right, while we
try move forward fixing what we do wrong.

Regards,
Graham
--


bojan at rexursive

Nov 11, 2009, 4:01 AM

Post #56 of 69 (270 views)
Permalink
Re: Httpd 3.0 or something else [In reply to]

On Wed, 2009-11-11 at 13:09 +0200, Graham Leggett wrote:
> Apache httpd does lots of things right.
>
> We must resist the temptation to throw out what we do right, while we
> try move forward fixing what we do wrong.

And there is also a reason why Google's Chome is essentially (pre)fork.
This model is simply unrivalled when it comes to reliability.

--
Bojan


jim at jaguNET

Nov 11, 2009, 4:45 AM

Post #57 of 69 (264 views)
Permalink
Re: Httpd 3.0 or something else [In reply to]

On Nov 11, 2009, at 6:09 AM, Graham Leggett wrote:

> William A. Rowe Jr. wrote:
>
>>> - Supporting prefork as httpd does now; and
>>
>> I'm very happy to see prefork die it's timely death.
>>
>> Let's go about working out where out-of-process magic happens.
>> Gated, single threaded handlers may be sensible in some cases.
>> But for the core server it makes async worthless, and supporting
>> both digs us deeper into the bad-old-days of the 1.3 codebase.
>
> I disagree strongly, for a number of reasons.
>
> The first is that in our experience of a very high traffic collection of
> websites, the more "hops" you have, the more performance starts to suck,
> with the added complication that you run the risk of bumping your head
> into the ceiling of filehandle limits, and other issues.
>
> If you move from "httpd-prefork" to "httpd-something proxied to
> random-appserver-X-doing-prefork-for-you" you aren't removing prefork -
> you just moving it somewhere else and adding an extra hop.
>
> You're also making it more complicated, and more complicated means less
> reliable.
>
> People like to harp on about how they want "speed speed speed". Right up
> to the point where it first starts becoming unreliable. At that point
> they suddenly start crying "reliable reliable reliable".
>
> Apache httpd does lots of things right.
>
> We must resist the temptation to throw out what we do right, while we
> try move forward fixing what we do wrong.
>

I must say I agree. Having a method to avoid the 1:1 mapping of request/resp
to a specific "entity" (worker or thread) is nice, but that solves a
different problem than that solved by prefork. I'd like for us to solve
the one while also being able to continue to solve the other. When, for
example, nginx works, it works well. When it doesn't, it is simply
completely unsuitable. I'd like for us to continue to avoid that being
the case for httpd.


Brian.Akins at turner

Nov 11, 2009, 11:14 AM

Post #58 of 69 (256 views)
Permalink
Re: Httpd 3.0 or something else [In reply to]

On 11/10/09 6:20 PM, "Greg Stein" <gstein[at]gmail.com> wrote:

> I'd like to see a few "network" threads multiplexing all the writing
> to clients.

That's what I meant. I just didn't state it properly.


> Then take all of *that*, and spread it across several processes for
> solid uptime, with a master monitor process.

And then you have nginx ;)

--
Brian Akins


gstein at gmail

Nov 11, 2009, 11:46 AM

Post #59 of 69 (256 views)
Permalink
Re: Httpd 3.0 or something else [In reply to]

On Wed, Nov 11, 2009 at 14:14, Akins, Brian <Brian.Akins[at]turner.com> wrote:
> On 11/10/09 6:20 PM, "Greg Stein" <gstein[at]gmail.com> wrote:
>
>> I'd like to see a few "network" threads multiplexing all the writing
>> to clients.
>
> That's what I meant. I just didn't state it properly.
>
>
>> Then take all of *that*, and spread it across several processes for
>> solid uptime, with a master monitor process.
>
> And then you have nginx ;)

Right. But they don't have the depth/breadth of modules like we do. As
long as we can keep that ecosystem, then Apache will always be a
leader.

Cheers,
-g


buanzo at buanzo

Nov 11, 2009, 12:00 PM

Post #60 of 69 (256 views)
Permalink
Re: Httpd 3.0 or something else [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Greg Stein wrote:
> Right. But they don't have the depth/breadth of modules like we do.

... yet. Keep going, but if there are great things like lighttpd and nginx (and even more) http
daemons out there, then that means more than one thing is wrong with current Apache.

Great thread.

- --
Arturo "Buanzo" Busleiman
Independent Linux and Security Consultant - OWASP - SANS - OISSG
http://www.buanzo.com.ar/pro/eng.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEAREKAAYFAkr7F+QACgkQAlpOsGhXcE2HbACcCgMwxXMnOJlAyyvfOTURgjiX
w6UAmQHy1fPeMOmwkYiCzV/bOL0sumBv
=l0LS
-----END PGP SIGNATURE-----


gstein at gmail

Nov 11, 2009, 7:34 PM

Post #61 of 69 (250 views)
Permalink
Re: Httpd 3.0 or something else [In reply to]

On Wed, Nov 11, 2009 at 15:00, Arturo 'Buanzo' Busleiman
<buanzo[at]buanzo.com.ar> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>
> Greg Stein wrote:
>> Right. But they don't have the depth/breadth of modules like we do.
>
> ... yet. Keep going, but if there are great things like lighttpd and nginx (and even more) http
> daemons out there, then that means more than one thing is wrong with current Apache.

Oh, definitely. HTTP serving is commodity functionality now. Thus, it
is very easy to serve niches with a specialized HTTP server.

Apache remains the broad solution, but for narrow requirements, people
will select something that is easier to handle for their particular
situation.

I wouldn't say "wrong", but more along the lines of "not as well-suited"

Cheers,
-g


jim at jaguNET

Nov 12, 2009, 6:06 AM

Post #62 of 69 (243 views)
Permalink
Re: Httpd 3.0 or something else [In reply to]

On Nov 11, 2009, at 2:14 PM, Akins, Brian wrote:

> On 11/10/09 6:20 PM, "Greg Stein" <gstein[at]gmail.com> wrote:
>
>> I'd like to see a few "network" threads multiplexing all the writing
>> to clients.
>
> That's what I meant. I just didn't state it properly.
>
>
>> Then take all of *that*, and spread it across several processes for
>> solid uptime, with a master monitor process.
>
> And then you have nginx ;)
>

Well, nginx is, after all, a fork of httpd....


buanzo at buanzo

Nov 12, 2009, 6:59 AM

Post #63 of 69 (243 views)
Permalink
Re: Httpd 3.0 or something else [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Greg Stein wrote:
> Apache remains the broad solution, but for narrow requirements, people
> will select something that is easier to handle for their particular
> situation.
>
> I wouldn't say "wrong", but more along the lines of "not as well-suited"

I partially agree, but we have to take into account that some of those httpd's, like lighttpd, are
replacing Apache plain and simple. Don't get me wrong. I love Apache. I've written tons of articles
about it since the very early days. And I haven't released any mod_openpgp code for any other thing
other than Apache for a reason: i love it.

- --
Arturo "Buanzo" Busleiman
Independent Linux and Security Consultant - OWASP - SANS - OISSG
http://www.buanzo.com.ar/pro/eng.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEAREKAAYFAkr8Is4ACgkQAlpOsGhXcE1tFwCdEAEZQDVG9c2qqqqyNXwYBk2/
VgIAn2emSNcp1xwXa2bxgoK09JKMcsV4
=T/Fe
-----END PGP SIGNATURE-----


gstein at gmail

Nov 12, 2009, 8:00 AM

Post #64 of 69 (243 views)
Permalink
Re: Httpd 3.0 or something else [In reply to]

On Thu, Nov 12, 2009 at 09:59, Arturo 'Buanzo' Busleiman
<buanzo[at]buanzo.com.ar> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>
> Greg Stein wrote:
>> Apache remains the broad solution, but for narrow requirements, people
>> will select something that is easier to handle for their particular
>> situation.
>>
>> I wouldn't say "wrong", but more along the lines of "not as well-suited"
>
> I partially agree, but we have to take into account that some of those httpd's, like lighttpd, are
> replacing Apache plain and simple. Don't get me wrong. I love Apache. I've written tons of articles
> about it since the very early days. And I haven't released any mod_openpgp code for any other thing
> other than Apache for a reason: i love it.

Yeah... I think we're in agreement. I'm just trying to say those
aren't necessarily *better* than Apache, but that they are
*better-suited* to their admin's scenarios. As the swiss army knife of
web servers, Apache is very heavy in the pocket. In many scenarios,
one little blade is all you need, and it is much easier to use and
maintain.

I'm not sure that is a solvable problem for us, unfortunately. We
would need a drastic overhaul of how we approach configuration. (not
to mention setup/building and module loading/handling) In essence, I
think the project has concentrated on backwards-compat rather than an
overhaul for usability.

Cheers,
-g


jmdesp at free

Nov 12, 2009, 8:43 AM

Post #65 of 69 (243 views)
Permalink
Re: Httpd 3.0 or something else [In reply to]

Greg Stein wrote:
>> > we have to take into account that some of those httpd's, like lighttpd, are
>> > replacing Apache plain and simple. [...]
> [...] I'm just trying to say those
> aren't necessarily*better* than Apache, but that they are
> *better-suited* to their admin's scenarios.[...]

Last time I've heard about a large scale server thinking about switching
from Apache to lighttpd, the one problem that site wanted to solve was a
massive number slow clients simultaneously connected to the server, with
the http server mostly just serving as a pipe between the client and
php, and where the ideal solution had to consume as little resource per
client as possible.

Did the admin of that site just miss what the solution should have been
to handle this properly with Apache ?


minfrin at sharp

Nov 12, 2009, 9:12 AM

Post #66 of 69 (243 views)
Permalink
Re: Httpd 3.0 or something else [In reply to]

Jean-Marc Desperrier wrote:

> Last time I've heard about a large scale server thinking about switching
> from Apache to lighttpd, the one problem that site wanted to solve was a
> massive number slow clients simultaneously connected to the server, with
> the http server mostly just serving as a pipe between the client and
> php, and where the ideal solution had to consume as little resource per
> client as possible.
>
> Did the admin of that site just miss what the solution should have been
> to handle this properly with Apache ?

Dedicated reverse proxy servers like varnish have appeared to solve this
problem, and apparently work quite well for the narrow problem they are
designed to solve (I say apparently because we're still at the evaluate
stage on this).

I would prefer in the long term that the two-layered approach wasn't
necessary, which is why I am so keen to make sure httpd v3.0's
architecture can optionally do what varnish does out of the box.

Regards,
Graham
--


mestrade at apache

Nov 13, 2009, 9:34 AM

Post #67 of 69 (201 views)
Permalink
Re: Httpd 3.0 or something else [In reply to]

Woow =) Very nice and interesting thread =)

It's very hard to think how to design httpd 3.0 before knowing what is
the real aim of this new webserver. Many feedback here are from very
spoted problems.
I've started at the end of 1.3 and the beta release of 2.0, and i must
say that applicative architectures and needs from people changed a lot.
Imho, the real question is what we want to do with it ? Still a very
flexible and compatible web server, providing interface for many
languages, with a very interesting API to develop modules ? Running in
the performances issues like nginx, httpd, haproxy or some others
webservers/load-balancers/reverseproxies can do ? Provide event based
design to process event driven application and infrastructure like xmpp
? Able to do Soap or webservice routing message ?
What about the non http protocol like ftp, or smtp tested during summer
code ? The tentation to have a powerful core that we could adapt to any
protocol we want...

Imho, i don't see how to stay competitive without an mpm to handle event
driven application, which could also solve many performances/reliability
problems.
Then maybe have two big categories like delivery (reverse proxy, load
balancing, content caching, gzip/deflate etc.) and applications and
languages (php, perl, python, ruby, external filters etc.).

my 2 cts.

Matthieu



Graham Leggett wrote:
> Jean-Marc Desperrier wrote:
>
>
>> Last time I've heard about a large scale server thinking about switching
>> from Apache to lighttpd, the one problem that site wanted to solve was a
>> massive number slow clients simultaneously connected to the server, with
>> the http server mostly just serving as a pipe between the client and
>> php, and where the ideal solution had to consume as little resource per
>> client as possible.
>>
>> Did the admin of that site just miss what the solution should have been
>> to handle this properly with Apache ?
>>
>
> Dedicated reverse proxy servers like varnish have appeared to solve this
> problem, and apparently work quite well for the narrow problem they are
> designed to solve (I say apparently because we're still at the evaluate
> stage on this).
>
> I would prefer in the long term that the two-layered approach wasn't
> necessary, which is why I am so keen to make sure httpd v3.0's
> architecture can optionally do what varnish does out of the box.
>
> Regards,
> Graham
> --
>
>


buanzo at buanzo

Nov 13, 2009, 11:01 AM

Post #68 of 69 (200 views)
Permalink
Re: Httpd 3.0 or something else [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Matthieu Estrade wrote:
> What about the non http protocol like ftp, or smtp tested during summer
> code ? The tentation to have a powerful core that we could adapt to any
> protocol we want...

And Google just released SPDY ("Speedy"), a non-http protocol for web transport...

- --
Arturo "Buanzo" Busleiman
Independent Linux and Security Consultant - OWASP - SANS - OISSG
http://www.buanzo.com.ar/pro/eng.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEAREKAAYFAkr9rScACgkQAlpOsGhXcE2JuQCeIQdL24we50bzAphSn+KtbTia
pIUAn2O819ym9idAGI19+32o5qPdO/N2
=RuhB
-----END PGP SIGNATURE-----


gstein at gmail

Nov 13, 2009, 11:10 AM

Post #69 of 69 (200 views)
Permalink
Re: Httpd 3.0 or something else [In reply to]

On Fri, Nov 13, 2009 at 14:01, Arturo 'Buanzo' Busleiman
<buanzo[at]buanzo.com.ar> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>
> Matthieu Estrade wrote:
>> What about the non http protocol like ftp, or smtp tested during summer
>> code ? The tentation to have a powerful core that we could adapt to any
>> protocol we want...
>
> And Google just released SPDY ("Speedy"), a non-http protocol for web transport...

Paul and I briefly discussed adding some stuff to serf that could
allow serf to do SPDY. For example, add the notion of "priority" into
the request system. It would be ignored in a normal connection, but
could then take effect in a SPDY connection.

Cheers,
-g

First page Previous page 1 2 3 Next page Last page  View All Apache dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.