RE: Pen and clients behind Proxy

From: Ulric Eriksson (ulric@siag.nu)
Date: Wed Sep 18 2002 - 10:16:53 CEST


On Wed, 18 Sep 2002, Torsten Valentin wrote:

> >If your webserver stores session data in a database, then you should be
>
> >able to do what you're asking.  This is strictly speaking from a
> webserver
> >perspective; I haven't fully examined the Pen man page (although I'm
> pretty
> >sure that you can do this with pen).
>
> I'm pretty sure that you cannot do this with Pen. To make Pen be a
> round-robin rinetd it would be necessary to dig in the code, besides it
> most probably wouldn't solve his problem.

The -r option does just that: bypasses the client tracking and picks a
server based on round robin. Here's a simple example:

8<---
libretto:~$ pen localhost:2301 localhost:23
libretto:~$ pen localhost:2302 localhost:23
libretto:~$ pen -dfr localhost:2300 localhost:2301 localhost:2302
2002-09-17 14:34:23: local address=[127.0.0.1:2300]
2002-09-17 14:34:23: n = 2, address = localhost, pno = 2301, maxc1 = 0, hard = 0
2002-09-17 14:34:24: n = 2, address = localhost, pno = 2302, maxc1 = 0, hard = 0
2002-09-17 14:34:24: servers:
2002-09-17 14:34:24: 0 127.0.0.1:2301:0:0
2002-09-17 14:34:24: 1 127.0.0.1:2302:0:0
2002-09-17 14:34:24: mainloop_select(3, -1)
8<---

First connection comes in (from localhost):

8<---
2002-09-17 14:34:37: Bypassing client tracking
2002-09-17 14:34:37: Trying server 1 at time 1032266077
2002-09-17 14:34:37: Successful connect to server 1
2002-09-17 14:34:37: Client 127.0.0.1 has index 0 and server 1
8<---

Second one, again from localhost:

8<---
2002-09-17 14:34:53: Bypassing client tracking
2002-09-17 14:34:53: Trying server 0 at time 1032266093
2002-09-17 14:34:53: Successful connect to server 0
2002-09-17 14:34:53: Client 127.0.0.1 has index 0 and server 0
8<---

Round-robin works fine for http if there is no state on the servers, or
state is maintained centrally (such as in a database) or by passing it
back and forth to the client in hidden form fields and such. I'm not sure
how round-robin would interact with https.

How about this setup:

         |
.-----------------.
| SSL Accelerator |
`-----------------´
         |
      .-----.
      | PEN |
      `-----´
         |
--------------------------
    | | |
.------. .------. .------.
| WWW1 | | WWW2 | | WWW3 |
`------´ `------´ `------´

Ulric



This archive was generated by hypermail 2.1.2 : Wed Sep 18 2002 - 10:17:22 CEST