Re: which reverse proxy for modperl?

2008-12-17 Thread Fred Moyer
On Fri, Dec 12, 2008 at 6:02 PM, Jeff Pang pa...@laposte.net wrote:
 Hello,

 I have a modperl application on a host which is running with heavy load.
 I have the plan to put a reverse proxy before it.
 There are two well known reverse proxy software, one is Squid, another is
 nginx.
 Which one is better for modperl application? or is there any others which
 are better than these two?

Perlbal is my reverse proxy of choice.  In addition to being able to
handle tens of thousands of connections to the client without breaking
a sweat, it is written in Perl and isn't that hard to customize once
you grok the event driven programming in it; that is a really big
selling point for me as a Perl programmer.

It also has a cool feature called reproxying.  Take for example,
perlbal running as a reverse proxy to mod_perl.  If you get a request
for a file or url resource such as an image, you can code mod_perl to
return headers with 'X-Reproxy-Url:  http://someurl.com/file.txt' and
perlbal will asynchronously proxy that file from the resource to the
client, leaving mod_perl free to service new requests.

The load balancing feature in perlbal is excellent.  It keeps track of
the number of busy httpd backends, automatically removing those which
don't respond, and allowing you to run many mod_perl servers behind
one perlbal server.

And Perlbal has a plugin architecture that you can use to code up
request rewrite or similar functionality as plugins.


Re: which reverse proxy for modperl?

2008-12-17 Thread amiribarksdale

I was just grappling with this problem last week, and after trying out
lighttpd, nginx, and varnish, I chose varnish.

I too run one single mod-perl server, but it's sort of complicated, with
file uploads and customizable pages and stuff. I found that neither lighttpd
or nginx really allowed me to handle large file uploads transparently
without strange pauses and what not--both pre-cache file uploads in full
before passing them back to the Apache/mod_perl server. I am sure I simply
couldn't figure out how to configure those features properly, but ease of
use is part of the game.

Varnish, on the other hand, was no harder to set up and begin to understand,
and it handled uploads well. There's some trickiness to setting up the rules
in your default.vcl, but it works nicely, and there was no need to fiddle
with the config just to allow uploads to go through quickly.

I'm contentedly serving static files and some dynamic-but-rarely-updated
html from my varnish cache now.

Amiri


Frank Wiles wrote:
 
 On Sat, 13 Dec 2008 03:02:00 +0100 (CET)
 Jeff Pang pa...@laposte.net wrote:
 
 Hello,
 
 I have a modperl application on a host which is running with heavy
 load. I have the plan to put a reverse proxy before it.
 There are two well known reverse proxy software, one is Squid,
 another is nginx. Which one is better for modperl application? or is
 there any others which are better than these two?
 
 I've used mod_proxy, Perlbal, and nginx.  These days nginx is my
 favorite, it just works and has a ton of features. Also it appears to
 have the most active community development, but that's subjective as I
 don't follow them all very closely. 
 
  ---
Frank Wiles, Revolution Systems, LLC. 
  Personal : fr...@wiles.org  http://www.wiles.org
  Work : fr...@revsys.com http://www.revsys.com 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/which-reverse-proxy-for-modperl--tp20986586p21058840.html
Sent from the mod_perl - General mailing list archive at Nabble.com.



Re: which reverse proxy for modperl?

2008-12-17 Thread amiribarksdale

Oh, one other wrinkle is ssl. I had to forgo proxying my ssl pages using
nginx, varnish or lighttpd. In all three cases I had to make apache listen
on my real IP address to port 443 for https from the internet, and only
allow it to listen on localhost:8080 for whatever was sent from the
reverse_proxy.

Amiri



