I setup a minecraft server on my own Ubuntu Server 18.04 VM using the official minecraft 1.7.10 JAR file. Every 5-20 minutes, seemingly randomly, I (and any other player connected) will experience roughly 20 seconds of lag (blocks break without dropping anything, can't open chests, etc) and then get disconnected with the server-log saying "disconnect.timeout" and the client saying "existing connection forcibly closed by remote host".
I have tried several things:
Upping specs of VM, RAM, disk space, CPU cores
Checking syslog and minecraft log when timeout happens - there is nothing up until the players get disconnected but only the message disconnect.timeout and nothing in the syslog.
Cheking RAM and CPU usage when timeouts occur - RAM and CPU have no noticable difference at the time of lag/timeout.
I'm a really technical person I am rarely unable to fix issues like this myself, so am at an absolute witss end.
Any advice would be appreciated, thanks.
Edit: It's worth mentioning, the server is vanilla, and I am accessing it via LAN, but the server is a seperate physical machine running a VM. I've also tried many different worlds, same problem.