Hi all,
Like you probably have, I've noticed the server is lagging a bit. What you might not know is that I ping the server every minute to check it's okay, and if the TPS is less than 10, I get a notification on my phone. Every minute. I just checked, and in the last 7 days I've had 551 notifications. Here's what I've done to try and fix it.
Firstly, I checked to see what was causing the lag. Turns out, unsurprisingly, it's lagging because each tick is taking longer than 50ms to run. In the hour that I timed everything for, ticking entities in the main world and the End took up 98.19% of a tick's time, meaning everything else has to try and squeeze into the other 1.81%, which it can't do. This causes it to spill over into the next tick's timeslot, which dominoes on until it manages to catch up, usually because one or more of you will time out, so it can unload a bunch of chunks and free up time.
To try and solve that, I've changed how entities tick. For starters,
entities won't activate until you're closer, and they
won't track you as far now. If you want exact numbers, they're in the first reply to this thread. For what it's worth, VC has always had slightly different numbers to Vanilla, so much so that I'm not even sure what Vanilla uses any more. I've also
lowered the spawn cap ever so slightly, so less mobs should try and spawn at any one time. Finally,
items and XP should merge from slightly further away.
Most of you shouldn't notice any major difference with this in regards to gameplay, except hopefully less lag. If you have any farms or anything that's been broken by these changes, please let me know, and I'll try and work with you to tweak the settings a bit to fix it. I don't want your work to go to waste.
These changes will take effect at the next schedules restart (2020-03-28 05:00:00 GMT)
Let me know if you notice any improvement to the server's performance after tomorrow. My script will continue to monitor it, so I should get a nice chart on the
VcStatus page, but I'm interested in hearing what you guys think
- Luis
EDIT 2020-03-31: Minor changes to spawn caps following feedback, see below for specifics