tags:

views:

53

answers:

3
+2  Q: 

fast site logging

i'm need to log some visits on my site to mysql and then parse them, such visits rate is about 50 per second. inserting each request is veryslow and bad, what can you advise me?

+2  A: 

Have you tried queueing them on the server and then inserting multiple requests at a time?

danben
where shoul i queueing them?
Ilya
A: 

Have you considered having a table for the visits per day/hour/minute with your unit of time as a key and then just running inserts into that table with an on duplicate key clause.

feihtthief
A: 

G'day,

Unless you really need statistics in real time, I'd seriously suggest logging the requests to disk and then trawling them later. Using Apache's rotatelogs utility let's you obtain logs for analysis on a daily basis at midnight or on an hourly basis at the top of the hour if you really need a quicker turnaround.

cheers,

Rob Wells