SpecT Posted March 1, 2015 Share Posted March 1, 2015 Hello everyone! Probably you know that when your server is full of maps and resource a refresh may cause a huge lag (1-2 minutes lag). But this lag comes just the first time I refresh. When I refresh it later it doesn't lag. That gave me the idea about auto refresh, but the problem is that I think its impossible (cant use executeCommandHandler, there is no function for refresh). My question is: Is it possible? I hope that there is a way to make a timer and refresh the server per 10-15 minutes. Then when I upload new maps or resources it won't lag. Thanks! Link to comment
Gallardo9944 Posted March 1, 2015 Share Posted March 1, 2015 I do it like that: function doRefresh() outputDebugString("Starting automated server refresh",0,255,0,100) local tick = getTickCount() refreshResources(false) outputDebugString("Finished automated resources refresh for "..getTickCount()-tick.." ms",0,255,0,100) end setTimer(doRefresh,1000*75,0) I also have a crontab job executed every minute to recache all files in kernel IO cache: #!/bin/bash time find /path/to/mta/server/mods/deathmatch/ > /dev/null (Time is to measure the length of the cache process, just in case i need it) Discussed here: http://bugs.mtasa.com/view.php?id=8680 Link to comment
SpecT Posted March 1, 2015 Author Share Posted March 1, 2015 I do it like that: function doRefresh() outputDebugString("Starting automated server refresh",0,255,0,100) local tick = getTickCount() refreshResources(false) outputDebugString("Finished automated resources refresh for "..getTickCount()-tick.." ms",0,255,0,100) end setTimer(doRefresh,1000*75,0) I also have a crontab job executed every minute to recache all files in kernel IO cache: #!/bin/bash time find /path/to/mta/server/mods/deathmatch/ > /dev/null (Time is to measure the length of the cache process, just in case i need it) Discussed here: http://bugs.mtasa.com/view.php?id=8680 Thanks gallardo! Thats what I exactly searched for! 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