Advertisement
phuoc0191vn

install squid

Jul 30th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. install:
  2. sudo apt-get update
  3. wget http://www.squid-cache.org/Versions/v4/squid-4.8.tar.gz
  4. tar xvzf squid-4.8.tar.gz
  5. cd squid-4.8
  6. sudo apt-get install build-essential
  7. sudo apt-get install autoconf g++ python2.7-dev
  8. sudo apt-get install libssl-dev
  9. ./configure --with-openssl --enable-ssl-crtd
  10. make
  11. sudo make install
  12. #It will install everything to /usr/local/squid
  13.  
  14. CACHE_DIR: "cache_dir aufs Directory-Name Mbytes L1 L2 [options]"
  15. - install pthread for "aufs"
  16. sudo apt-get install libpthread-stubs0-dev
  17. - DIskd works perfectly on some OS'es, like Solaris, BSD.
  18. - Linux-based OS, AFAIK, works with diskd so slow. And AUFS is the best choise in this case. Depending system settings, of course.
  19. - "We should set L1 and L2 high enough so that directories at the second level don't have a huge number of files"
  20. - example with 50Gb cache: cache_dir aufs /squid_cache/ 51200 32 512
  21. + assume the average size of a cached object to be 16 KB --> 51200x1024รท(32x512x16) = 200 cached objects in each of the directories at the second level which is quite good.
  22.  
  23. Cache object size limits:
  24. - "we can set the maximum limit to something around 100 MB, which will make sure that the popular software, audio/video content, and so on, are also cached, which may lead to significant bandwidth savings"
  25. - "minimum_object_size 0 KB"
  26. - "maximum_object_size 96 MB"
  27.  
  28. Cache Swap:
  29. - The default is 90 and 95 %, which are good if the size of cache directory is low (like 10 GB). If we have a large amount of space for caching (such as a few hundreds GBs), we can push the limits a bit higher and closer
  30. - "cache_swap_low 96"
  31. - "cache_swap_high 97"
  32.  
  33. - "cache_replacement_policy heap LFUDA" choose algorithm to delete object cache
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement