Thanks for replying, here's the reason we are trying to do it,
hopefully that would give some more context.

We are running a game site where users compete to answer questions
within the allotted time, certain conditions can cause this timer to
change.

Our original setup was kinda dumb, we had each browser keep polling
this "status.php" every second and a huge chunk of status.php is
already cached in MC, but apache was dying because we keep on hitting
maxConnection on apache.  So our new idea is to have a daemon that
writes the current state of the world (which was status.php) and just
write that to MC so that nginx can serve status directly from MC.

So our daemon does this:

$expireTime = time() + ($config['App']['cronTime'] * 60);

while (time() < $expireTime) {

  $live_games = cacheRead('cache_live_games');

  // Loop through all games that needs to be written to MC
  foreach($live_auctions as $value){

    //do some work

    //One of the values that go in there:
    $results['Game']['end_time_s']   = getStringTime($result['Game']
['end_time']);

    $memcache->set("/game_".$value.".json", $json->convert($results));
  }
  usleep(250000);
}

Then the browser would just have a script that reads http://www/game_1111.json
every second and updates the page.

So we have checked latency through firebug and we see that the calls
were all ~200ms, the writes of the entire loop takes only ~100ms or
so.  So We really don't know why the browser timer keeps skipping
(meaning that it read two values from MC having the same Time
stamp)...

Thanks again for helping!


-- 
To unsubscribe, reply using "remove me" as the subject.

Reply via email to