<html><head><meta http-equiv="content-type" content="text/html; charset=GB2312"><style>body { line-height: 1.5; }body { font-size: 10.5pt; font-family: 'Microsoft YaHei UI'; color: rgb(0, 0, 0); line-height: 1.5; }body { font-size: 10.5pt; font-family: 'Microsoft YaHei UI'; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div><span></span>hi squid developer:</div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">    we use squid-4.9 meet two questions£º</span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">    </span><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">  (1)some request have timeout, not response to user data neither to request upstream from log information.</span></div><div>      (2)<span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">memory leak, now we need restart squid to release memory.</span></div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;"><br></span></div><div><span style="color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">   </span><span style="color: rgb(0, 0, 0); font-size: 10.5pt; line-height: 1.5; background-color: rgba(0, 0, 0, 0);">    look forward to response.</span></div><div><br></div><div>1. log format</div><div><div>logformat logfmt_cdn [%{%Y-%m-%d:%H:%M:%S}tl.%03tu] %{X-Real-IP}>h %>a:%>p %<a:%<p %rm %03>Hs %<st %>st HTTP/%>rv "%>rs://%>rd:%>rP" "%>rp" "%{Referer}>h" "%{User-Agent}>h" %tr %<pt %03<Hs %Ss %Sh/%<A "%{Range}>h" "%{xxx-ComeFrom}>h" "%{xxx-Origin-Domain}>h"</div></div><div><br></div><div>2. log infomation</div><div><div>[2020-06-01:10:59:40.346] 123.124.197.113 10.8.120.9:40680 -:- GET 206 396 740 HTTP/1.1 "http://download.xx.com:80" "/xx_mac_install_1.0.0.114_s.dmg" "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36" 850826 - - TCP_MISS_ABORTED HIER_NONE/- "bytes=25165824-25165824" "tcdn" "download.xx.com"</div><div>[2020-06-01:11:02:12.629] 123.124.197.113 10.8.120.10:49318 -:- GET 206 402 743 HTTP/1.1 "http://download.xx.com:80" "/xx_mac_install_1.0.0.114_s.dmg" "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36" 850299 - - TCP_MISS_ABORTED HIER_NONE/- "bytes=48234496-49283071" "tcdn" "download.xx.com"</div></div><div><br></div><div>3. topology</div><div>  origin site <---  [squid <- nginx]  <--- bussiness cdn <--- users</div><div><br></div><div>4.  config files</div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;"><br></span></div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">squid.conf</span></div><div><div>coredump_dir /var/spool/squid</div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">pid_filename /var/run/squid.pid</span></div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">httpd_suppress_version_string on</span></div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">via off</span></div><div>cache_effective_user squid</div><div>cache_effective_group squid</div><div><br></div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">max_filedescriptors 65535 </span></div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">cache_swap_low 90</span></div><div>cache_swap_high 95</div><div>minimum_object_size 0 KB</div><div>maximum_object_size 200 MB</div><div><br></div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">acl urlpath_QUERY urlpath_regex -i cgi-bin \? \.php \.xml</span></div><div>no_cache deny urlpath_QUERY  </div><div># acl urlpath_denyssl urlpath_regex -i ^https:\\</div><div># no_cache deny urlpath_denyssl</div><div><br></div><div>logformat logfmt_cdn [%{%Y-%m-%d:%H:%M:%S}tl.%03tu] %{X-Real-IP}>h %>a:%>p %<a:%<p %rm %03>Hs %<st %>st HTTP/%>rv "%>rs://%>rd:%>rP" "%>rp" "%{Referer}>h" "%{User-Agent}>h" %tr %<pt %03<Hs %Ss %Sh/%<A "%{Range}>h" "%{EEO-ComeFrom}>h" "%{xxx-Origin-Domain}>h"</div><div>acl nolog_url url_regex -i cache_object</div><div><br></div><div>cache_log /data/cache.log</div><div>cache_store_log none<span class="Apple-tab-span" style="white-space:pre">                     </span></div><div>logfile_rotate 1</div><div><br></div><div>quick_abort_min 512 KB</div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">quick_abort_max 512 KB</span></div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">quick_abort_pct 80</span></div><div><br></div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">range_offset_limit -1</span></div><div>reload_into_ims on</div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;"># collapsed_forwarding on</span></div><div><br></div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">client_db off</span></div><div>dns_v4_first on</div><div>dns_nameservers 127.0.0.1</div><div>dns_retransmit_interval 0.01 second</div><div>dns_timeout 0.01 second</div><div>dns_defnames off</div><div>ignore_unknown_nameservers on</div><div>ipcache_size 10240</div><div>ipcache_low 90</div><div>ipcache_high 95</div><div>fqdncache_size 1024</div><div>positive_dns_ttl 365 days</div><div>negative_dns_ttl 365 days</div><div><br></div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">peer_connect_timeout 30 seconds</span></div><div><br></div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">connect_timeout 10 minutes</span></div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">client_idle_pconn_timeout 10 minutes</span></div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">server_idle_pconn_timeout 10 minutes</span></div><div><br></div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">client_persistent_connections on</span></div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">server_persistent_connections off</span></div><div>half_closed_clients off</div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">request_entities off</span></div><div><br></div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">reply_header_access Server deny all</span></div><div>reply_header_access X-Cache-Lookup deny all</div><div><br></div><div>include /etc/squid/upstream.conf</div></div><div><div>include /etc/squid/node.conf</div></div><div><br></div><div><br></div><div>upstream.conf</div><div><div>acl dstdomain_www.xxx.com  dstdomain www.xxx.com</div><div>cache_peer_access peer2www1 allow dstdomain_<span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;"> </span><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">www.xxx.com</span></div><div>cache_peer_access peer2www1 deny all</div><div>cache_peer_access peer2www2 allow dstdomain_<span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;"> </span><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">www.xxx.com</span></div><div>cache_peer_access peer2www2 deny all</div><div>access_log daemon:/data/squid/ www.xxx.com_all.access.log logfmt_cdn dstdomain_ www.xxx.com !nolog_url</div><div><br></div></div><div><br></div><div><br></div><div>node.conf</div><div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">workers 6</span></div><div>hopeless_kid_revival_delay 1 year</div><div>cpu_affinity_map process_numbers=1,2,3,4,5,6 cores=1,3,5,7,9,11</div><div>cache_mem 60 GB</div><div>maximum_object_size_in_memory 100 MB</div><div><br></div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: transparent;">cache_dir rock /data1/squid/cache1 400000 max-size=204800000</span></div><div><br></div></div><div><div>cache_peer 10.1.1.13 parent 61160 0 no-query no-digest no-netdb-exchange originserver forceddomain=www.xxx.com   name=peer2www1   round-robin weight=1 connect-fail-limit=3</div><div>cache_peer 10.1.1.14 parent 61160 0 no-query no-digest no-netdb-exchange originserver forceddomain=www.xxx.com   name=peer2www2   round-robin weight=1 connect-fail-limit=3</div></div><div><span><div style="margin: 10px; font-family: verdana;"><br></div></span></div>
</body></html>