Using Squid As a Load Balancer

Páginas: 6 (1260 palabras) Publicado: 22 de julio de 2011
Using Squid as a Load Balancer

This article helps you to understand how you can use Squid as a load balancer. It explains the configuration changes required for load balancing on SXDE (Solaris Express Developer Edition).

What is Squid?
Squid is a proxy-server that caches internet data. Squid supports the HTTP, HTTPS, and FTP protocols. Using Squid, you can improve the server response timeby caching and reusing frequently-requested web pages. It improves performance without the need for greater bandwidth. Squid is generally used as a server accelerator. You can configure Squid to act as a caching HTTP accelerator. It improves the server performance, network performance, and security as Squid overcomes disadvantages related with performance. For example, when the original webserver and the original network might be slow and prone to attacks, you can use Squid to serve traffic requests. Squid is suited for any operating system including Digital UNIX, IRIX, Solaris, AIX, HP-UX, Linux, FreeBSD, NetBSD and even OS/2. You can also use it on Windows platform.

What Is Load Balancing?
Load balancing shares the network traffic between two or more servers so that a single serverdoes not get loaded with requests. Load balancing increases performance and reliability. You can use multiple processors or multiple threads in a single processor for load balancing. Load balancing does not require dedicated software and hardware nodes. DNS servers can run the round-robin algorithm against multiple IP Addresses associated with a single domain name. Squid is generally used to actas a caching proxy server. It sends client HTTP requests to the proxy server. The proxy server fetches web pages in accordance with the cache setup, and returns them to the client. Squid can be used to perform basic round-robin load balancing, and to cache results based on your cache configuration.

Configuring Squid as a Load Balancer
Squid is integrated with the SXDE (Solaris ExpressDeveloper Edition) release. You do not need to install Squid separately. Perform the following steps to configure Squid as load balancer.
Note – DNS servers are name resolution servers that translate host names to IP addresses. Most web servers use DNS servers as their default name resolution servers. If the server uses NIS instead of DNS, it can lead to conflict with Squid, as Squid also uses the DNS bydefault. Squid can be configured for NIS. The following sample error message appears, when Squid configured for DNS and runs server that uses NIS. 2008/06/11 11:53:08| /etc/resolv.conf: (2) No such file or directory 2008/06/11 11:53:08| Warning: Could not find any nameservers. Trying to use localhost



To Configure Squid
Configure Squid for a site www.foo.com on a web server. Change to thedirectory /etc/squid. Open the squid.conf file in a text editor Make the following changes to specify the port for the web site, and to specify the IP address for the web server. By default squid listens to HTTP port 80. Also, specify access controls to allow access to your web site. http_port 80 accel defaultsite=www.foo.com cache_peer ip.of.server1 parent 80 0 no-query

1 2

Using Squid asa Load Balancer

2

acl sites_server_1 dstdomain www.foo.com http_access allow sites_server_1
3

Create a cache directory by typing the following command. % /usr/local/squid/sbin/squid -z Start Squid by typing the following command. % /usr/local/squid/sbin/squid -NCd1
Note – See the logs at /var/squid/logs (especially in the cache.log file) to verify if there are any errors in

4configuring Squid.



To Configure Squid as a Load Balancer
Restart Squid before you configure it as a load balancer. This example uses two web servers . Each web server has two web sites. www.foo.com and www.foo.net are on Server 1, and www.test.foo.com and www.test.foo.net are on Server 2. This procedure explains how to configure Squid as a load balancer for each site.

1 2

Change to...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Load
  • Squid
  • Squid
  • Squid
  • Squid
  • squid
  • Squid
  • Squid

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS