Village hitting server performance hard.

Locked
ProsperCraft
Posts: 94
Joined: Sat Aug 03, 2013 5:22 pm
Contact:

Village hitting server performance hard.

Post by ProsperCraft » Mon Feb 26, 2018 3:27 am

We are just getting started with a handful of small villages, and we are having extremely low tick rate.

https://timings.aikar.co/?id=00885bff7a ... a92e230cc1
7bca3bf29937b8288c81c5ee1423eb86.png
7bca3bf29937b8288c81c5ee1423eb86.png (124.38 KiB) Viewed 1295 times
tps.png
tps.png (57.99 KiB) Viewed 1295 times
Attachments
warmroast.zip
(93.77 KiB) Downloaded 61 times
Last edited by ProsperCraft on Mon Feb 26, 2018 11:46 pm, edited 1 time in total.

ProsperCraft
Posts: 94
Joined: Sat Aug 03, 2013 5:22 pm
Contact:

Re: Villager hitting server performance hard.

Post by ProsperCraft » Mon Feb 26, 2018 9:03 pm

TPS cuts in half when a village is loaded.
2018-02-26_14.02.34.png
2018-02-26_14.02.34.png (531.37 KiB) Viewed 1289 times

ProsperCraft
Posts: 94
Joined: Sat Aug 03, 2013 5:22 pm
Contact:

Re: Village hitting server performance hard.

Post by ProsperCraft » Tue Feb 27, 2018 7:39 am

This performance hit is huge
https://timings.aikar.co/?id=ece1bd18e5 ... 6426bddecd
Average tps for 1 hour of runtime - 5.83

User avatar
Kinniken
Site Admin
Posts: 332
Joined: Thu Jul 21, 2011 4:51 pm

Re: Village hitting server performance hard.

Post by Kinniken » Tue Feb 27, 2018 8:32 am

Millénaire has always used a lot of CPU but this seems insane.

I suspect that it's not so much the CPU per villager as the fact that Forge keeps Millénaire villages active when they shouldn't be.

Do your debugging tools allow you to check how many villager entities are active at any point? And what chunks are loaded?

User avatar
Kinniken
Site Admin
Posts: 332
Joined: Thu Jul 21, 2011 4:51 pm

Re: Village hitting server performance hard.

Post by Kinniken » Tue Feb 27, 2018 10:29 pm

Should be fixed in beta 5. I'd love a confirmation.

ProsperCraft
Posts: 94
Joined: Sat Aug 03, 2013 5:22 pm
Contact:

Re: Village hitting server performance hard.

Post by ProsperCraft » Fri Mar 02, 2018 6:10 am

Performance has improved, but it is still quite bogging down my server quite a bit with only one large village.

https://i.gyazo.com/d407928e02a5ec7e7a6 ... 79667f.png

https://timings.aikar.co/?id=19d8138462 ... a0cb71c3b2

This is no slow machine either- here are the specs-

AMD RYZEN Threadripper 1950X 16-Core / 32 Threads 3.4 GHz Socket sTR4 YD195XA8AEWOF
G.SKILL TridentZ RGB Series 32GB (4 x 16GB) 288-Pin DDR4 SDRAM DDR4 3466 (PC4 27700) Desktop Memory Model F4-3466C16D-32GTZR
MSI X399 GAMING PRO CARBON AC sTR4 AMD X399 SATA 6Gb/s USB 3.1 ATX AMD Motherboard
SAMSUNG 960 PRO M.2 512GB NVMe PCI-Express 3.0 x4 Internal Solid State Drive (SSD) MZ-V6P512BW
Seasonic Flagship PRIME TITANIUM 750 SSR-750TD Active PFC 80 PLUS Titanium 750W ATX 12V 135mm Fluid Dynamic Bearing Fan Super Quiet Power Supply
Corsair Hydro Series H80i V2 Water / Liquid CPU Cooler. 120mm CW-9060024-WW
ARCTIC MX-4 Thermal Paste, Carbon Based High Performance Thermal Compound for All Coolers, Thermal Interface Material, 4 Grams

ProsperCraft
Posts: 94
Joined: Sat Aug 03, 2013 5:22 pm
Contact:

Re: Village hitting server performance hard.

Post by ProsperCraft » Fri Mar 02, 2018 6:30 am

This screenshot totally sums it up - Nightitme 20 TPS , daytime 13.7
2018-03-01_23.28.28.png
Night vs day
2018-03-01_23.28.28.png (526.92 KiB) Viewed 1271 times

ProsperCraft
Posts: 94
Joined: Sat Aug 03, 2013 5:22 pm
Contact:

Re: Village hitting server performance hard.

Post by ProsperCraft » Fri Mar 02, 2018 6:44 am

Tickprofiler says its the males-

https://gist.github.com/ProsperCraft/be ... e178ced046

TPS: 8.6658
Single Entity | Time/Tick | %
MillVillager$EntityGenericMale -8922,67,1599:0 | 7.299 | 9.483
MillVillager$EntityGenericMale -8924,68,1592:0 | 3.254 | 4.228
MillVillager$EntityGenericMale -8883,68,1535:0 | 2.857 | 3.713
MillVillager$EntityGenericMale -8896,68,1591:0 | 2.628 | 3.415
MillVillager$EntityGenericMale -8922,67,1596:0 | 2.467 | 3.205
Chunk | Time/Tick | %
0: -558, 99 | 14.646 | 19.102
0: -557, 99 | 6.752 | 8.806
0: -556, 95 | 3.828 | 4.993
0: 58, 117 | 3.178 | 4.145
0: -556, 99 | 2.500 | 3.261
All Entities of Type | Time/Tick | %
MillVillager$EntityGenericMale | 31.178 | 40.664
MillVillager$EntityGenericAsymmFemale | 6.012 | 7.842
entity.EntityNewCow | 4.111 | 5.362
entity.EntityNewSheep | 4.043 | 5.273
TileEntityConnectorMV | 3.477 | 4.534
Average Entity of Type | Time/tick | Calls
MillVillager$EntityGenericMale | 0.602 | 13520
entity.EntityMiner | 0.381 | 522
MillVillager$EntityGenericAsymmFemale | 0.232 | 6760

User avatar
Kinniken
Site Admin
Posts: 332
Joined: Thu Jul 21, 2011 4:51 pm

Re: Village hitting server performance hard.

Post by Kinniken » Fri Mar 02, 2018 7:42 am

Thanks for the data. The really interesting one is this one:https://i.gyazo.com/d407928e02a5ec7e7a6 ... 79667f.png

Clearly shows a massive problem with creating item stacks. It used to be a basically free operation, now it runs a forge hook that takes ages - 7% wasted right there (in fact, likely more, since those 7% seem to be only those coming from the calls above). That should be a quick but impactful fix.

More generally checking whether goals are still valid sucks up more CPU than I thought. I could shift to running that code every ten ticks or something, would make villagers a fraction less reactive but might help CPU load a lot.

You got that info with that aikar tool? I'll check it out.

ProsperCraft
Posts: 94
Joined: Sat Aug 03, 2013 5:22 pm
Contact:

Re: Village hitting server performance hard.

Post by ProsperCraft » Fri Mar 02, 2018 6:29 pm

This info was from Warmroast, I will set it up for you to play with.

Locked