verarr / synchrono

A mod for Minecraft that syncs the in-game daylight cycle to a location in real life.
https://modrinth.com/mod/synchrono
GNU Lesser General Public License v3.0
1 stars 0 forks source link

Performance issue with custom time cycle #52

Closed suerion closed 1 month ago

suerion commented 1 month ago

Hey, after loading my server, it says, that

[23:03:17] [Server thread/WARN] (MinecraftServer) Can't keep up! Is the server overloaded? Running 13686ms or 273 ticks behind

mclo.gs said also, there are problems with the mods?

https://mclo.gs/yZhOtu0

https://modrinth.com/mod/synchrono https://modrinth.com/mod/customtimecycle

The mods 'Synchrono' and 'Custom Time Cycle' are incompatible.
[ Line #13](https://mclo.gs/yZhOtu0#L13)
Solutions
Remove the mod 'Synchrono'.
Remove the mod 'Custom Time Cycle'.

https://github.com/eclipseisoffline/customtimecycle/issues/5

verarr commented 1 month ago

Hi, thanks for making an issue :3

The specific version of Custom Time Cycle you installed, 0.1.3, does indeed cause a conflict with Synchrono. I marked that version as conflicting because it shipped with a bug that broke this mod. See https://github.com/eclipseisoffline/customtimecycle/pull/4. It looks like mclo.gs doesn't communicate this as well as I would've liked. You can see the full warning message on lines 18-19 in your log file.

The quick solution to this is to install the previous version of Custom Time Cycle, 0.1.2, which did not have this bug yet. However, when the next version is released, I advise you to upgrade because (if my understanding is correct) the buggy version also came with useful improvements to the precision of some calculations.

As for performance, you have a very huge modpack of over 500 mods. Please verify that this problem is only present when using Synchrono (or Custom Time Cycle for that matter). If that is indeed the case, this may be a valid issue.

In my experience, it's usual for a server to lag for a while right after it was started (about 14 seconds in your case, which I think is still reasonable).

I'd also like to ask you to confirm that this was not a crash.

Lastly, please do note that Synchrono is a mere consumer of the features Custom Time Cycle provides, and the two projects are not associated with eachother.

suerion commented 1 month ago

hey @verarr if i could, i would add 0.1.2 but this is not for 1.21.1, only 0.1.3 are for this version,

The lag on start is since it i had added custom time cycle an synchronos, but i would look again on it.

that is not a crash, only an lag on start the server.

suerion commented 1 month ago

You could look on this, after synching the time, the server is overloaded for a few seconds

Server Start was on 16:17 image

image

verarr commented 1 month ago

Synchrono is only supposed to set time about twice a day, so I may have gotten something wrong. I will look into how to schedule updates differently, because my current method is kinda hacky. #53

Although only once a day, a lag spike may come from an HTTP request to api.sunrisesunset.io, which may stretch to several seconds in case the network connection is slow. I will look into making them run in the background instead of blocking the server thread. #54

if i could, i would add 0.1.2 but this is not for 1.21.1, only 0.1.3 are for this version,

If you would like to use Synchrono on 1.21.1 now, you can make the fabric loader ignore this with a dependency override. See the Fabric Wiki on dependency overrides. With some quick testing, version 0.1.2-1.21 of Custom Time Cycle still seems to work on 1.21.1.

Alternatively, please wait for the next release of Custom Time Cycle, which should be releasing pretty soon (as Eclipse has said on the issue you opened in their repo).

verarr commented 1 month ago

I've made some changes to how it's decided if Synchrono should update the time, as well as to how it caches the results of API requests. (one of them was being re-requested way too much due to a mistake I had made because I didn't know Java that well)

If you have time, please check if the issue still persists with these changes too. You can get a working jar on the page of the latest CI run (look in the Artifacts section).

suerion commented 1 month ago

Hey, will test today, after work. Will come back to you. Thanks a lot

suerion commented 1 month ago

i had tested yet the new build, will look on it, if it trigger again the serverlag. will let it run a little bit,

suerion commented 1 month ago

image looks fine now, without lag on triggering

eclipseisoffline commented 1 month ago

Alternatively, please wait for the next release of Custom Time Cycle, which should be releasing pretty soon (as Eclipse has said on the issue you opened in their repo).

Should be up now! Apologies for the wait with the release - I've been busy with other projects and wanted to bundle it with 1.21.2. Thanks again!

verarr commented 1 month ago

@suerion new release of Synchrono is up now, and should work with the new Custom Time Cycle version too, and all Minecraft versions 1.21 through 1.21.2

:3