Console Login
Home / Blog / Server Administration / Stop Guessing: Why Server-Side Analytics (AWStats) Beats JavaScript Tracking
Server Administration 0 views

Stop Guessing: Why Server-Side Analytics (AWStats) Beats JavaScript Tracking

@

The Map Is Not The Territory: Why You Need AWStats

It is 2009, and everyone is obsessed with Google Analytics. It’s pretty, it’s free, and it generates colorful charts for the marketing team. But as any battle-scarred System Administrator knows, what the marketing dashboard shows and what is actually hitting your network interface are two very different realities.

I recently audited a high-traffic media portal hosted here in Oslo. Their analytics claimed 50,000 unique visitors. Their server load suggested double that. The culprit? The truth was in the logs. JavaScript-based trackers fail when users disable scripts, when mobile browsers (like on the new Nokia N97) choke on heavy JS, or when search spiders crawl your site.

To see the matrix, you need server-side analysis. You need AWStats.

The Architecture of Truth

AWStats (Advanced Web Statistics) parses your Apache or Nginx log files directly. It doesn't rely on the client browser triggering a script. If a request touches your server, AWStats captures it. This is critical for capacity planning—you cannot scale your RAM allocation based on "visits" that ignore 30% of your actual HTTP requests.

Step 1: Installation (CentOS 5 / RHEL)

Don't compile from source unless you enjoy pain. Use the EPEL repository.

# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm # yum install awstats

Step 2: Configuration for High Accuracy

The default config is decent, but we need to tune it for the modern web. Edit /etc/awstats/awstats.yourdomain.conf. Make sure your LogFormat matches your Apache configuration.

If you are using the standard Apache 2.2 "Combined" format, ensure this line is set:

LogFormat=1
Pro Tip: DNS Lookups Kill Performance
By default, AWStats might try to reverse resolve IP addresses to hostnames. On a high-traffic server, this causes massive latency. Set DNSLookup=0 in your config. Do the resolution offline or not at all. Your CPU will thank you.

The Hardware Bottleneck: I/O Wait

Here is the ugly truth about log analysis: It is a disk I/O killer.

Parsing a 2GB access log file requires reading huge blocks of data and writing statistical databases simultaneously. On a budget VPS oversold with hundreds of tenants on a single SATA drive, running AWStats can spike your Load Average to 5.0+, causing your web server to stutter.

This is where architecture matters. At CoolVDS, we don't gamble with shared I/O. Our nodes are built on Enterprise 15k RPM SAS drives in RAID-10. We use Xen virtualization, which isolates your disk throughput better than the "container" based hosting (like OpenVZ) many competitors use.

Feature Budget VPS (OpenVZ) CoolVDS (Xen/RAID-10)
Disk I/O Shared, easily choked by neighbors Protected, high throughput SAS
Memory Burstable (Unstable) Dedicated RAM
Log Parsing Speed Minutes to Hours Seconds

Data Sovereignty: The Norwegian Advantage

Privacy is becoming a headline issue. With the EU Data Protection Directive and Norway's strict Personopplysningsloven (Personal Data Act), sending user data to third-party US servers (like Google) is becoming legally complex.

When you use AWStats, the data never leaves your server. It sits safely in your /var/lib/awstats directory, right here in our Oslo datacenter. You own the data. Datatilsynet is happy. Your users are protected.

Automation

Finally, don't run this manually. Add a cron job to update your stats every hour.

# crontab -e 0 * * * * /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=yourdomain -update > /dev/null

If your current host chokes when you run a simple Perl script against your logs, it's time to upgrade. Real monitoring requires real hardware.

Need a server that can crunch numbers without slowing down your site? Deploy a Xen-based instance on CoolVDS today.

/// TAGS

/// RELATED POSTS

Surviving the Spike: High-Performance E-commerce Hosting Architecture for 2012

Is your Magento store ready for the holiday rush? We break down the Nginx, Varnish, and SSD tuning s...

Read More →

Automate or Die: Bulletproof Remote Backups with Rsync on CentOS 6

RAID is not a backup. Don't let a typo destroy your database. Learn how to set up automated, increme...

Read More →

Xen vs. KVM: Why Kernel Integration Wars Define Your VPS Performance

Red Hat Enterprise Linux 6 has shifted the battlefield from Xen to KVM. We analyze the kernel-level ...

Read More →

Escaping the Shared Hosting Trap: A SysAdmin’s Guide to VDS Migration

Is your application choking on 'unlimited' shared hosting? We break down the technical migration to ...

Read More →

IPTables Survival Guide: Locking Down Your Linux VPS in a Hostile Network

Stop script kiddies and botnets cold. We dive deep into stateful packet inspection, fail2ban configu...

Read More →

Sleep Soundly: The Paranoid SysAdmin's Guide to Bulletproof Server Backups

RAID is not a backup. If you accidentally drop a database table at 3 AM, mirroring just replicates t...

Read More →
← Back to All Posts