Richard Bruno
navigation
Home
admin









Squid 3
October 18th, 2016

Table des matières



Notes de configuration
Squid Cache Manager
Access.log
Lectures

# squid3 -v
Squid Cache: Version 3.4.8



Notes de configuration



cache_mem
Correspond au cache mémoire, la valeur dépend de votre système. Par défaut squid utilise 8 Mo. Cette taille doit être la plus grande possible afin d'améliorer les performances (Considérez 1/3 de la mémoire que vous réservez à Squid). Il faut avec cache_mem régler cache_mem_low et cache_mem_high qui sont les valeurs limites de remplissage du cache mémoire. Par défaut les valeurs sont 75 % et 90 %. Lorsque la valeur de 90 % est atteinte le cache mémoire se vide jusqu'à 75 %. Les valeurs par défaut sont correctes dans la plupart des cas.

Source : http://www.linux-france.org/prj/edu/archinet/systeme/ch40s02.html

Utilisation de la mémoire

"As a rule of thumb on Squid uses approximately 10 MB of RAM per GB of the total of all cache_dirs (more on 64 bit servers such as Alpha), plus your cache_mem setting and about an additional 10-20MB. It is recommended to have at least twice this amount of physical RAM available on your Squid server.

So, if you have 1 GB RAM, squid should be configured to use about 500 MB (OS normally uses very small amount of memmory)."


Mes chiffres :
sur une machine 64 bits à 2Go de mémoire, il faut compter 14MB / 1GB de disques. J'ai alloué 10GB => 140MB de mémoire
cache_mem = 800MB
140MB + 800 MB + 20MB = 960MB < la moitié de la mémoire réelle.

Sources : h30499.www3.hp.com/t5/System-Administration/recommended-size-cache-mem/td-p/4066966#.VInIlznjLck
http://wiki.squid-cache.org/SquidFaq/SquidMemory

Squid Cache Manager



The cache manager is a component of Squid which provides management controls and reports displaying statistics about the squid process as it runs.

Source : http://wiki.squid-cache.org/Features/CacheManager

Statistiques d'utilisation du cache :

squidclient mgr:info



On obtient des infos intéressantes. par exemple :
Des ratios

Cache information for squid:
Hits as % of all requests: 5min: 51.8%, 60min: 16.0%
Hits as % of bytes sent: 5min: 61.4%, 60min: 17.9%



Hit ratio will only go up when the disk cache is nicely filled and people's repetitive surfing behaviour starts showing up. Same goes for byte ratio, though that one will always be lower. You should expect to see close to 50% hit ratio and myabe 20-30% byte ratio over time.

Source : https://forums.freebsd.org/threads/squid-performance.11302/

Le nombre de clients

Connection information for squid:
Number of clients accessing cache: 8




squidclient -h localhost cache_object://localhost/ mgr:utilization



squidclient -h localhost cache_object://localhost/ mgr:storedir



Erreur

# squidclient mgr:info
assert "false" at line 645
IpAddress invalid? with IsIPv4()=F, IsIPv6()=T
ADDRESS: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
squidclient: IpAddress.cc:645: void IpAddress::GetAddrInfo(addrinfo*&, int) const: Assertion `false' failed.
Abandon



# squidclient -h localhost mgr:info
assert "false" at line 645
IpAddress invalid? with IsIPv4()=F, IsIPv6()=T
ADDRESS: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
squidclient: IpAddress.cc:645: void IpAddress::GetAddrInfo(addrinfo*&, int) const: Assertion `false' failed.
Abandon



Une solution : spécifier l'IP :

# squidclient -h 127.0.0.1 mgr:info
HTTP/1.0 200 OK



Access.log



TCP : Requests on the HTTP port (usually 3128).

UDP : Requests on the ICP port (usually 3130) or HTCP port (usually 4128). If ICP logging was disabled using the log_icp_queries option, no ICP replies will be logged.

NONE : Squid delivered an unusual response or no response at all. Seen with cachemgr requests and errors, usually when the transaction fails before being classified into one of the above outcomes. Also seen with responses to CONNECT requests.
These tags are optional and describe why the particular handling was performed or where the request came from:

CLIENT : The client request placed limits affecting the response. Usually seen with client issued a "no-cache", or analogous cache control command along with the request. Thus, the cache has to validate the object.

IMS : The client sent a revalidation (conditional) request.

ASYNC : The request was generated internally by Squid. Usually this is background fetches for cache information exchanges, background revalidation from stale-while-revalidate cache controls, or ESI sub-objects being loaded.

SWAPFAIL : The object was believed to be in the cache, but could not be accessed. A new copy was requested from the server.

REFRESH : A revalidation (conditional) request was sent to the server.

SHARED : This request was combined with an existing transaction by collapsed forwarding. NOTE: the existing request is not marked as SHARED.

REPLY : The HTTP reply from server or peer. Usually seen on DENIED due to http_reply_access ACLs preventing delivery of servers response object to the client.

HIT : The response object delivered was the local cache object.

MEM : Additional tag indicating the response object came from memory cache, avoiding disk accesses. Only seen on HIT responses.

MISS : The response object delivered was the network response object.

DENIED : The request was denied by access controls.

NOFETCH : A ICP specific type. Indicating service is alive, but not to be used for this request. Sent during "-Y" startup, or during frequent failures, a cache in hit only mode will return either UDP_HIT or UDP_MISS_NOFETCH. Neighbours will thus only fetch hits.

TUNNEL : A binary tunnel was established for this transaction. Only on Squid-3.5+

NEGATIVE : Only seen on HIT responses. Indicating the response was a cached error response. e.g. "404 not found"

STALE : The object was cached and served stale. This is usually caused by stale-while-revalidate or stale-if-error cache controls.

OFFLINE : The requested object was retrieved from the cache during offline_mode. The offline mode never validates any object.

INVALID : An invalid request was received. An error response was delivered indicating what the problem was.

FAIL : Only seen on REFRESH to indicate the revalidation request failed. The response object may be the server provided network error or the stale object which was being revalidated depending on stale-if-error cache control.

MODIFIED : Only seen on REFRESH responses to indicate revalidation produced a new modified object.

UNMODIFIED : Only seen on REFRESH responses to indicate revalidation produced a 304 (Not Modified) status. Which was relayed to the client.

REDIRECT : Squid generated an HTTP redirect response to this request. Only on Squid-3.2+ or Squid built with -DLOG_TCP_REDIRECTS compiler flag.

Source : http://wiki.squid-cache.org/SquidFaq/SquidLogs#access.log

Lectures



http://wiki.squid-cache.org/Features/
http://www.squid-cache.org/Doc/config/



Dernières modifs
Réseau (June 21st, 2021)
PacketFence 4.5.0 (October 18th, 2016)
Cisco (October 18th, 2016)
Connexion VPN sous MAC (October 18th, 2016)
DELL 5424 (October 18th, 2016)
DELL 6224 (October 18th, 2016)
DELL MXL (October 18th, 2016)

Contact
Pour m'envoyer un mail,
Pour me laisser un commentaire :
richard.brunooo
chez
gmail.com


powered by kure, modified by Bruno