Squid what is icp




















Unfortunately, there is no way to make Squid allow only cache-misses for cached, stale objects. Allowing cache misses for siblings also leaves your cache open to potential abuse. The administrator of the sibling cache may change it to a parent relationship without your knowledge or permission. This reduces the load placed on Squid and allows the rebuild process to complete sooner.

If you enable the netdb feature see Section The goal behind it is to accept only requests for origin servers Squid can reach. This can help reduce the number of failed HTTP requests and increase the chance that the end user receives the data promptly. However, a significant percentage of origin server sites intentionally filter out ICMP traffic.

If Squid doesn't have any RTT measurements for the origin server in question, it sends out an ICMP ping subject to the rate limiting mentioned previously. See the section Section This is because Squid uses the same socket for sending and receiving ICP messages.

It is perhaps a bad design decision in retrospect. Squid sends ICP queries to its neighbors for most requests by default. After sending one or more queries, Squid waits some amount of time for ICP replies to arrive. Otherwise, Squid waits until all replies arrive or until a timeout occurs. The timeout is calculated dynamically, based on the following algorithm. Squid knows the average round-trip time between itself and each neighbor, taken from recent ICP transactions.

In other words, the query timeout is twice the mean of RTTs for each neighbor queried. Squid ignores neighbors that appear to be down when calculating the timeout. In some cases, the algorithm doesn't work well, especially if you have neighbors with widely varying RTTs.

It comes into play only when all parents report a cache miss. Normally, Squid selects the parent whose reply arrives first. In fact, it remembers which parent has the best RTT for the query. That is, your cache won't send any queries to the neighbor for cache misses. It is often used with the default option.

It instructs Squid to select the parent based only on netdb RTT measurements and not the order in which replies arrive. This option requires netdb at both ends.

As mentioned in the section Section In this section, we'll follow all the steps involved in this process. A Squid cache, acting as an ICP client, prepares to send a query to one or more neighbors. If the neighbor is configured to make netdb measurements, it searches the database for the origin server hostname.

Thus, it finds a netdb entry only if that particular host has already been measured. These are added to the local netdb so that, in the future, Squid knows the approximate RTT from the neighbor to the origin server.

The request is logged to access. However, if the closest-only option is set for a parent cache, Squid never selects it as a "first parent. As you already know, ICP has poor scaling properties. The number of messages is proportional to the number of neighbors.

Rather than send N messages to N neighbors, Squid sends one message to a multicast address. The multicast routing infrastructure makes sure each neighbor receives a copy of the message. Edwards, Leonard A. Giuliano, and Brian R. Wright Addison Wesley for more information on the inner workings of multicast. Note that ICP replies are always sent via unicast. This is because ICP replies may be different e.

The bottom line is that multicast only reduces message counts for queries. Historically, I've found multicast infrastructure unstable and unreliable.

This option has three different formats, which I've fully described in Section Specifies how long Squid should wait when establishing a TCP connection to the neighbor. By using a lower timeout, Squid gives up on the neighbor quickly and tries forwarding the request elsewhere. Instructs Squid to omit the Cache-control: only-if-cached directive for requests sent to a sibling. Places a limit on the number of simultaneous connections that Squid can open to the neighbor.

When this limit is reached, Squid excludes the neighbor from its selection algorithm. If you add this option, don't forget to also change the port number. Squid uses as the default HTCP port. See Chapter The load factor value specifies the fraction of requests that this neighbor will receive. The load factor values for all neighbors must add up to 1.

Previous page. Table of content. Next page. See Section We also use cache keys with MD5 hashes. Every object in the cache--whether saved on disk or currently being downloaded--has a cache key. We use MD5 checksums for cache keys.

The Squid cache uses the notions of private and public cache keys. An object can start out as being private, but may later be changed to public status. Private objects are associated with only a single client whereas a public object may be sent to multiple clients at the same time. In other words, public objects can be located by any cache client. Private keys can only be located by a single client--the one who requested it.

Objects are changed from private to public after all of the HTTP reply headers have been received and parsed. In some cases, the reply headers will indicate the object should not be made public. For example, if the private Cache-Control directive is used. We use it to collect data for Plankton. It may. This is an old feature from the Harvest cache software.