amiribarksdale wrote:
 
 I was just grappling with this problem last week, and after trying out
 lighttpd, nginx, and varnish, I chose varnish.
 
 I too run one single mod-perl server, but it's sort of complicated, with
 file uploads and customizable pages and stuff. I found that neither
 lighttpd or nginx really allowed me to handle large file uploads
 transparently without strange pauses and what not--both pre-cache file
 uploads in full before passing them back to the Apache/mod_perl server. I
 am sure I simply couldn't figure out how to configure those features
 properly, but ease of use is part of the game.
 
 Varnish, on the other hand, was no harder to set up and begin to
 understand, and it handled uploads well. There's some trickiness to
 setting up the rules in your default.vcl, but it works nicely, and there
 was no need to fiddle with the config just to allow uploads to go through
 quickly.
 
 I'm contentedly serving static files and some dynamic-but-rarely-updated
 html from my varnish cache now.
 
 Amiri
 
 
 Frank Wiles wrote:
 
 On Sat, 13 Dec 2008 03:02:00 +0100 (CET)
 Jeff Pang pa...@laposte.net wrote:
 
 Hello,
 
 I have a modperl application on a host which is running with heavy
 load. I have the plan to put a reverse proxy before it.
 There are two well known reverse proxy software, one is Squid,
 another is nginx. Which one is better for modperl application? or is
 there any others which are better than these two?
 
 I've used mod_proxy, Perlbal, and nginx.  These days nginx is my
 favorite, it just works and has a ton of features. Also it appears to
 have the most active community development, but that's subjective as I
 don't follow them all very closely. 
 
  ---
Frank Wiles, Revolution Systems, LLC. 
  Personal : fr...@wiles.org  http://www.wiles.org
  Work : fr...@revsys.com http://www.revsys.com 
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/which-reverse-proxy-for-modperl--tp20986586p21058934.html
Sent from the mod_perl - General mailing list archive at Nabble.com.



Re: which reverse proxy for modperl?

2008-12-17 Thread Frank Wiles
On Wed, 17 Dec 2008 10:46:53 -0800 (PST)
amiribarksdale amiribarksd...@gmail.com wrote:

 
 Oh, one other wrinkle is ssl. I had to forgo proxying my ssl pages
 using nginx, varnish or lighttpd. In all three cases I had to make
 apache listen on my real IP address to port 443 for https from the
 internet, and only allow it to listen on localhost:8080 for whatever
 was sent from the reverse_proxy.

I agree with your last message that Varnish is another good option.
I'm betting you just had some configuration issues, as I use nginx and
Perlbal all the time for proxying both 80 and 443. 

 ---
   Frank Wiles, Revolution Systems, LLC. 
 Personal : fr...@wiles.org  http://www.wiles.org
 Work : fr...@revsys.com http://www.revsys.com 



Re: which reverse proxy for modperl?

2008-12-17 Thread Kurt Hansen

Hi,

amiribarksdale wrote:

Oh, one other wrinkle is ssl. I had to forgo proxying my ssl pages using
nginx, varnish or lighttpd. In all three cases I had to make apache listen
on my real IP address to port 443 for https from the internet, and only
allow it to listen on localhost:8080 for whatever was sent from the
reverse_proxy.

Amiri
  
I've only read some docs and reviews for nginx so far, but I thought it 
supported ssl. Does it not? Do none of the 3?


Right now, I'm using the dual-apache setup on one server. The light 
apache has ssl compiled in. It is the only one listening on the public 
ports of 80 and 443; it then forwards everything to the mod_perl apache 
on port 81.


I've been assuming that I could replace my light apache with ssl with 
nginx with ssl with essentially the same setup. I'd move nginx to a 
separate machine, though, so I would do same more load balancing and 
fault tolerance. nginx would be listening in on port 80 and 443 and 
forwarding things on.


Is this not possible?

Thanks!

Kurt


Re: which reverse proxy for modperl?

