SaveClients
Posted: Thu May 17, 2018 8:42 pm
I was noticing intermittent lag on my server, every once in a while, and it worsens with more people on.
Turns out, the SaveClients call was causing a few seconds of lag (or worse, depending on the number of clients connected).
Initially, I tried having threads created to handle the save process, but this didn't really seem to improve much (confusingly). I would have liked to detach the threads, which would have eliminated the lag in all likelihood, but that seemed to run me into memory access errors.
I ended up moving the call from the zone server loop and into the world loop, much like how vitality is updated. This eliminates the zone lag, and I haven't seen anything negative happen as a result yet.
Just as an fyi,
Turns out, the SaveClients call was causing a few seconds of lag (or worse, depending on the number of clients connected).
Initially, I tried having threads created to handle the save process, but this didn't really seem to improve much (confusingly). I would have liked to detach the threads, which would have eliminated the lag in all likelihood, but that seemed to run me into memory access errors.
I ended up moving the call from the zone server loop and into the world loop, much like how vitality is updated. This eliminates the zone lag, and I haven't seen anything negative happen as a result yet.
Just as an fyi,