DynmapCore icon indicating copy to clipboard operation
DynmapCore copied to clipboard

JsonFileClientUpdateComponent causing excessive hangups on Spigot 1.11.2 server

Open DillonN opened this issue 8 years ago • 3 comments

Not sure if this is specific to 1.11.2 or 1.11, but I recently noticed the server lagging for about 200ms every second. Upon analysis with the timings command, this method is using a huge amount of CPU.

Running on an i5-2500k with 3GB of RAM to the server, Ubuntu 16.10. Not usually more than 2 people online ever. Spigot version git-Spigot-7d78b81-d5e7885. Using an external webserver (Apache)

This is out of 679s:

2017-01-07

DillonN avatar Jan 07 '17 12:01 DillonN

I may be wrong, but I believe the issue is with the disk IO. JsonFileClientUpdateComponent makes Dynmap write a JSON file to disk (not RAM) every time it update (2 seconds by default), and writing to disk can take some time. I'm not sure if it caches the file on disk or actually writes to the disk, but I know it writes to the disk at a regular interval.

I made a small hack that makes dynmap write to tmpfs (RAM) for now, but that's some advanced stuff. Dynmap hasn't lagged my server so far.

chuushi avatar Mar 02 '17 16:03 chuushi

Thanks, I was able to fix the problem a while back. I don't remember exactly, but I think disabling chat was what did it.

I wonder if it would be possible/better to write this stuff to the MySQL server instead?

DillonN avatar Mar 08 '17 23:03 DillonN

tmpfs is backed by the swap in case of something happening to the computer, while ramfs ain't. Besides, the swap tends to kill the performance of the whole computer, at least in computers I've had, although rarely on a desktop.

rautamiekka avatar Mar 09 '17 15:03 rautamiekka