2008-12-17 Thread Frank Wiles
On Wed, 17 Dec 2008 14:10:21 -0500
Kurt Hansen khan...@charityweb.net wrote:

 Hi,
 
 amiribarksdale wrote:
  Oh, one other wrinkle is ssl. I had to forgo proxying my ssl pages
  using nginx, varnish or lighttpd. In all three cases I had to make
  apache listen on my real IP address to port 443 for https from the
  internet, and only allow it to listen on localhost:8080 for
  whatever was sent from the reverse_proxy.
 
  Amiri

 I've only read some docs and reviews for nginx so far, but I thought
 it supported ssl. Does it not? Do none of the 3?
 
 Right now, I'm using the dual-apache setup on one server. The light 
 apache has ssl compiled in. It is the only one listening on the
 public ports of 80 and 443; it then forwards everything to the
 mod_perl apache on port 81.
 
 I've been assuming that I could replace my light apache with ssl with 
 nginx with ssl with essentially the same setup. I'd move nginx to a 
 separate machine, though, so I would do same more load balancing and 
 fault tolerance. nginx would be listening in on port 80 and 443 and 
 forwarding things on.
 
 Is this not possible?

It's definitely possible, I use nginx on both 80 and 443 all the time. 

 ---
   Frank Wiles, Revolution Systems, LLC. 
 Personal : fr...@wiles.org  http://www.wiles.org
 Work : fr...@revsys.com http://www.revsys.com 



Re: which reverse proxy for modperl?

2008-12-17 Thread Kurt Hansen

Thanks, Frank!

Good to know!

Take care,

Kurt


Frank Wiles wrote:

On Wed, 17 Dec 2008 14:10:21 -0500
Kurt Hansen khan...@charityweb.net wrote:

  

Hi,

amiribarksdale wrote:


Oh, one other wrinkle is ssl. I had to forgo proxying my ssl pages
using nginx, varnish or lighttpd. In all three cases I had to make
apache listen on my real IP address to port 443 for https from the
internet, and only allow it to listen on localhost:8080 for
whatever was sent from the reverse_proxy.

Amiri
  
  

I've only read some docs and reviews for nginx so far, but I thought
it supported ssl. Does it not? Do none of the 3?

Right now, I'm using the dual-apache setup on one server. The light 
apache has ssl compiled in. It is the only one listening on the

public ports of 80 and 443; it then forwards everything to the
mod_perl apache on port 81.

I've been assuming that I could replace my light apache with ssl with 
nginx with ssl with essentially the same setup. I'd move nginx to a 
separate machine, though, so I would do same more load balancing and 
fault tolerance. nginx would be listening in on port 80 and 443 and 
forwarding things on.


Is this not possible?



It's definitely possible, I use nginx on both 80 and 443 all the time. 


 ---
   Frank Wiles, Revolution Systems, LLC. 
 Personal : fr...@wiles.org  http://www.wiles.org
 Work : fr...@revsys.com http://www.revsys.com 



  


Re: which reverse proxy for modperl?

2008-12-17 Thread Frank Wiles
On Wed, 17 Dec 2008 11:08:01 +0100 (CET)
Jeff Pang pa...@laposte.net wrote:

 Thanks for all the kind info and replying.
 When you use reverse proxy, do you generally have more than one
 modperl backend servers? In my case, I have only one modperl server.
 When I put a reverse-proxy in front of it, will it improve the
 performance?

You can do it any way you like.  I have systems that are setup using
Perlbal and/or nginx ( which I will call proxy ) in the following
situations: 

1) proxy on 80 to  apache1/mp1 on localhost:8000
2) proxy on 80 and 443 to apache1/mp1 on localhost:8000 and 
apache2/mp2/perl 5.8 on localhost:8001
3) proxy on 80 and 443 to several different apache2/mp2 servers on a
local network. 

On one system I even have several instances of Apache running on
localhost on various ports basically one instance per mod_perl
application due to the traffic patterns/memory usage of the
applications.  Since one app is a HUGE memory hog and very light on
traffic it is setup with just two Apache child processes and the other
apps are setup with more children. 

Hope this helps. 

 ---
   Frank Wiles, Revolution Systems, LLC. 
 Personal : fr...@wiles.org  http://www.wiles.org
 Work : fr...@revsys.com http://www.revsys.com 



