porta has asked for the wisdom of the Perl Monks concerning the following question:

Monks.
My knowledge in software development couldn't answer the following question. Advice or comments are welcome. I'm writing a web application (yeah, in perl.) and I want to create a site log (in a mysql database) that keeps track of all the events that occurs on the site (not only errors, but users actions too).
My main concern now is performance. Loggin almost each single action could be pretty intensive for the database (I guess) and, also, I think it would slow up the application times (because each time the application logs something, the flow of the application needs to wait until the log is done to continue the normal flow).
Or, perhaps, there are no reasons to worry and all what I think is crap. Again, I'm a rookie and haven't faced this situation before.
I'll thank any advice or comment.
  • Comment on Performance question about loggin application events

Replies are listed 'Best First'.
Re: Performance question about loggin application events
by ozone (Friar) on Jun 21, 2007 at 14:33 UTC
    As long as the table has no indices you should be fine.

    I've tried this strategy and we were never able to effectively use the data because there were too many individual entries - queries took a very long time. In the end we wrote the data to a simple csv file and used a couple of Perl scripts to produce summaries and reports.
Re: Performance question about loggin application events
by guinex (Sexton) on Jun 21, 2007 at 18:57 UTC
    Hard to say based on the info you have provided.

    If it is an internal app that really doesn't get hammered very hard, you will probably be fine. OTOH, you do need to be wary of unnecessary db writes if you are planning on scaling big (reads are much easier to scale, since they are cacheable).

    I found this book by Cal Henderson (of flickr fame) very useful as an intro to these issues.

    -guinex

      Great book! I grabbed a copy and reading it. Its exactly the type of reading that I need now. Thanks for the wonderfull advise.