httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From solprovi...@apache.org
Subject Re: [users@httpd] routing requests to two different servers
Date Tue, 30 Oct 2007 20:16:01 GMT
On 10/30/07, Boyle Owen <Owen.Boyle@swx.com> wrote:
> > -----Original Message-----
> > From: Wm.A.Stafford [mailto:stafford@marine.rutgers.edu]
> > Sent: Tuesday, October 30, 2007 2:04 PM
> > To: users@httpd.apache.org
> > Subject: Re: [users@httpd] routing requests to two different servers
> >
> > Good point.  The test driver mentioned is a 'fake client'
> > that will send
> > a request to the server under test, get the reply from the
> > server under
> > test and do some sort of analysis.  The reply from the
> > production server
> > would follow the same route as always back to the real client.
> >
> > We already do this in a rather crude way by using a file of URLs
> > gathered from production to drive testing but I think a
> > simpler and more
> > realistic test scheme would be to just split the stream of production
> > requests and direct one stream to the servers under test.
>
> "split the stream"? That's like delivering a single letter to two
> addresses :-)
>
> Think of HTTP as old-fashioned mail-order; the client sends off a
> single, sealed envelope containing an order form. The envelope passes
> through various post offices and mail vans until it arrives at the
> warehouse. The warehouse packs the goods and sends them back over the
> postal network to the client's house. How do you "split the stream"?
>
> You'd need a worker in the post office opening orders and photocopying
> them then posting the copy on to a "test" warehouse. He'd also have to
> make sure he could intercept parcels coming back the other way so they
> didn't get back to the original client. In any case, this is a bespoke,
> standards-violating procedure that could only be done in a test
> environment.
>
> Rgds,
> Owen Boyle
> Disclaimer: Any disclaimer attached to this message may be ignored.
>
> > Thanks for your insight,
> > -=bill
> >
> > Boyle Owen wrote:
> > >> -----Original Message-----
> > >> From: Wm.A.Stafford [mailto:stafford@marine.rutgers.edu]
> > >> Sent: Monday, October 29, 2007 6:18 PM
> > >> To: users@httpd.apache.org
> > >> Subject: [users@httpd] routing requests to two different servers
> > >>
> > >> I would like to have Apache send incoming requests to two
> > locations.
> > >> Our Apache is currently configured as a reverse proxy to send
> > >> requests
> > >> to a production server.  I would like to send the same
> > >> request to a test
> > >> driver that will forward the request to one or more servers
> > >> undergoing
> > >> testing so these servers can be driven by the same load
> > seen by the
> > >> production server.
> > >
> > > Ok - but where is the response supposed to go?
> > >
> > > Remember that HTTP is about a client sending a *request*
> > and the server
> > > returning a *response*. The whole idea implies a one-to-one mapping
> > > between client and server. If you somehow clone a request
> > and fan it out
> > > to another server, you create two responses to the same
> > request. How is
> > > the client supposed to handle this? If you're talking about a purely
> > > research environment, you could invent a client that handles two
> > > responses, but no real-world browser can handle this.
> > >
> > > Maybe you plan to trap the response from the test server
> > and short it to
> > > ground? Then you'd need to configure the test server (at the TCP/IP
> > > level - not HTTP) to route all outgoing traffic to a machine that
> > > terminated the TCP/IP traffic (ie, acknowledged it) but
> > didn't deliver
> > > it further. That would be a router, I guess... by now you're into
> > > network-layer programming and have left HTTP behind.
> > >
> > > Rgds,
> > > Owen Boyle
> > > Disclaimer: Any disclaimer attached to this message may be ignored.
> > >
> > >> The test driver will reside on a completely different machine
> > >> and have
> > >> no association with the Apache that is forwarding requests
> > so I don't
> > >> think a simple reverse proxy configuration will handle this.
> > >>
> > >> Any guidance or ideas appreciated,
> > >> -=beeky

Splitting a stream is useful.  Older people remember when forms were
sent in triplicate.  Then office workers made a copy of every paper to
cross their desks.  Now smart people keep a copy of every file passed
to others.

Splitting a stream is not unusual.  Unix has the "tee" command.
Apache Cocoon has the TeeTransformer.  Apache httpd copies part of
each request into the log before fulfilling the request.

Splitting a stream is easy:
while(b = in.read()){  out1.write(b); out2.write(b); }

Discarding the output from the test server is difficult, but not
impossible.  When configuring the server for the above code:
   Connection1 = client<-->splitter
   Connection2 = splitter<-->production server
   Connection3 = splitter<-->test server
The splitter should compare responses from the production and test
servers and log the differences.

I am uncertain this functionality should be added to Apache httpd.  I
recommend writing a simple fast dedicated server to handle splitting,
logging, and comparing.  That server could be added and removed from
the production stream without affecting the other servers beyond an IP
address configuration change.

solprovider

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message