Jump to content

[Is it possible] Auto refresh


SpecT

Recommended Posts

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

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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...