
When a user navigates to a website, the browser sends an HTTP GET request to the server for the main page. The web server immediately captures this event. At the transport layer, the server records the source IP address, the TCP port, and the protocol version (HTTP/1.1, HTTP/2, or HTTP/3). These raw data points form the foundation of traffic metrics.
Behind the scenes, the server parses the request headers. It extracts the User-Agent string, which reveals the browser type and operating system. The Accept-Language header indicates the user’s locale. The Referer header, if present, shows the previous page the user visited. All these fields are written to the access log file, typically in a structured format like Combined Log Format (CLF) or JSON.
Several quantitative metrics are derived at this stage. The server measures the request processing time in milliseconds. It also records the response size in bytes. For the main page, this includes the HTML document itself, plus any inline CSS or JavaScript. The server also notes the HTTP status code-usually 200 for a successful load, or 304 if the page is served from the browser cache.
In a standard browsing session, the server does not automatically know the user’s identity. However, it tracks the session via cookies. Many web servers use a session ID cookie set on the first request to the main page. This ID links all subsequent requests from the same browser into a single session record. The server logs the session start time, the number of page views, and the duration of the session.
Traffic metrics go beyond simple counts. The server calculates the bounce rate-users who leave after viewing only the main page. It also monitors the average time spent on the page. These metrics require correlating the main page access log entry with subsequent requests (or the lack thereof). For example, if no further requests arrive within 30 minutes, the session is considered ended.
The server distinguishes between unique visitors and page views by combining the IP address and the User-Agent string. If the same combination accesses the main page multiple times within a short window, the server counts it as one visitor but multiple page views. This distinction helps differentiate a new user from a returning one, even without authentication.
Modern web servers like Nginx or Apache generate performance metrics alongside access logs. When a user loads the main page, the server records the time to first byte (TTFB). This measures the delay between the request and the start of the response. The server also tracks the number of concurrent connections at the moment of the request. High concurrency on the main page often indicates traffic spikes.
Traffic patterns emerge from aggregated data. The server logs the timestamp of each main page access, allowing analysis of peak hours, daily trends, and geographic distribution via IP geolocation. For instance, a sudden surge in requests from a specific country might trigger a load-balancing event. These metrics are stored in separate monitoring databases, not just plain logs.
It records your IP address, browser type, requested URL, HTTP status code, timestamp, and the size of the response. This data is written to an access log file.
Not unless you are logged in. The server uses a session ID cookie to track your actions across the site, but it does not link this to your real identity without authentication.
A unique visitor is counted once per session based on IP and browser fingerprint. A page view is counted every time the main page is loaded, even by the same visitor multiple times.
Yes. Each reload generates a new HTTP request. The server logs it as a separate page view, though the session ID remains the same.
Sarah M.
Clear and technical. I finally understand how my site’s logs work after reading this. The breakdown of session context was particularly useful.
James K.
Good article, but I wish it covered HTTPS metrics. Still, the explanation of TTFB and concurrent connections helped me optimize my server config.
Emily R.
As a junior sysadmin, this gave me practical insight into what happens behind the scenes. The FAQ answered my lingering questions about unique visitors.