Re: which reverse proxy for modperl?

2008-12-17 Thread Jeff Pang
Thanks for all the kind info and replying.
When you use reverse proxy, do you generally have more than one modperl backend 
servers?
In my case, I have only one modperl server. When I put a reverse-proxy in front 
of it, will it improve the performance?

Thanks.



 On Fri, Dec 12, 2008 at 6:02 PM, Jeff Pang  wrote:
  Hello,
 
  I have a modperl application on a host which is running with heavy load.
  I have the plan to put a reverse proxy before it.
  There are two well known reverse proxy software, one is Squid, another is
  nginx.
  Which one is better for modperl application? or is there any others which
  are better than these two?



 Créez votre adresse électronique prenom@laposte.net 
 1 Go d'espace de stockage, anti-spam et anti-virus intégrés.


Re: which reverse proxy for modperl?

2008-12-17 Thread David Nicol
ldirectord will load-balance any number of back-ends; state has to be
maintained on all of them the same though


Re: which reverse proxy for modperl?

2008-12-17 Thread Jeff Pang

 Message du 17/12/08 21:54
 De : David Nicol
 ldirectord will load-balance any number of back-ends; state has to be
 maintained on all of them the same though



Yup, ldirectord (a scheduler for LVS) is right for load-balancing.
But it is only a tcp-header-rewrite (or so called NAT or reverse NAT), not a 
proxy server.

One of our applications, have two LVS before 200+ Squid boxes, the backend are 
hundreds of fastcgi servers. LVS and Squid run with DR mode, could reach to 
10G+ traffic.


--
Jeff Pang
http://home.arcor.de/pangj/

 Créez votre adresse électronique prenom@laposte.net 
 1 Go d'espace de stockage, anti-spam et anti-virus intégrés.


Re: which reverse proxy for modperl?

2008-12-16 Thread Frank Wiles
On Sat, 13 Dec 2008 03:02:00 +0100 (CET)
Jeff Pang pa...@laposte.net wrote:

 Hello,
 
 I have a modperl application on a host which is running with heavy
 load. I have the plan to put a reverse proxy before it.
 There are two well known reverse proxy software, one is Squid,
 another is nginx. Which one is better for modperl application? or is
 there any others which are better than these two?

I've used mod_proxy, Perlbal, and nginx.  These days nginx is my
favorite, it just works and has a ton of features. Also it appears to
have the most active community development, but that's subjective as I
don't follow them all very closely. 

 ---
   Frank Wiles, Revolution Systems, LLC. 
 Personal : fr...@wiles.org  http://www.wiles.org
 Work : fr...@revsys.com http://www.revsys.com 



Re: which reverse proxy for modperl?

2008-12-13 Thread Michael Peters

Perrin Harkins wrote:

 I haven't seen a good comparison that hits
