Heya,
I currently have a cluser with 2 web servers and a few database server behind them. Problem is, that occasionally there's a big time difference between the 2 web servers. My website being a online game, it's essential that each user receives the same timestamp from the various scripts; it's really going crazy when the user on 1 server is 300 seconds ahead of the user on the other server.
I've contacted my server admins about the issue, and they keep syncing the 2 servers; they however haven't found any permanent solution to the problem.
So, I was thinking, is it a) possible to set the server time with a PHP script, so I could resolve the issue myself? b) is it possible to retrieve all timestamps from some reliable external source?
Out of Sync servers
Moderator: General Moderators
Re: Out of Sync servers
This is a common problem in distributed systems. However, if the cluster is a local network it is very disturbing that the servers can fall 300 seconds behind each other.
How are the servers kept in sync? do they use replication, federated tables or other clustering solutions?
For an intermediate fix, you can assign a user session to one server IP, and have that server serve him all the information until the session expires. This way at least from the user perspective the data is consistent.
How are the servers kept in sync? do they use replication, federated tables or other clustering solutions?
For an intermediate fix, you can assign a user session to one server IP, and have that server serve him all the information until the session expires. This way at least from the user perspective the data is consistent.
Re: Out of Sync servers
I don't have any information about how they keep the servers in sync..
Currently, each user is assigned to a seperate server, but it's still a big issue, since there's a lot of time-related user interactions (battle-system etc.)
Could I somehow get all the timestamps from one server?
Currently, each user is assigned to a seperate server, but it's still a big issue, since there's a lot of time-related user interactions (battle-system etc.)
Could I somehow get all the timestamps from one server?
Re: Out of Sync servers
If you could, then you have to wonder - why do you need two servers anyway? isn't it to split the load between them?
Without knowing the setup between the servers it's hard to offer good solutions
Without knowing the setup between the servers it's hard to offer good solutions