Online Book Reader

Home Category

Squid_ The Definitive Guide - Duane Wessels [138]

By Root 2137 0

Finally, this page ends with a table labeled Http Fields Stats (replies and requests). For each header, this table shows three values: #alive, %err, and %repeat.

The #alive column shows how many instances of this header are currently stored in memory. HTTP headers are kept in memory for both active requests/responses and for completed objects stored in the memory cache.

The %err column shows the percentage of times Squid encountered an error while parsing this header. Common errors include incorrect date formats for Date, Expires, Last-Modified, and similar headers. The value -1 indicates no errors.

The %repeat column indicates the number of times that a particular header is repeated in a single request or response. These aren't errors because HTTP allows headers to be repeated.

via_headers: Via Request Headers

This page is available only with the ./configure —enable-forw-via-db option. The information in this page is intended to help cache administrators understand where client requests come from. When enabled, Squid counts the number of times each unique Via header occurs in client requests.

The Via header contains a list of downstream proxies that have forwarded the request so far. When a proxy forwards a request, it should append its hostname and other identifying information to the Via header. With the information in this database, you can, in theory, reconstruct the hierarchy of proxies forwarding requests through yours.

Squid prints the Via database entries in a random order. The output may look something like this:

4 1.0 proxy.firekitten.org:3128 (squid/2.5.STABLE1)

1 1.0 xnsproxy.dyndns.org:3128 (squid/2.5.PRE3-20020125)

1751 1.0 nt04.rmtcc.cc.oh.us:3128 (Squid/2.4.STABLE6),

1.0 tasksmart.rmtcc.cc.oh.us:3128 (Squid/2.4.STABLE7)

137 1.0 reg3.bdg.telco.co.id:8080 (Squid/2.2.STABLE5),

1.0 c1.telco.co.id:8080 (Squid/2.4.STABLE6),

1.0 cache2.telco.co.id:8080 (Squid/2.4.STABLE1)

53 1.0 IS_GW_312:3128 (Squid/2.4.STABLE6)

60 1.0 proxy.kiltron.net:3128 (Squid/2.4.STABLE7)

815 1.1 DORM

In this example, Squid received 1751 requests that previously passed through two other proxies (nt04 and tasksmart). Note that only proxies add a Via header. Requests from user-agents usually don't have the header and, therefore, aren't counted in this database.

As you can see, the Via headers reveal some semiprivate information, such as hostnames, port numbers, and software versions. Please take care to respect the privacy of your users if you enable this feature.

The Via database is stored entirely in memory and is lost if Squid restarts. The database is cleared whenever you rotate the log files (see Section 13.7).

forw_headers: X-Forwarded-For Request Headers

This page is available only with the ./configure —enable-forw-via-db option. It is similar to the via_headers page, except that it displays the accumulation of X-Forwarded-For headers.

X-Forwarded-For is a nonstandard HTTP header that originated with the Squid project. Its value is a list of client IP addresses. In other words, when Squid receives and forwards a request, it appends the client's IP address to this header. It is similar to Via because the header grows each time a proxy passes the request on towards the origin server.

The forw_headers output is similar to via_headers. Each line begins with an integer, followed by a header value. The integer indicates how many times that particular X-Forwarded-For value was received. For example:

1 10.37.1.56, 10.1.83.8

3 10.3.33.77, 10.1.83.8

569 116.120.203.54

21 10.65.18.200, 10.1.83.120

31 116.120.204.6

5 10.1.92.7, 10.1.83.120

1 10.3.65.122, 10.3.1.201, 10.1.83.8

2 10.73.73.51, 10.1.83.120

1 10.1.68.141, 10.1.83.8

3 10.1.92.7, 10.1.83.122

As with via_headers, this database is also stored in memory and is lost if Squid exits. The database is cleared each time you rotate Squid's log files.

menu: This Cache Manager Menu

This page simply displays a listing of the other cache manager pages. You can use it if you forget the name of a page or if you want to know if certain optional pages are available.

Return Main Page Previous Page Next Page

®Online Book Reader