time sync issues between web and DB server
I have two dedicated servers setup, one running the web server software and a crossover link to the other running mysql. My web applications display relative timestamps (i.e. last post: 4 secs ago) and I've hit problems with the time going out of sync a few seconds. Even with NTP syncing them to eachother twice a day the db machine still ends up a couple seconds ahead ofter, resulting in negative timestamps coming up. Originally i was just adding in a UNIX_TIMESTAMP() to the column lists of my select queries that retrieved timestamp and using that timestamp to base the relative calculations, but now that I am moving into using shared memory caching of DB objects that is no longer an option.This must be a common problem, what is usually done about it? Should i just use the web servers time and trim off negative values and ignore the ~1-3 second inaccuracies? Run a "SELECT UNIX_TIMESTAMP()" query with each request its needed? The best solution I can think of ATM is to have a shared memory value holding the offset between the two machines time that is updated every hour or so. Thanks for any suggestions