root/README

Revision 5, 7.2 KB (checked in by nick, 4 years ago)
Line 
1ApacheTop Readme
2
3ApacheTop watches a logfile generated by Apache (in standard common or
4combined logformat, and generates human-parsable output in realtime.
5
6See the INSTALL file for ./configure options (there's a few newly added
7since v0.11)
8
9Several commandline options dictate some of its' behaviour:
10-f logfile
11        Select which file to watch.
12        Specify this option multiple times to watch multiple files
13
14-H hits | -T time
15        These options are mutually exclusive. Specify only one, if any at
16        all. They work as follows. ApacheTop maintains a table of
17        information internally containing all the relevant information about
18        the hits it's seen. This table can only be a finite size, so you
19        need to decide how big it's going to be. You have two options.
20        You can either:
21                Use -H to say "remember <this many> hits"
22        or      Use -T to say "remember all hits in <this many> seconds"
23       
24        The default (at the moment) is to remember hits for 30 seconds.
25        Setting this too large (whichever option you choose) will cause
26        ApacheTop to use more memory and more CPU time. My experimentation
27        finds that remembering no more than around 5000 requests works well.
28
29-q
30        Instructs ApacheTop to keep the querystrings, not remove them
31
32-l
33        Instructs ApacheTop to lowercase all URLs, thus /FOO and /foo are
34        treated as the same and accumulate the same statistics.
35
36-r
37        Enable resolving of hosts/ips (you need adns!)
38
39-s segments
40        Instructs ApacheTop to only keep the first <segments> parts of the
41        path. Trailing slashes are kept if present. Statistics are then
42        merged for each truncated url.
43        This is easiest to demonstrate with examples:
44        -s 2 would produce the following:
45        /media/x.jpg               ->  /media/x.jpg
46        /media/images/x.jpg        ->  /media/images/
47        /media/images/small/x.jpg  ->  /media/images/
48        /media/images/big/x.jpg    ->  /media/images/
49        Stats for the last three URLs would be merged in this case.
50
51-p
52        Instructs ApacheTop to keep the protocol (http:// usually) at the
53        front of its' referrer strings. Normal behaviour is to remove them
54        to give more room to more useful information.
55
56
57-d secs
58        Set default refresh delay, in seconds.
59
60
61Once it's running, you'll see a display like this:
62
63last hit: 09:17:07        atop runtime:  0 days, 00:58:20              09:17:08
64All:       638924 reqs ( 182.65/sec)      3433539K ( 981.6K/sec)  (   5.4K/req)
652xx:  455415 (71.3%) 3xx:  175745 (27.5%) 4xx:  7746 ( 1.2%) 5xx:    10 ( 0.0%)
66R ( 30s):    5195 reqs ( 173.17/sec)        25405K ( 846.8K/sec)  (   4.9K/req)
672xx:    3447 (66.4%) 3xx:    1715 (33.0%) 4xx:    33 ( 0.6%) 5xx:     0 ( 0.0%)
68                                                                               
69 REQS REQ/S    KB  KB/S URL                                                   
70  103   3.4  2983  99.4 /                                 
71   56   1.9   239   8.0 /tickerdata/story2.dat
72   47   1.6   104   3.6 /home/today/patina.js
73   44   1.5    82   2.8 /home/styles/home_d0e2ee.css
74<snip>
75
76
77The top line displays the time the last hit was seen, how long it's been
78running, and the current time.
79
80The next two lines display information about every single hit ApacheTop has
81processed in this incarnation.
82Firstly you see how many hits the data is representing. After that, the
83average number of hits/second since starting. Following that, the total number
84of KB witnessed; then the average KB/sec. Finally you see the average KB per
85request.
86The next line shows a breakdown of return codes; in this particular example you
87can see that 71.3% of the hits returned a 2xx code. 27.5% were 3xx, and so on.
88You also have the actual number of hits in each group.
89
90The two lines below this are where the commandline options -h and -t come in.
91The data in these lines reads the same as the two above them, but this data is
92only for the hits remembered in ApacheTop's internal table (remember that?).
93You can see how many seconds of data this represents in the R ( 30s) at the
94beginning of the line. This is for 30 seconds. These two lines of information
95are good for a "what is my server doing *right now*?" scenario, while the two
96above them are good for a picture over the course of a few minutes or hours.
97
98Underneath this header, you'll see a list of URLs along with their relevant
99number of requests, requests per second, kb, and kb per second.
100This list is generated from the internal table ApacheTop maintains. Thus, in
101this example, the list is being generated from the last 30 seconds of data. You
102can see the root page has been requested 103 times in the last 30 seconds,
103resulting in about 3.4 hits per second. Additionally, those 103 requests have
104resulted in 2983K of traffic, at an average of 99.4K/second.
105
106You can see the individual number of return codes a given item has generated
107by pressing 'n'. This alternates the numbers columns between hits/bytes
108and return codes for each item.
109
110
111You may sort this list by any of the first four columns; first press 's' to
112enter the 'sort submenu', and then one of the following:
113        r       Sort by REQUESTS
114        R       Sort by REQUESTS/SECOND
115        b       Sort by BYTES
116        B       Sort by BYTES/SECOND
117
118If you are viewing return code breakdown, then you'll see the following:
119        2       2xx
120        3       3xx
121        4       4xx
122        5       5xx
123
124Thus you can see where all your Page Not Founds are coming from and so on.
125Each sort order is individually maintained, so you can sort by 3xx, and
126Bytes, for example, then freely switch between number modes (using 'n')
127without losing either setting.
128
129Additionally, you can press d during runtime to switch the list of displayed
130items between URLs, IPs, and REFERRERs. URLs is the default, and simply
131groups together hits on your site and provides collated stats for each one.
132IPs, similarly, groups hits from each IP and shows you stats for it. So you
133can see how much bandwidth is being used by any given IP. REFERRERs is handy
134if you want to see where your traffic is coming from. The stats here reflect
135how many pages/kbytes have been served as a result of a particular referrer.
136
137To hold the current screen at any time, press p - statistics will still be
138generated in the background, but whatever is displayed at the current time
139is kept onscreen until you press p again.
140
141The asterisk beside the URL/IP/Referrer entry in the table can be used to
142restrict the display to any entry you're interested in. Use Up/Down arrow
143keys to move the asterisk to an entry you're interested in (you can use 'p'
144to freeze the display to give you more time to do so) and then press Right
145arrow to enter the display specific for that item.
146       
147        If the item you expanded is a URL, then IPs and Referrers specific
148        to that URL will be shown; ie, IPs (or hosts) which are visiting
149        that URL, and Referrers which are referring people to that URL.
150
151        If the item is an IP/Host, then URLs that IP/Host is visiting will
152        be displayed, along with the referrers that IP is coming from.
153
154        If the item is a Referrer, then URLs and IPs will be shown which
155        have that Referrer.
156
157You may turn off any of these subcolumns; press 't' to enter the toggle
158submenu, then:
159        u       Toggles URL subdisplay
160        r       Toggles REFERRER subdisplay
161        h       Toggles HOSTS subdisplay
162
163Thus you can only display HOSTS that are visiting a given URL, etc.
164Use Left arrow to return to the previous display.
165
166
167
168
169Bug reports and patches are very welcome. Please send any comments on.
170(if anyone fancies rewriting this README so its a bit more readable..)
171Chris Elsworth <chris@shagged.org>
Note: See TracBrowser for help on using the browser.