Linux Today: Linux News On Internet Time.
Search Linux Today
search.internet.com
Linux News Sections:  Blog -  Developer -  High Performance -  Infrastructure -  IT Management -  Security -  Storage -
Linux Today Navigation
LT Home
Preferences
Contribute
Link to Us
Search
Linux Jobs

Become a Marketplace Partner

internet.commerce
Be a Commerce Partner














The Linux Channel at internet.com
Linux Today
Enterprise Linux Today
Apache Today
JustLinux.com
Linux Planet
PHPBuilder
All Linux Devices
Technology Jobs

JustTechJobs.com

LinuxToday Newsletters
Subscribe News
Subscribe PR
Subscribe Security

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

 







Current Newswire:

Intel Linux Graphics Shine With Fedora 12

Editor's Note: Do It Yourself "Cloud"

Google Chrome OS: First looks, first impressions

Kernel Log: Coming in 2.6.32 (Part 3) - Storage

TV Mythos Renewed: MythTV 0.22 with Many Improvements

Enhancing openSUSE 11.2: Adding Repositories and Packages

A Northwest Nobel option? (Linus for the Nobel Peace prize)

SECURITY: Cloud Computing Security Benefits, Risks and Recommendations

Keeping score in test-driven development with Python, PyLint, unittest, doctest,

Win a CodeWeavers Linux Gaming Rig




Sr Systems Engineer - Solaris - AIX (TX)
Next Step Systems
US-TX-Houston

Justtechjobs.com Post A Job | Post A Resume
:Web Techniques: Programming With Perl - Web Access Logs with DBI
Web Techniques: Programming With Perl - Web Access Logs with DBI
Apr 16, 2000, 16 :26 UTC (0 Talkback[s]) (5008 reads)

(Other stories by Randal L. Schwartz)

"A few months back, I was flipping through the wonderful Writing Apache Modules with Perl and C, by Doug MacEachern and fellow Web Techniques columnist Lincoln Stein. While trying to think of more bells and whistles to throw at my mod_perl-enabled Web server for PerlTraining.Stonehenge.com, I stumbled upon the section that talks about using a database instead of a flat file for the access log. Now, I had just recently upgraded and cleaned up the MySQL database for my ISP, and thought it would be nice to have more advanced statistics and reporting. So I jumped in."

"This was quite a jump, because I hadn't ever used any of Apache's custom log features. I had a simple NCSA-compatible access log, and a few specialized logs in a few directories via server-side include (SSI) loggers. So I decided to go whole hog the other way. Not only did I decide to log the usual things (host, user agent, bytes sent, and so on), but I also wanted to log the CPU times for each transaction. Doing so would let me see which of my URLs were burning up more CPU so I could figure out ways to cache them better. This is especially important on a machine that is shared with other users."

"So now the log is being written immediately to a DBI-based MySQL database. The power here is that I can use Structured Query Language (SQL) statements to generate ad-hoc reports on an up-to-the-minute basis, as well as get the general reports canned up into a Perl data structure with relative ease. No more parsing flat files (not that this was much trouble with Perl anyway). The downside is that I'm now burning 1MB per day for storage inside the MySQL database, but my sys admin said to just let them burn, because disk space is cheap."

Complete Story

Related Stories:
dotcomma: Perl to PHP Migration (Mar 27, 2000)
AppWatch: Perl 5.6.0 and mod_perl 1.22 released (Mar 23, 2000)
Perl.org: Review: Elements of Programming with Perl (Jan 23, 2000)
IBM developerWorks: Running away with the plot -- The story of Perl (Jan 02, 2000)
dotcomma.org: Introduction to Perl and CGI: Getting Your First Program to Run (Jan 02, 2000)
Web Techniques: Programming with Perl: Have You Ever Meta-Index Like This? (Oct 24, 1999)
Byte.com: Practical Perl -- Perltropolis (Jul 20, 1999)



No talkbacks posted.
  Home | Search Talkbacks | Customize View    Top of Page  



Enter your comments below:

* Your Name:

* Your Email Address:

* Subject:

CC: [will also send this talkback to an E-Mail address]

* Comments:

Tags allowed:<I>,<B> and <U>. See our talkback-policy for more about talkback content.

Fields marked with * are required!






..............................




All times are recorded in UTC.
Linux is a trademark of Linus Torvalds.
Powered by Linux, Apache and PHP

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs