Re: [squid-users] squid 2.6 and loadbalancing

From: Chris Robertson <crobertson@dont-contact.us>
Date: Tue, 21 Nov 2006 12:02:28 -0900

Jean Chiappini wrote:
> Hello,
>
> I installed squid 2.6 and I would try to load balanced our websever.
>
> In front I have a squid server and I want to load balance to three web
> servers. The squid server listen on port 8080 and the three webservers
> listen on the port 80.
>
> I try a lot's of different syntax, but that don't work.
>
> This is my squid.conf :
>
> http_port 192.168.200.40:8080 vhost vport
>
I don't think you need vport here. If you do, you should probably be
using vport=80.
> http_port 127.0.0.1:8080
> acl mynetwork src 0.0.0.0/0.0.0.0
> http_access allow mynetwork
>
I have to stress how unwise this setup is. It's just begging for abuse.
> cache_peer 192.168.200.42 parent 8080 80 weight=2
>
Wait a minute... I thought you said the web servers listen on port 80?
With this setup you are attempting http transfers on port 8080 and ICP
queries on port 80. That's likely not what you want to do.
> cache_peer 192.168.200.43 parent 8080 80 weight=2
> cache_peer 192.168.200.44 parent 8080 80 weight=3
>
> Someone could help me please ?
>
> Regards
>
> Jean
>

Here's what I think you want (no guarantees, I'm still not running an
accelerator):

http_port 8080 vhost # Unless there are certain interfaces you DON'T
want Squid to listen on...
acl accelerated_domains dstdomain .first.domain .second.dom # And so
on. The leading dot matches all subdomains.
http_access allow accelerated_domains # Use the proxy to reach my sites...
http_access deny all # Or not at all.
cache_peer 192.168.200.42 parent 80 0 weight=2 originserver noquery #
Important options added.
cache_peer 192.168.200.43 parent 80 0 weight=2 originserver noquery
cache_peer 192.168.200.44 parent 80 0 weight=3 originserver noquery

This all assumes that the three servers all host multiple domains, are
all mirrors of each other and need no session state information between
requests. If the three are only required to answer for one domain,
replace the vhost option with defaultsite=your.main.website.

Chris
Received on Tue Nov 21 2006 - 14:02:44 MST

This archive was generated by hypermail pre-2.1.9 : Fri Dec 01 2006 - 12:00:03 MST