Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hit Counters Over Multiple Servers

Status
Not open for further replies.

Sheltered

Programmer
Nov 26, 2002
55
GB
Hi, this might not be the best forum to ask but i'll give it a go. [bigears]
Is it possible to implement a hit counter to a web page when the page is hosted on multiple servers?
The page is part of an intranet and is replicated across several servers for resiliance, and im concerned that if users hit the homepage on different servers the hit counter wont increment on the other servers. Does that make sense?

i.e. user1 hits the homepage on server1, i think the that the counter will only increment on server1 and not the others. Would this be the case, and if so is there a way round it?

Cheers
Pete
 
How did you design the counter? You should increase it in a database in a seperate system. Then you have an indpendant count that every server will increment. iSeriesCodePoet
IBM iSeries (AS/400) Programmer
[pc2]
 
Thanks, i hadn't thought of doing it that way.
I've not actually designed the counter yet cause i wasn't sure it would work.
Any tips on the best way to do it? Or pointers to tutorials? I'm not too great with databases.

Pete
 
I honestly don't know the best way... If DB space is free... use a table and add one record to the table for every hit. If you need to display it. Do a 'select count(myfield) from mytable'. iSeriesCodePoet
IBM iSeries (AS/400) Programmer
[pc2]
 
Cheers mate, i've managed to get a counter working using the database. I just scoured a few tutorials :O)
If anyone is interested in the code i'll post it up.

Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top