CoMo
Commander
- Registriert
- Dez. 2015
- Beiträge
- 2.881
Hallo,
ich spiele gerade etwas mit Squid rum. Ich habe den bei mir lokal auf dem Proxmox-Server installiert. In einem Alpine LXC-Container.
Vorerst soll der gar nichts filtern o.ä., sondern einfach nur cachen. Und zwar komplett im RAM.
Ich habe den in Windows als System-Proxy sowie in Firefox konfiguriert. Das funktioniert auch. Aber ich habe das Gefühl, dass da nix wirklich aus dem Cache beantwortet wird.
Meine Config sieht aktuell so aus:
Ich sehe aber kaum HIT Messages im LOG.
squidclient mgr:info gibt mir folgendes aus:
Ich hab zum Test mehrfach den Edge gestartet. Das äußert sich so:
Das sollte doch längst alles aus dem Cache beantwortet werden?
Warum dann aber immer noch
Was habe ich übersehen oder was stimmt mit meiner Config noch nicht?
ich spiele gerade etwas mit Squid rum. Ich habe den bei mir lokal auf dem Proxmox-Server installiert. In einem Alpine LXC-Container.
Vorerst soll der gar nichts filtern o.ä., sondern einfach nur cachen. Und zwar komplett im RAM.
Ich habe den in Windows als System-Proxy sowie in Firefox konfiguriert. Das funktioniert auch. Aber ich habe das Gefühl, dass da nix wirklich aus dem Cache beantwortet wird.
Meine Config sieht aktuell so aus:
Code:
cat /etc/squid/squid.conf
#
# Recommended minimum configuration:
#
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 0.0.0.1-0.255.255.255 # RFC 1122 "this" network (LAN)
acl localnet src 10.0.0.0/8 # RFC 1918 local private network (LAN)
acl localnet src 100.64.0.0/10 # RFC 6598 shared address space (CGN)
acl localnet src 169.254.0.0/16 # RFC 3927 link-local (directly plugged) machines
acl localnet src 172.16.0.0/12 # RFC 1918 local private network (LAN)
acl localnet src 192.168.0.0/16 # RFC 1918 local private network (LAN)
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines
#acl SSL_ports port 443
acl SSL_ports port 1-65535
acl Safe_ports port 1-65535
#acl Safe_ports port 80 # http
#acl Safe_ports port 21 # ftp
#acl Safe_ports port 443 # https
#acl Safe_ports port 70 # gopher
#acl Safe_ports port 210 # wais
#acl Safe_ports port 1025-65535 # unregistered ports
#acl Safe_ports port 280 # http-mgmt
#acl Safe_ports port 488 # gss-http
#acl Safe_ports port 591 # filemaker
#acl Safe_ports port 777 # multiling http
#
# Recommended minimum Access Permission configuration:
#
# Deny requests to certain unsafe ports
http_access deny !Safe_ports
# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports
# Only allow cachemgr access from localhost
http_access allow localhost manager
http_access deny manager
# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost
#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#
# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow localnet
http_access allow localhost
# And finally deny all other access to this proxy
http_access deny all
# Squid normally listens to port 3128
http_port 3128
# Uncomment and adjust the following to add a disk cache directory.
#cache_dir aufs /dev/shm/squid 10000000 max-size=1000000000
#cache_dir aufs /dev/shm/squid 10000 MB
#cache_dir aufs /dev/shm/squid 10000000 16 256 max-size=15000000
cache_dir ufs /dev/shm/squid 15000 16 256
#cache_mem 15000 MB
cache allow all
maximum_object_size 16 MB
# Leave coredumps in the first cache dir
coredump_dir /var/cache/squid
#
# Add any of your own refresh_pattern entries above these.
#
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
Ich sehe aber kaum HIT Messages im LOG.
squidclient mgr:info gibt mir folgendes aus:
Code:
HTTP/1.1 200 OK
Server: squid/5.7
Mime-Version: 1.0
Date: Mon, 08 May 2023 14:08:30 GMT
Content-Type: text/plain;charset=utf-8
Expires: Mon, 08 May 2023 14:08:30 GMT
Last-Modified: Mon, 08 May 2023 14:08:30 GMT
X-Cache: MISS from squid
X-Cache-Lookup: MISS from squid:3128
Via: 1.1 squid (squid/5.7)
Connection: close
Squid Object Cache: Version 5.7
Build Info:
Service Name: squid
Start Time: Mon, 08 May 2023 13:34:13 GMT
Current Time: Mon, 08 May 2023 14:08:30 GMT
Connection information for squid:
Number of clients accessing cache: 2
Number of HTTP requests received: 593
Number of ICP messages received: 0
Number of ICP messages sent: 0
Number of queued ICP replies: 0
Number of HTCP messages received: 0
Number of HTCP messages sent: 0
Request failure ratio: 0.00
Average HTTP requests per minute since start: 17.3
Average ICP messages per minute since start: 0.0
Select loop called: 183275 times, 11.227 ms avg
Cache information for squid:
Hits as % of all requests: 5min: 0.0%, 60min: 0.0%
Hits as % of bytes sent: 5min: -0.0%, 60min: 0.0%
Memory hits as % of hit requests: 5min: 0.0%, 60min: 0.0%
Disk hits as % of hit requests: 5min: 0.0%, 60min: 0.0%
Storage Swap size: 22752 KB
Storage Swap capacity: 0.1% used, 99.9% free
Storage Mem size: 228 KB
Storage Mem capacity: 0.1% used, 99.9% free
Mean Object Size: 361.14 KB
Requests given to unlinkd: 0
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 12.00465 5.63745
Cache Misses: 0.00000 0.00000
Cache Hits: 0.00000 0.00000
Near Hits: 0.00000 0.00000
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.01609 0.02033
ICP Queries: 0.00000 0.00000
Resource usage for squid:
UP Time: 2057.710 seconds
CPU Time: 2.125 seconds
CPU Usage: 0.10%
CPU Usage, 5 minute avg: 0.09%
CPU Usage, 60 minute avg: 0.10%
Maximum Resident Size: 83744 KB
Page faults with physical i/o: 0
Memory accounted for:
Total accounted: 1855 KB
memPoolAlloc calls: 56744
memPoolFree calls: 58941
File descriptor usage for squid:
Maximum number of file descriptors: 1024
Largest file desc currently in use: 88
Number of file desc currently in use: 63
Files queued for open: 0
Available number of file descriptors: 961
Reserved number of file descriptors: 100
Store Disk files open: 0
Internal Data Structures:
116 StoreEntries
55 StoreEntries with MemObjects
2 Hot Object Cache Items
63 on-disk objects
Ich hab zum Test mehrfach den Edge gestartet. Das äußert sich so:
Code:
tail -f /var/log/squid/access.log
1683554993.509 0 192.168.100.65 NONE_NONE/500 0 CONNECT api.edgeoffer.microsoft.com:443 - HIER_NONE/- -
1683554993.781 0 192.168.100.65 NONE_NONE/500 0 CONNECT sb.scorecardresearch.com:443 - HIER_NONE/- -
1683554993.784 0 192.168.100.65 NONE_NONE/500 0 CONNECT c.msn.com:443 - HIER_NONE/- -
1683554993.784 0 192.168.100.65 NONE_NONE/500 0 CONNECT c.bing.com:443 - HIER_NONE/- -
1683554993.939 0 192.168.100.65 NONE_NONE/500 0 CONNECT c.msn.com:443 - HIER_NONE/- -
1683554993.951 0 192.168.100.65 NONE_NONE/500 0 CONNECT sb.scorecardresearch.com:443 - HIER_NONE/- -
1683554994.017 0 192.168.100.65 NONE_NONE/500 0 CONNECT arc.msn.com:443 - HIER_NONE/- -
1683554994.109 0 192.168.100.65 NONE_NONE/500 0 CONNECT browser.events.data.msn.com:443 - HIER_NONE/- -
1683554994.112 0 192.168.100.65 NONE_NONE/500 0 CONNECT browser.events.data.msn.com:443 - HIER_NONE/- -
1683554994.115 0 192.168.100.65 NONE_NONE/500 0 CONNECT browser.events.data.msn.com:443 - HIER_NONE/- -
1683554994.155 0 192.168.100.65 NONE_NONE/500 0 CONNECT browser.events.data.msn.com:443 - HIER_NONE/- -
1683554994.211 0 192.168.100.65 NONE_NONE/500 0 CONNECT srtb.msn.com:443 - HIER_NONE/- -
1683554994.216 0 192.168.100.65 NONE_NONE/500 0 CONNECT srtb.msn.com:443 - HIER_NONE/- -
1683554994.230 0 192.168.100.65 NONE_NONE/500 0 CONNECT browser.events.data.msn.com:443 - HIER_NONE/- -
1683554994.425 0 192.168.100.65 NONE_NONE/500 0 CONNECT srtb.msn.com:443 - HIER_NONE/- -
1683554994.492 0 192.168.100.65 NONE_NONE/500 0 CONNECT browser.events.data.msn.com:443 - HIER_NONE/- -
1683554994.910 0 192.168.100.65 NONE_NONE/500 0 CONNECT browser.events.data.msn.com:443 - HIER_NONE/- -
1683554995.021 0 192.168.100.65 NONE_NONE/500 0 CONNECT browser.events.data.msn.com:443 - HIER_NONE/- -
1683554995.921 0 192.168.100.65 NONE_NONE/500 0 CONNECT browser.events.data.msn.com:443 - HIER_NONE/- -
1683554996.431 0 192.168.100.65 NONE_NONE/500 0 CONNECT browser.events.data.msn.com:443 - HIER_NONE/- -
1683554997.996 0 192.168.100.65 NONE_NONE/500 0 CONNECT browser.events.data.msn.com:443 - HIER_NONE/- -
1683555000.408 0 192.168.100.65 NONE_NONE/500 0 CONNECT c.msn.com:443 - HIER_NONE/- -
1683555000.409 0 192.168.100.65 NONE_NONE/500 0 CONNECT sb.scorecardresearch.com:443 - HIER_NONE/- -
1683555000.409 0 192.168.100.65 NONE_NONE/500 0 CONNECT c.bing.com:443 - HIER_NONE/- -
1683555000.517 0 192.168.100.65 NONE_NONE/500 0 CONNECT arc.msn.com:443 - HIER_NONE/- -
1683555001.026 0 192.168.100.65 NONE_NONE/500 0 CONNECT browser.events.data.msn.com:443 - HIER_NONE/- -
1683555001.472 0 192.168.100.65 NONE_NONE/500 0 CONNECT srtb.msn.com:443 - HIER_NONE/- -
1683555003.856 10072 192.168.100.65 TCP_TUNNEL/200 3970 CONNECT img-s-msn-com.akamaized.net:443 - HIER_DIRECT/23.53.40.209 -
1683555004.096 0 192.168.100.65 NONE_NONE/500 0 CONNECT browser.events.data.msn.com:443 - HIER_NONE/- -
1683555004.781 10111 192.168.100.65 TCP_TUNNEL/200 6685 CONNECT r.bing.com:443 - HIER_DIRECT/23.53.43.147 -
1683555004.782 10111 192.168.100.65 TCP_TUNNEL/200 6685 CONNECT r.bing.com:443 - HIER_DIRECT/23.53.43.147 -
1683555007.004 0 192.168.100.65 NONE_NONE/500 0 CONNECT browser.events.data.msn.com:443 - HIER_NONE/- -
1683555009.998 0 192.168.100.65 NONE_NONE/500 0 CONNECT browser.events.data.msn.com:443 - HIER_NONE/- -
1683555013.007 0 192.168.100.65 NONE_NONE/500 0 CONNECT browser.events.data.msn.com:443 - HIER_NONE/- -
Das sollte doch längst alles aus dem Cache beantwortet werden?
Warum dann aber immer noch
Code:
Cache information for squid:
Hits as % of all requests: 5min: 0.0%, 60min: 0.0%
Hits as % of bytes sent: 5min: -0.0%, 60min: 0.0%
Memory hits as % of hit requests: 5min: 0.0%, 60min: 0.0%
Was habe ich übersehen oder was stimmt mit meiner Config noch nicht?