ARK: Survival Evolved

ARK: Survival Evolved

Not enough ratings
Powerscript Server process monitor script for zero usage hangs
By бэд бой
Powerscript Server process monitor script for zero usage hangs. This is useful if your server hangs from time to time.

It could easily be re-rigged to restart maxxing out servers we suppose too.

This guide also has the information to optionally enable you to place the "Saved" server files on Linux server and then use them via Samba with the Windows box.
   
Award
Favorite
Favorited
Unfavorite
The powerscript
Powerscript Server process monitor script for zero usage hangs:

N.B: To run a ps1 file your taget machine may need to have its execution policy set,
for example: Set-ExecutionPolicy RemoteSigned
more info here
https://technet.microsoft.com/en-us/library/ee176961.aspx

In our use-case of the server in the rare cases the server process became unresponsive it did so with a "Zero usage" profile in terms of processor usage.

So, we made a little Powershell process monitor for the server.

First it launches the server if it is not running then it pauses a fixed time - 500 seconds by default. It then checks processor usage every 3 seconds (by default), after 60 "processor time = 0 " counts it will kill off and reload the server. (3 mins of zero usage) and start the monitoring loop again.

https://gist.github.com/twobob/7e3d0f564f1aa1a53d5d

Here is the simple ArkRun.bat startup we use
https://gist.github.com/twobob/8b6b7d346fc6242f52f3

We thought it might come in handy to restart servers without external management.
Hope it helps.

When running it should look like:


PS C:\Windows\system32> C:\SHARE\StartLockedServer.ps1
Beginning Testing Operations
USING: 60 max failures at 3 per test
Waiting 500 seconds for startup
Resuming Testing Operations

(and you are off)
Optional: Placing out game data centrally to a linux server serving via Samba
A further step we took was moving out game data to a central linux served via Samba location.

In our use case the actual server process may need to run on a range on windows machines

We used a Linux always-on NAS and enabled a Samba share on it as a NAS provided the connectivity profile we needed for the access and is designed to shift files.

This move away from storage on the client was helpful for us since it effectively provided the ability to choose and shift which box was acting as the server process - easily - without having multiple copies on the folder structures.

To do this on each local server we:

Renaming our original "Saved" folder (P:\Program Files (x86)\Steam\steamapps\common\ARK\ShooterGame in our case, you probably use C:) to "Saved Original", we then:

mklink /d "C:\Program Files (x86)\Steam\steamapps\common\ARK\ShooterGame\Saved" "/192.168.1.xx/Public/Saved" where 192.168.1.xx is replaced with the /actual/ IP of your NAS.

We repeated these "backup the original" / "do the mklink" steps on all 3 windows machines that could potentially run the server.

This appears as a folder shortcut that is enough to work with the expectations of the game.

NB: the mklink /J junction switch won't work over FQDN Network Named stuff so don't bother trying :)

This allows all the 3 boxes to use the central data from the linux server (obviously - one at a time)

Thanks for listening.
Hope it helps someone else.
Hardware Used
Looking at a complete project using actual parts with the view of getting 3 entry level playable machines, a file NAS and a seperate server.

Windows Server: (also can be client machine for extra £70ish)

OS + Windows 10 64-bit Edition Home
Processor Brand AMD
Processor Type 68000
Processor Speed 3 GHz
Processor Socket SocketAM2
Processor Count 1

Computer Memory Type 4 GB DDR3 SDRAM
Hard Drive Size 500 GB
Graphics Coprocessor ATI Radeon HD7000 Series
Graphics Card Description ATI Radeon HD7000 Series
Graphics RAM Type DDR3 SDRAM
Graphics Card Ram Size 512 MB
Graphics Card Interface Integrated

This machine caps out at about 2.5GB Mem usage for the game and around 50% cpu for a few players.

Linux Box for serving files.

Computer Memory Type 256Mb DDR3 SDRAM (230560 kB)
Hard Drive Size 4000 GB

Processor Count 2
Hardware : Comcerto 2000 EVM
Revision : 0001

Processor : ARMv7 Processor rev 1 (v7l)
processor : 0
BogoMIPS : 1292.69
processor : 1
BogoMIPS : 1292.69

Features : swp half thumb fastmult vfp edsp neon vfpv3 tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x2
CPU part : 0xc09
CPU revision : 1

You will note that none of these are amazing machines. They run decently enough to play Ark and no more.

At todays prices: This entire setup would cost you around £150 for the linux NAS,
£150 per box that can be a server or client, plus an additional £70 per machine for the graphics capable boxes, so for 4 machines and the NAS it was under a grand.

The graphics card we used was a very low range 730 4GB GDDR5 for the client machines which came in under the £70 budget easily. They manage a playable 30 FPS.

Hopefully this is a grokkable enough thumb in the air for those wishing to derp.
Enjoy.
1 Comments
бэд бой  [author] Jan 25, 2016 @ 11:10am 
We ended up not using the SAMBA solution until the corruption issues are more tied down.
The servers ended up needing around 8Gb of RAM to comfortably house the server process.
The card we recommend until the perfomance pass by the devs is a 980 FTW.