Mysql Site Log Theory?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Mysql Site Log Theory?

Post by Zoxive »

I just wanted to know if using Mysql to log every hit to the website with the following information.

User_Id, User IP, Time Stamp, Browser, Referrer URL, Request URI, Session ID.

Using that information i could easily tell which pages are getting the most hits, which users are returning to the website, and a lot more information.

But, taking in this information every time someone refreshes/goes to a page, do you think it would have a big performance impact? and or slow my page to a craw, if i suddenly get maybe 100 users at my site at once?

I kind of think so, and yet I've tested it some what, and barley notice a difference(I dont, but script times are a couple ms longer), but I have yet to test it with some traffic.


Things to do different maybe? Text File(flat file or maybe xml), or using a separate database.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

It's typically not too much of a performance hit, but why? Aren't standard server logs built just for this? You can import the server logs into a database to make aggregate operations easier, but for the most part the standard server logs work really well for this type of need.
Post Reply