hexparrot / mineos-node

node.js implementation of mineos minecraft management
GNU General Public License v3.0
334 stars 170 forks source link

Web UI lag/delays registering servers are running #303

Closed cr08 closed 5 years ago

cr08 commented 5 years ago

I have had a recently fresh install if MineOS-node through what appears to be an official and up to date docker container: https://hub.docker.com/r/hexparrot/mineos . This is also installed on an Unraid box and completely running all data off the cache SSD. The container reports it is on the latest mineos-node git commit and NodeJS version 8.9.4.

So far I have only two servers installed. First is a Spigot server but is fairly minimal and vanilla compliant. Most of the time it sits idle with 0 or 1 players logged in. Second is a 100% vanilla server with no action yet, not even any world gen.

With that all said I have noticed that the web ui seems to be really delayed/laggy and it is often a chore to get it to register each login that the servers are up and running. Most of the time requiring hitting Refresh Server/Profile list a couple times. The system is not bottlenecked in any way that I can tell. Host cpu usage is usually in the 20-40% area and plenty of memory available. My 'client' machine running the browser also shouldn't be an issue. i7-4790, 16GB ram, latest Chrome stable release. Fresh install of Windows 10 as of 10/1.

Any ideas where I should look? I'm liking the cleanliness and ease of use so far coming from Cubecoders AMP/McMyAdmin but this inconsistency is a bit worrying.

hexparrot commented 5 years ago

For each of your servers, run the following commands (pref as nonroot, but either are ok). Replace asdf with each server name:

cd /usr/games/minecraft
time ./mineos_console.js -s asdf property ping

What's the response time? This is the actual method that is run when the webui needs to get the server information and the most likely place for the bottleneck.

The results should be instantaneous (<0.200s). You should see a proper value for players_online and players_max. Log into the server with a client to ensure that players_online increments >0, because seeing 0/max doesn't guarantee the number is reporting properly.

The webui might feel laggy and delayed if either of these queries take longer than this 200ms--in fact the amount it's delayed would be the amount of time it takes to run both of these commands in parallel.

cr08 commented 5 years ago

The times using that command are good. I'm seeing it hovering around 0.1s. The biggest issue I am running into is that the 'Currently Selected Server' dropdown almost always remains unpopulated when logging in initially to the panel and either the servers take forever to show up in the list or require repeated hits of the Refresh Server List option. And this is always at odds with the Dashboard counter on the left side too. Even sitting here now at this moment I'm seeing it continually show a count of 2 with the server dropdown empty. At best the Spigot server will show up the quickest, but still with a delay, and the vanilla will take forever.

hexparrot commented 5 years ago

Can you take a look at /var/log/mineos.log? Usually when dropdowns don't populate, it's because the function underlying it runs into some sort of error. That error is often logged and helps us get to the solution faster. You're welcome to email it to me if you feel more comfy--or through the discourse site.

cr08 commented 5 years ago

So I think I have sorted it out. Long story made short is it appears to be related to a long running Unraid bug that still may not be sorted. Basically it seems any significant IO on cache drives that isn't Docker related seems to spike IO wait times quite a bit, even on an SSD. May be my system configuration, not sure. But it was affecting other dockers as well in strange ways. I've since moved everything but Dockers and VM's off the cache which has helped tremendously and now the MineOS dashboard loads just fine and the Minecraft servers appear right away. So far it has been consistently reliable since making the above system changes. Apologies for the bit of wild goose chase on this one.