Ancient Warfare 2

Ancient Warfare 2

6M Downloads

Automation Module causing massive TPS issues on server

ecm79 opened this issue ยท 7 comments

commented

Right, so I have a little private server for me and a few friends and on the server we've got ANCIENTWARFARE-2.4.106-BETA-MC1.7.10-FULL.jar

Okay, so everything is fine with the mod, everything functions as should until a farm is set up. The instant we set down a farm that functions (Of any size) the server has an average TPS of around 8-13.

If it's just a few fairly sized farms the TPS never goes above 10 and sits sometimes as low as 3. As you imagine this makes it a little unplayable. Everything becomes a steady 20 TPS as soon as we mine up the farms.

The farms are two Crop farms farming potatoes and wheat, a Reed farm for sugarcane, and a Tree farm for regular Oak trees.

This is the TPS with just 4 Farms without any NPC's actually using them.
https://gyazo.com/f8969ec98c7be6def44ae186d6e10c8d

The farms did have farmable and harvestable items in the active square, so I tried seeing what would happen if I got rid of the items, and the lag dissappeared. I planted seeds and saplings and everything and it started lagging again, not instantly mind you. Gradually became laggy.

Then I check the server using VisualVM and find these two eating up Memory and Processing power.

https://gyazo.com/ad915ef6066c1d50d7888ff7fd4e43e3 - Memory, and rising.
https://gyazo.com/4e86fef8659b0eacae9edaf421f65282 - CPU, and rising.

commented

Your VisualVM reports that the tree farm is a main issue.
You may want to update. A new version of the mod has just been released.
Also, farm work can be optimized by using the block "bounds" GUI.
A refresh will generally help cut-down on the excess "BlockPosition" instances.
Removing individual positions for saplings will also reduce overall time spent scanning the area (and make the farm more resource-efficient for gameplay).

commented

I figured it was just how much it was scanning and how quickly. But the farms aren't exactly massive or that fast. So what do you think is the reason that it's happening?

And could you elaborate on removing individual postions and a refresh?
I figured individual positions was just not allowing the farm to plant saplings in some spots, but I'd rather not assume.

commented

There are a lot of blocks in trees, and the farm need to break them one by one. That is the reason.

Now for the "bounds" GUI.
"Refresh" means changing one of the value, then changing it back. The process will trim down the unnecessary values that could have been left over from previous farming operations.
The GUI is actually a grid where red means active, and black is inactive. Each block can be selected within the maximum bounds, thus "individual positions" for the tree farm, that represent sapling places.

commented

Oh right, alright. Thanks alot man, so regular farms should not cause lag? Unless they're of insane size I suppose?

Sorry, I have never personally used the mod, I've just based with people that use it. So I'm not really aware of of the mechanics of it.

commented

Tree farm is the most demanding by far due to complexity.
I highly recommend not making "huge tree" farms, where sapling are placed in 2*2 squares.

Other farms shouldn't be a bother, even at max size.

commented

No, they are a huge bother. The CPU and Memory usage, as you saw, skyrockets. But I was just trying to get a bit of information on what might be going on. We use Oak Trees as I said and I don't think it's at max capacity. The size is probably somewhere around 10x5 max.

commented

not seeing performance issues like this in 1.12 and farms have been reworked there so closing until I hear otherwise in a new issue