Posted 22 November 2012 - 06:14 AM
On my hosted server, I have a compound with 4 computer controlled piston drawbridges. These drawbridges have one control computer that reads incoming RedNet messages, and outputs to other adjacent computers. Through some testing, we found that several computers worked better to control the array of pisons, IE one computer controlling one piston in a 2x8 array. This was due to computers being waterproof, and redstone being difficult to use.
The other computers in that array are running code similar to this:
Also keep in mind that we have 4 of these drawbridges around this compound, meaning a large number of computers are running this code.
I have been noticing some increased lag around this particular compound on our cheap hosted server, while my locally hosted test server doesn't have that same problem. My fear is that either one or both things are happening:
1. The un-optimized code running on all these computers is putting a large burden on my cheap linux virtual server
2. The large number of running computers in one chunk or one area is putting a large burden on my server
I could change the code to use os.eventPull to optimize it somewhat, but that would mean reprogramming all of those computers. I would rather redesign the drawbridges if the problem is too many computers.
I would be willing to post screenshots of the drawbridge array, if it would help diagnose the problem.
I look forward to your input.
The other computers in that array are running code similar to this:
while true do --main loop
sleep(0)
if redstone.getInput("left") then
redstone.setOutput("top", true)
redstone.setOutput("right", true)
else
redstone.setOutput("top", false)
redstone.setOutput("right", false)
end
end
Also keep in mind that we have 4 of these drawbridges around this compound, meaning a large number of computers are running this code.
I have been noticing some increased lag around this particular compound on our cheap hosted server, while my locally hosted test server doesn't have that same problem. My fear is that either one or both things are happening:
1. The un-optimized code running on all these computers is putting a large burden on my cheap linux virtual server
2. The large number of running computers in one chunk or one area is putting a large burden on my server
I could change the code to use os.eventPull to optimize it somewhat, but that would mean reprogramming all of those computers. I would rather redesign the drawbridges if the problem is too many computers.
I would be willing to post screenshots of the drawbridge array, if it would help diagnose the problem.
I look forward to your input.