diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 280: Merge proxy configuration doc

Message ID 20120507045110.2359.42702.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Spring Zhang May 7, 2012, 4:51 a.m. UTC
Merge authors:
  Spring Zhang (qzhang)
Related merge proposals:
  https://code.launchpad.net/~qzhang/lava-dispatcher/doc-squid-proxy/+merge/103598
  proposed by: Spring Zhang (qzhang)
  review: Approve - Spring Zhang (qzhang)
------------------------------------------------------------
revno: 280 [merge]
committer: Spring Zhang <spring.zhang@linaro.org>
branch nick: merge-config-proxy
timestamp: Mon 2012-05-07 12:48:34 +0800
message:
  Merge proxy configuration doc
added:
  doc/proxy.rst
modified:
  doc/index.rst


--
lp:lava-dispatcher
https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk

You are subscribed to branch lp:lava-dispatcher.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'doc/index.rst'
--- doc/index.rst	2012-04-23 05:51:22 +0000
+++ doc/index.rst	2012-05-07 04:38:42 +0000
@@ -77,6 +77,7 @@ 
 
    installation.rst
    configuration.rst
+   proxy.rst
    jobfile.rst
    usage.rst
    changes.rst

=== added file 'doc/proxy.rst'
--- doc/proxy.rst	1970-01-01 00:00:00 +0000
+++ doc/proxy.rst	2012-05-07 04:43:52 +0000
@@ -0,0 +1,105 @@ 
+.. _proxy:
+
+Cache Proxy Setting Up
+======================
+
+Before, it used to use an internal cache mechanism for downloaded images and
+hwpacks to avoid downloading repeatly, which could save time and bandwidth.
+
+lava-dispatcher switches to use cache proxy for managing cache files
+automatically. The recommended proxy is Squid.
+
+Install Squid 
+^^^^^^^^^^^^^
+
+Squid is easy to install via apt-get::
+
+    sudo apt-get install squid
+
+Or if you want a configurable squid, refer to the following link to compile
+and install manually: http://wiki.squid-cache.org/SquidFaq/CompilingSquid
+
+Configure Squid
+^^^^^^^^^^^^^^^
+
+You will need to customize accroding to your server, like disk layout, space.
+
+Need to analyse and tune by collecting information when squid running with
+real cases, like cache policy, file system.
+
+Mandatory configuration options
+-------------------------------
+
+Based on original /etc/squid/squid.conf, see below tuning.
+
+* cache_dir ufs /var/spool/squid 30720 16 256
+
+  Mandatory option, please modify 30720(MB) to an available size.
+
+  There can be several cache directories on different disk, but it's better not
+  use RAID on the cache directories, it's recommended by Squid: The Definitive
+  Guide that it will always degrades fs performance for squid. 30720 is the
+  cache amount 30GB. 16 and 256 is Level 1 and 2 sub-directories, which is
+  default.
+
+* maximum_object_size 1024000 KB
+
+  Mandatory option.
+
+  Setting the value as 1024000KB makes the squid cache large files less than
+  1GB, for our images are usually a large one but less than 1G.
+
+Optional configuration options
+------------------------------
+
+Some others than mandatory options.
+
+* acl over_conn_limit maxconn 10  # make max connection limit 10
+
+* http_access allow localnet
+
+  Enable localnet, also, we need to define more localnet in server environment
+  to make sure all boards IP and other permitted clients are included.
+
+  acl localnet src 10.122.0.0/16
+
+* http_access deny over_conn_limit
+
+  Make max connection of one client less than 10, it should be enough for
+  a board, it can be increased.
+
+* cache_mem 128 MB
+
+  It can be increased if server MEM is enough, it's for squid mem amount for
+  objects.
+
+* cache_swap_low 90
+
+  cache_swap_high 95
+
+  Cache size will maintain between 90% to 95%. 
+
+* client_lifetime 12 hours
+
+  Make a client continuous accessing time 12hrs, default is 1 days, it can be
+  increased.
+
+* high_response_time_warning 2000
+
+  2s in 1mins no response will log in cache.log.
+
+* There is some email configurations to be set, like 'cache_mgr', it will send
+  mail if cache proxy dies.
+
+The configuration is only workable, there can be more improvement ways, some
+still need to tune on server.
+
+Other tuning
+------------
+
+Open files number can be increased for squid will need more than 1024
+limitations sometimes::
+
+    # ulimit -n
+        1024
+