all the popular proxy servers (perlbal, pound, nginx, lighttpd,
apache, squid... I think I'm forgetting some) but I've wanted one
before.


If you could include varnish, I'd be really happy :)

--
Michael Peters
Plus Three, LP



Re: which reverse proxy for modperl?

2008-12-13 Thread Adam Prime

William A. Rowe, Jr. wrote:

Jeff Pang wrote:

Hello,

I have a modperl application on a host which is running with heavy load.
I have the plan to put a reverse proxy before it.
There are two well known reverse proxy software, one is Squid, another
is nginx.
Which one is better for modperl application? or is there any others
which are better than these two?


And there is httpd which you are already running, and you can run a very
low cost, separate instance with very minimal modules loaded.  With the
mod_proxy_balancer, you can shuffle off some of the traffic to a second,
third machine for good measure.

Is either better?  Google both for problems to determine how many people
are irritated with either.


I believe that there are a number of people that use lighttpd on the 
frontend too, so you can add it to the list.  All of them have their 
pluses and minuses, and all of them will help relieve the load on your 
server.


Adam


which reverse proxy for modperl?

2008-12-12 Thread Jeff Pang
Hello,

I have a modperl application on a host which is running with heavy load.
I have the plan to put a reverse proxy before it.
There are two well known reverse proxy software, one is Squid, another is nginx.
Which one is better for modperl application? or is there any others which are 
better than these two?

Thanks.

 Créez votre adresse électronique prenom@laposte.net 
 1 Go d'espace de stockage, anti-spam et anti-virus intégrés.


Re: which reverse proxy for modperl?

2008-12-12 Thread William A. Rowe, Jr.
Jeff Pang wrote:
 Hello,
 
 I have a modperl application on a host which is running with heavy load.
 I have the plan to put a reverse proxy before it.
 There are two well known reverse proxy software, one is Squid, another
 is nginx.
 Which one is better for modperl application? or is there any others
 which are better than these two?

And there is httpd which you are already running, and you can run a very
low cost, separate instance with very minimal modules loaded.  With the
mod_proxy_balancer, you can shuffle off some of the traffic to a second,
third machine for good measure.

Is either better?  Google both for problems to determine how many people
are irritated with either.


Re: which reverse proxy for modperl?

2008-12-12 Thread Cees Hek
On Sat, Dec 13, 2008 at 1:02 PM, Jeff Pang pa...@laposte.net wrote:
 Hello,

 I have a modperl application on a host which is running with heavy load.
 I have the plan to put a reverse proxy before it.
 There are two well known reverse proxy software, one is Squid, another is
 nginx.
 Which one is better for modperl application? or is there any others which
 are better than these two?

I can't tell you which is better, but I can tell you that we have been
very happy with squid.  We run four load balanced squid proxies in
front of all of our web servers and they never break a sweat.  Squid
is very efficient and can handle a massive amount of concurrent
connections with minimal hardware requirements.  We run them on old
school single proc PIII DL360s as squid barely uses the CPU and just
load them up with RAM since squid will use as much as you throw at it
to serve cached content out of RAM instead of the disk.

I'll include a few numbers below in case it helps out (these were
taken on a Saturday afternoon, so definitely not peak time).  We run
an average of 10mb/s through our internet feed where most of the
traffic is web traffic which all goes through the squids.

Load balancer connection stats (notice that one of our squids is
actually down for maintenance today)
Prot LocalAddress:Port Scheduler Flags
  - RemoteAddress:Port   Forward Weight ActiveConn InActConn

TCP  xxx.xxx.xxx.xxx:8090 lc
  - syd-webcache-04Route   1  297882
  - syd-webcache-02Route   1  297816
  - syd-webcache-01Route   1  2911169
  - syd-webcache-03Route   0  0  0

syd-webcache-01: $ uptime
 14:28:28 up 50 days, 22:17,  1 user,  load average: 0.14, 0.12, 0.09

syd-webcache-01: $ vmstat 5
procs ---memory-- ---swap-- -io -system-- cpu
 r  b   swpd   free   buff  cache   si   sobibo   in   cs us sy id wa
 0  0 750428  53064  38388 24380087 4 195  4  2 91  3
 0  0 750428  52224  38540 24484400   22243  845  620  3  4 88  4
 0  0 750416  53492  38100 24376850   27072  865  571  5  3 88  4
 1  1 750396  54108  37776 243300   190   35182  988  770  7  6 82  5

800Mhz Pentium III (Coppermine) with 2Gb RAM and stripped SCSI disks

We've been running this setup for several years now and it has never
been a bottle neck for us (mind you we have never been slashdotted
either :) )

Cheers,

Cees Hek


Re: which reverse proxy for modperl?

2008-12-12 Thread Perrin Harkins
I'm proposing to give a talk at OSCON this year about choosing your
reverse proxy, comparing proxy servers and other parts of the stack
like mod_perl and FastCGI.  I haven't seen a good comparison that hits
all the popular proxy servers (perlbal, pound, nginx, lighttpd,
apache, squid... I think I'm forgetting some) but I've wanted one
before.

- Perrin