visits
Count access-log requests and unique IP addresses for the last hour, day, or week, and estimate how many requests the server could handle
- Command:
/go/visits - Category: Monitoring
- Required arguments: None (the default window is the last 24 hours)
- Output: Two lines: requests with a capacity estimate, and the number of unique IPs
- Last updated: 2026-11-20
On this page: Overview · Quick start · Syntax · Arguments · Output · Examples · Troubleshooting · Details · See also
Overview
/go/visits answers two questions: how much traffic did the server get, and roughly how much more could it take? It:
- counts the requests in the access log for a time window you choose
- counts the unique IP addresses in the same window
- reads the server's average load and memory use
- estimates the number of requests the server could handle in that window before its busiest resource is full
It only reads logs. Nothing is changed.
[!NOTE] The capacity figure is a rough guide. It assumes all the load comes from visits and that load grows in step with them. See How the estimate works.
Quick start
# Last 24 hours
/go/visits
Syntax
/go/visits [hour|day|week|<seconds>]
Arguments
| Argument | Window | Notes |
|---|---|---|
| none | Last 24 hours | The default. |
hour |
Last 3,600 seconds | |
day |
Last 86,400 seconds | |
week |
Last 604,800 seconds | |
<seconds> |
The given number of seconds before now | A whole number, for example 1800 for 30 minutes. |
| anything else | Last 24 hours | No error. An unknown word such as month silently falls back to the default. |
Output
12840 / 58363
Count Unique IPs: 3120
The sample above is illustrative.
| Line | Meaning |
|---|---|
| First line, left number | Requests in the window. |
| First line, right number | Estimated requests the server could handle in the same window at 100% of its busiest resource. |
Count Unique IPs |
Distinct client addresses in the window. |
Examples
# Last 24 hours
/go/visits
# Last hour
/go/visits hour
# Last week
/go/visits week
# Last 30 minutes
/go/visits 1800
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
division by zero attempted or an empty right-hand number |
The average load or memory figure is 0 (or the log is empty), so the estimate cannot be calculated. |
Run loadavg and memoryavg, and try again when they have data. |
[: -ge: unary operator expected |
The load or memory log is empty. | Same as above. |
Visits is 0 |
No traffic in the window, the log was rotated, or the log format is different. | Try a longer window, and check the access log. |
week or day shows less than expected |
Only the current access log is read. If logs rotate daily, older requests are not in it. | Check the rotation with logrotate. |
A typo such as weeks still works |
Unknown words fall back to 24 hours. | Use hour, day, week, or a number of seconds. |
| Visits looks too high | Every request is counted: images, CSS, scripts, bots, and health checks. | Look closer with httptop, bots, or iptop. |
| Capacity looks too low or too high | The load average covers a longer period than the window, and non-visit work such as backups or cron raises it. | Treat it as a rough guide. |
| Slow on a busy server | The whole log is read twice. | Wait, or run at a quiet time. |
Details
What it does
flowchart TD
A["/go/visits [window]"] --> B["Append the command to /var/log/go/visits.log"]
B --> C["Find the access log"]
C --> D["Work out the cutoff time from the window"]
D --> E{"load.log and memory.log exist?"}
E -- "No" --> F["Run loadavg and memoryavg"]
E -- "Yes" --> G["Average the load and memory logs"]
F --> G
G --> H["Count requests newer than the cutoff"]
H --> I["Count unique IP addresses"]
I --> J["Estimate capacity and print"]
Steps in order
- Appends a timestamped line with the arguments to
/var/log/go/visits.log. - Finds the access log.
- Works out the cutoff time (now minus the window).
- If
/var/log/load.logor/var/log/memory.logis missing, creates it withloadavgormemoryavg. - Averages the first column of each log, rounded down to a whole number.
- Counts the access-log lines newer than the cutoff.
- Counts the unique IP addresses in those lines.
- Prints the requests, the capacity estimate, and the unique IP count.
How the estimate works
capacity = requests / busiest resource % x 100
The busiest resource is whichever is higher, the average memory percentage or the average load percentage.
| Example value | Number |
|---|---|
| Requests in the window | 12,840 |
| Average load | 14% |
| Average memory | 22% |
| Busiest resource | Memory (22%) |
| Estimate | 12,840 / 22 x 100 = 58,363 |
Limits of this method:
- The load and memory figures are averages over the whole load and memory logs (the weekly averages kept by
loadavgandmemoryavg), not measured for the window you picked. - It assumes all the load and memory use comes from visits. Work such as backups, mail, and cron jobs makes the estimate lower than the truth.
- It assumes load grows in step with traffic. Real servers hit limits earlier or later, such as database or disk limits.
- A short window, such as
hour, can give a misleading figure if that hour was unusually busy or quiet.
What is counted
| Item | Rule |
|---|---|
| Requests | One per access-log line with a time in field 6 newer than the cutoff. Every request counts, not only page views. |
| Unique IPs | Distinct values of field 4 when it is not -, otherwise field 3. |
The log must be pipe-separated, with the request time as a Unix timestamp in field 6. Other formats give zero or wrong results.
Notes
- Only the current access log file is read, not rotated copies.
- Many people behind one address count as one IP, and one person can appear under several.
- The command also looks up the server's public IP and reads the admin email, mobile, and WhatsApp settings, but does not use them. This only slows it down slightly.
- To compare several servers by visits and resource use, see
compare.
See also
| Command | Description |
|---|---|
loadavg |
Check the weekly server load average |
memoryavg |
Check the weekly server memory average |
usertop |
Check recent visitors per domain |
iptop |
Track the most visited IP addresses on a server |
httptop |
Display active HTTP requests in real time |
bots |
Track all bot visits to your server (good and bad bots) |
compare |
Compare multiple GoAdmio servers based on visits and resource usage |
logrotate |
Configure daily or default log rotation for Apache and Nginx |