With more attention focused on security, many administrators filter UDP packets to port 7. This made admins extremely nervous about any packets hitting port 7 on their systems, and they made complaints. If you're seeing packets to port 7 that are coming from a Squid cache remote port , then its probably a very old version of Squid.

By default Squid checks that the addresses match. If not, Squid ignores the response. There are a number of reasons why this would happen: Your DNS name server just works this way, either because its been configured to, or because its stupid and doesn't know any better. You have a weird broadcast address, like 0. Somebody is trying to send spoofed DNS responses to your cache. If you recognize the IP address in the warning as one of your name server hosts, then its probably numbers 1 or 2. You should prefer to configure your set of possible nameserver IPs correctly.

Note: The information here is current for version 2. See storeDirMapAllocate in the source code. This is done with the storeDirSelectSwapDir function. These directories are then used, in order of having the most available space. Essentially the swap file numbers are allocated sequentially. For example, if the last number allocated happens to be , then the next one will be the first number after that is not already being used.

Byte hit ratio is calculated a bit differently than Request hit ratio. Squid counts the number of bytes read from the network on the server-side, and the number of bytes written to the client-side. Cache Digest messages are quite large.

User-aborted requests. Some range requests, in combination with Squid bugs, can consume more bandwidth on the server-side than on the client-side. In a range request, the client is asking for only some part of the object. Squid may decide to retrieve the whole object anyway, so that it can be used later on. This means downloading more from the server than sending to the client.

First you need to understand the difference between public and private keys. In other words, when Squid gets an ICP reply, it uses the 'reqnum' value to build the private cache key for the pending object. Some ICP implementations always set the 'reqnum' field to zero when they send a reply. Squid can not use private cache keys with such neighbor caches because Squid will not be able to locate cache keys for those ICP replies.

Thus, if Squid detects a neighbor cache that sends zero reqnum's, it disables the use of private cache keys. Not having private cache keys has some important privacy implications. Two users could receive one response that was meant for only one of the users. This response could contain personal, confidential information.

You will need to disable the 'zero reqnum' neighbor if you want Squid to use private cache keys. TCP allows connections to be in a "half-closed" state. This is accomplished with the shutdown 2 system call. In Squid, this means that a client has closed its side of the connection for writing, but leaves it open for reading. Half-closed connections are tricky because Squid can't tell the difference between a half-closed connection, and a fully closed one.

If Squid tries to read a connection, and read returns 0, and Squid knows that the client doesn't have the whole response yet, Squid puts marks the filedescriptor as half-closed. Most likely the client has aborted the request and the connection is really closed. However, there is a slight chance that the client is using the shutdown call, and that it can still read the response.

To disable half-closed connections, simply put this in squid. NP: from Squid This option is only relevant for Squid However with Squid version 2. Then, in squid. If you compare df output and cachemgr storedir output, you will notice that actual disk usage is greater than what Squid reports. This may be due to a number of reasons: Squid doesn't keep track of the size of the swap. Directory entries and take up filesystem space. Other applications might be using the same disk partition.

Your filesystem block size might be larger than what Squid thinks. When calculating total disk usage, Squid rounds file sizes up to a whole number of byte blocks. If your filesystem uses larger blocks, then some "wasted" space is not accounted. Your cache has suffered some minor corruption and some objects have gotten lost without being removed from the swap.

Over time, Squid will detect this and automatically fix it. It is NOT used in the following cases: Squid As your cache becomes more busy, the LRU age becomes lower so that more objects will be removed to make room for the new ones. Ideally, your cache ill have an LRU age value in the range of at least 3 days. If the LRU age is lower than 3 days, then your cache is probably not big enough to handle the volume of requests it receives.

By adding more disk space you could increase your cache hit ratio. Consider a pair of caches named A and B. It may be the case that A can reach B, and vice-versa, but B has poor reachability to the rest of the Internet. In this case, we would like B to recognize that it has poor reachability and somehow convey this fact to its neighbor caches. Squid will track the ratio of failed-to-successful requests over short time periods. When the failed-to-successful ratio exceeds 1.



0コメント

  • 1000 / 1000