User Tools

Site Tools


pfsense:squid:optimizing_squid

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
pfsense:squid:optimizing_squid [2020/03/22 18:10] – [Test your disk speed] peterpfsense:squid:optimizing_squid [2020/04/09 13:13] (current) – removed peter
Line 1: Line 1:
-====== PFSense - Squid - Optimizing Squid ====== 
- 
-For the most part, Squid is quite dynamic in handling varying loads but there are some key things to consider. 
- 
-The most performance affecting attribute about Squid is the cache itself. 
- 
-If the cache is located on a slow device then the performance of all content will be dependent on this limitation. 
- 
-For this reason, it is advised that you run your cache on the fastest Read/Write medium that you can. 
- 
-If your disk is performing other Read/Write operations it can slow the performance of surfing the net. 
- 
-Another thing to consider is this; the cache is particularly useful when bandwidth is slow or expensive because it can prevent the repetitive download of data, but if your network speed exceeds the I/O performance of your cache media, it will slow the experience down. In cases where network speed exceeds cache-disk I/O, some people run Squid cacheless.  
- 
----- 
- 
-===== Cacheless ===== 
- 
-This is useful if the performance of your cache disk is outstripped by the bandwidth of your ISP. 
- 
-There may be slowness in your proxy server as a result of the cache not being able to write fast enough to disk. 
- 
- 
-==== Test your disk speed ==== 
- 
-Ensure that you have sufficient space in the directory of your cache (/var/spool/squid).   
- 
-You will need just over 10GB of space to do this test (or you can change the test to do a smaller amount). 
- 
-<code bash> 
-df -h 
-</code> 
- 
-It is best to perform this test when the usage is low. Perform the following write test: 
- 
-<code bash> 
-dd if=/dev/zero of=/var/spool/squid/10GB bs=1024 count=10240000 && rm -rf /var/spool/squid/10GB 
-</code> 
- 
-You should get results similar to this: 
- 
-<code bash> 
-10240000+0 records in 
-10240000+0 records out 
-10485760000 bytes (10 GB) copied, 84.292 s, 124 MB/s 
-</code> 
- 
-The results will show the write speed of data to your directory. 
- 
-If the speed of the internet at your location outstrips the ability to write data in the cache, you may need to set up a no-cache option. 
- 
-As a typical rule of thumb, your cache to bandwidth ratio needs to perform at a factor of 16:1. 
- 
-For example, if your disk speed is 100MB/s (800Mb/s) you can perform well with a 50Mb/s pipe. 
- 
-If you have a 100Mb/s pipe, your disk performance must exceed 200MB/s. 
- 
-In this example, the drive performs at 124 MB/s which means that it should be sufficient for a 62 Mb/s ISP download pipe.  
- 
-<WRAP info> 
-**NOTE:**  Please note that these are approximations designed for simple planning. 
-</WRAP> 
- 
----- 
- 
-===== Speed things up ===== 
- 
-There are multiple ways on speeding up your cache. 
- 
-You could use a faster drive like an SSD. 
- 
-You could use multiple drives (like RAID 0 or RAID 10). 
- 
- 
-Caching is really designed to conserve bandwidth but in situations where the bandwidth exceeds your disk performance, you can just turn off the cache. 
- 
-This does NOT affect reports so it can be a real win in high bandwidth situations. 
- 
-To remove the cache you need to change a setting: 
- 
-|Maximum Object Size|0| 
-|Maximum Object Size in RAM|0| 
- 
-Remember to restart Squid for this to take effect. 
- 
----- 
- 
-===== Add more Subnets ===== 
- 
-Squid usually uses the LAN subnets of your network. 
- 
-To add addition lans, add additional CIDR subnets, to **Allowed Subnets** on the **ACL** tab. 
- 
-For example to add the networks of 10.1.1.0, 10.1.4.0, 10.1.5.0, 10.1.6.0, 10.1.7.0: 
- 
-<code> 
-10.1.1.0/24 10.1.4.0/22 
-</code> 
- 
-Remember to restart Squid for this to take effect. 
- 
  
pfsense/squid/optimizing_squid.1584900622.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki