dewu Posted September 28, 2014 Share Posted September 28, 2014 Hi guys. I have a server with DayZ Mod and sometimes when items are respawning server is shutdown, because of high processor usage. Is any way to optimise script with respawning function? Link to comment
Mr_Moose Posted September 29, 2014 Share Posted September 29, 2014 Your server won't shutdown just because it uses too much CPU, the only thing you may notice are lag, the real issue might be lack of RAM or a generally unstable hardware, what are your servers specifications, and which operating system are you running on it? Link to comment
manve1 Posted September 29, 2014 Share Posted September 29, 2014 Hi guys.I have a server with DayZ Mod and sometimes when items are respawning server is shutdown, because of high processor usage. Is any way to optimise script with respawning function? There are a lot of ways to optimize a script, for example you could load areas one by one, by that i mean lv is loaded at first, then ls and so on .. Link to comment
dewu Posted September 29, 2014 Author Share Posted September 29, 2014 Your server won't shutdown just because it uses too much CPU, the only thing you may notice are lag, the real issue might be lack of RAM or a generally unstable hardware MrBrutus, I used one of the best external Polish hostings. When items are respawn CPU usage in web server monitor is like 170% ;o manve1, Okay, but how I can do that in script? I found this script there, it will works? How to implement it? function infiniteLoopFunction() local lastresume = getTickCount() while true do --do something if getTickCount() > lastresume+200 then coroutine.yield() lastresume = getTickCount() end end end function resumeLoopThread() coroutine.resume(loopThread) end loopThread = coroutine.create(infiniteLoopFunction) resumeLoopThread() setTimer(resumeLoopThread, 400, 0) Link to comment
manve1 Posted September 29, 2014 Share Posted September 29, 2014 That code is kind of useless, unless you use it for collecting data. But what you would have to do is either re-script the spawning system and do few tables instead of one, then spawn each area every second or so. or you have to collect data on which pickup it is spawning then you would allow it to refresh the loot or not + store the areas that are not been refreshed (this is a lot more complicated but is more elegant and faster) Link to comment
dewu Posted October 2, 2014 Author Share Posted October 2, 2014 Any other suggestions? Link to comment
Moderators IIYAMA Posted October 3, 2014 Moderators Share Posted October 3, 2014 Rewrite the code.... And reduce the ammount of database calls. Or buy a better server which can handle terible laggy gamemodes as that. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now