Subject | Hits and stats counters .... |
---|---|
Author | Lester Caine |
Post date | 2010-04-19T06:24:44Z |
I've had a problem with bitweaver since day one, but since it only happened very
occasionally I'd chosen to ignore it. With the traffic through my sites
increasing it has become a more serious problem, and I need to look at doing
something about it.
Query is simple enough
UPDATE LC_HITS SET hits = hits + 1, last_hit = NOW WHERE content_id = xxx
Some of you will spot he problem straight away ... if several people hit the
same page ( such as 'home' ) several 'threads' are all trying to update the one
record and we get a deadlock - and someone sees a blank page :(
It's reached the stage on one site where I've disabled the hits counter for the
time being!
Anybody have any idea how this can be 'repackaged' to remove the deadlock
problem? I *AM* wondering if it is actually something wrong with the
php_interbase driver not handling the 'wait' side of transactions properly?
Since the majority of users are simply reading pages, which happens quickly, and
the hits count is the only write operation.
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
occasionally I'd chosen to ignore it. With the traffic through my sites
increasing it has become a more serious problem, and I need to look at doing
something about it.
Query is simple enough
UPDATE LC_HITS SET hits = hits + 1, last_hit = NOW WHERE content_id = xxx
Some of you will spot he problem straight away ... if several people hit the
same page ( such as 'home' ) several 'threads' are all trying to update the one
record and we get a deadlock - and someone sees a blank page :(
It's reached the stage on one site where I've disabled the hits counter for the
time being!
Anybody have any idea how this can be 'repackaged' to remove the deadlock
problem? I *AM* wondering if it is actually something wrong with the
php_interbase driver not handling the 'wait' side of transactions properly?
Since the majority of users are simply reading pages, which happens quickly, and
the hits count is the only write operation.
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php