Perlbal - Virtual hosts, existing apache and some more

This is Interesting: Free IT Magazines  
Home > Archive > Perlbal > March 2005 > Virtual hosts, existing apache and some more





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Virtual hosts, existing apache and some more
Harmen

2005-03-14, 4:57 pm

Hello,

I just found perlbal and mogilefs, but some things are a bit unclear. The
site in question completly mod_perl so mogilefs might just be the system we
need.

I use a few virtualhosts now. Depending on (part of the) hostname requests
go to different backend mod_perl apaches. I would like to use Perlbal to
balance the connections to the backend servers, but since I really need the
frontends virtualhosts the setup would be:
frontend apache -> perlbal -> mod_perl
But thats looks rather silly. Any suggestions? (Besides using real ipnumbers in
stead of virtualhosts)
(Hmm, I see wikipedia uses it between squid and mod_perl...)


In the oscon2004 presentation (which is quite readable even without the talk
there is a example of a GET request for a FotoBilder image. (http://www.danga.com/words/2004_oscon/oscon2004.pdf, page 50 on my pdfreader)
The requests goes like this:
perlbal -> mod_perl -> mogile tracker -> redirects to a storage node via
perlbal -> serving of the actual image by perlbal.
This does look like quite a lot of work for a simple image
Do 'last-modified' headers get added to the reply somewhere so a client will
cache it, or does the livejournal setup do that somewhere?


What happends if a mogile content server burns down? How do the files get
restored?


Thanks,
Harmen


--
The Moon is Waxing Crescent (23% of Full)

Mark Smith

2005-03-14, 5:12 pm

Howdy!

> I use a few virtualhosts now. Depending on (part of the) hostname requests
> go to different backend mod_perl apaches. I would like to use Perlbal to
> balance the connections to the backend servers, but since I really need the
> frontends virtualhosts the setup would be:
> frontend apache -> perlbal -> mod_perl
> But thats looks rather silly. Any suggestions? (Besides using real ipnumbers in
> stead of virtualhosts)


LiveJournal uses a BIG-IP hardware load balancer in front of the Perlbals
in order to split requests by hostname. We then define different ports on
Perlbal to go to diferrent sets of backend nodes.

There's no way right now to say "this hostname goes to this service", but
that's not a terribly difficult thing to do. Hmm, it could probably be
added fairly easily.

> In the oscon2004 presentation (which is quite readable even without the talk
> there is a example of a GET request for a FotoBilder image. (http://www.danga.com/words/2004_oscon/oscon2004.pdf, page 50 on my pdfreader)
> The requests goes like this:
> perlbal -> mod_perl -> mogile tracker -> redirects to a storage node via
> perlbal -> serving of the actual image by perlbal.
> This does look like quite a lot of work for a simple image
> Do 'last-modified' headers get added to the reply somewhere so a client will
> cache it, or does the livejournal setup do that somewhere?


Lot of work, but we do set last-modified dates -- when the MogileFS storage
node (really a Perlbal in web_server mode with put/delete turned on)
returns the file, it adds a Last-Modified header. LiveJournal/FotoBilder
just pass it on to the user.

> (Hmm, I see wikipedia uses it between squid and mod_perl...)


Yep, last I heard they're using it to balance among the mod_perls.

> [...] mogile [...]


And for your MogileFS questions, you should email the MogileFS mailing
list. I'd be happy to answer any questions asked there.

--
Mark Smith
junior@danga.com

Harmen

2005-03-14, 6:12 pm

On Mon, Mar 14, 2005 at 03:12:09PM -0800, Mark Smith wrote:
> Howdy!
>
>
> LiveJournal uses a BIG-IP hardware load balancer in front of the Perlbals
> in order to split requests by hostname. We then define different ports on
> Perlbal to go to diferrent sets of backend nodes.


Aha. That explains. But a frontend apache is nice to have. It is fast
enough and does some other useful things. Any suggestions what to use to
connect to the Perlbal @ localhost? Plain old mod_rewrite/mod_proxy?


Ow, what does perlbal do with uploads? Does it wait for the whole upload
before it even tries to connect to the mod_perl server?


> There's no way right now to say "this hostname goes to this service", but
> that's not a terribly difficult thing to do. Hmm, it could probably be
> added fairly easily.
>
>
> Lot of work, but we do set last-modified dates -- when the MogileFS storage
> node (really a Perlbal in web_server mode with put/delete turned on)
> returns the file, it adds a Last-Modified header. LiveJournal/FotoBilder
> just pass it on to the user.


Does the FotoBuilder mod_perl handler check the If-modified-since headers?
(just curious)

>
> Yep, last I heard they're using it to balance among the mod_perls.
>
>
> And for your MogileFS questions, you should email the MogileFS mailing
> list. I'd be happy to answer any questions asked there.


Ok, I will. That list can use some traffic


Thank you for your help,

Harmen



--
The Moon is Waxing Crescent (24% of Full)

Ask Bjørn Hansen

2005-03-14, 6:45 pm


On Mar 14, 2005, at 16:12, Harmen wrote:

> Aha. That explains. But a frontend apache is nice to have. It is fast
> enough and does some other useful things. Any suggestions what to use
> to
> connect to the Perlbal @ localhost? Plain old mod_rewrite/mod_proxy?


Using perlbal instead of httpd/mod_proxy gives you better keepalive
handling (if you are interested in that).



- ask

--
http://www.askbjoernhansen.com/


Harmen

2005-03-14, 6:55 pm

On Mon, Mar 14, 2005 at 04:45:20PM -0800, Ask Bj?rn Hansen wrote:
>
> On Mar 14, 2005, at 16:12, Harmen wrote:
>
>
> Using perlbal instead of httpd/mod_proxy gives you better keepalive
> handling (if you are interested in that).


The backends do not use keepalive now, indeed. Does it differ from apache for the
clients? Think the cost of a longer keepalive is almost none with Perlbal,
but with Apache you need a whole child for each connection, right?

Disadvantage is the backends have to do the http content compression
themselves. The frontend does that now.

> - ask


Ask, have you got some Perlbal successstories to share?


Thanks again for the help,
Harmen


--
The Moon is Waxing Crescent (24% of Full)

Ask Bjørn Hansen

2005-03-14, 7:04 pm


On Mar 14, 2005, at 16:55, Harmen wrote:

> The backends do not use keepalive now, indeed. Does it differ from
> apache for the
> clients? Think the cost of a longer keepalive is almost none with
> Perlbal,
> but with Apache you need a whole child for each connection, right?


Right.

With perlbal you can keep your connections open to both the client and
to the backend without running out of them.

> Ask, have you got some Perlbal successstories to share?


I only use it for a couple of small hobby projects[1], but I'm very
happy with it there.

I'm planning to set it up with wackamole on search.cpan.org to load
balance and get HA between a couple of boxes.


- ask

[1] http://metamark.net/ (~5-600k requests a day) and
http://geourl.org/ (<~200k requests/day).

--
http://www.askbjoernhansen.com/


Kate Turner

2005-03-14, 9:31 pm

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com