Jump to content

Native Linux server (with management scripts)


Recommended Posts

Hm, why 0,4? As you seem to have only 4 cores (at least htop only shows 4 in your screenshot) the highest number would be 3 ;)

 

You might want to try to run "taskset -acp 0,3 <pid>" instead where -a makes it set affinity also for all child threads.

Wonder why 7dtd is starting this many threads at all though ... "listthreads" only shows 8 for me while there's roughly 30 threads running. Just some random thing: what locale is your server running?

 

 

EDIT:

also how to use taskset on "7dtd.sh start <instance>" so I can limit that to specific cpu cores without having to get pid once I've started it.

You would have to edit /usr/local/lib/7dtd/commands/start.sh line 34. Not sure though if CPU affinity is inherited by new threads started from a process. Testing and will report back with more details ;)

Edited by Alloc (see edit history)
Link to post
Share on other sites
You would have to edit /usr/local/lib/7dtd/commands/start.sh line 34. Not sure though if CPU affinity is inherited by new threads started from a process. Testing and will report back with more details ;)

 

Ok, seems to work. You have to edit line 34 of /usr/local/lib/7dtd/commands/start.sh. It should currently start with:

LD_LIBRARY_PATH=$SDTD_BASE/linux_files $SSD --start $SSD_PID $SSD_DAEMON $SSD_USER --chdir $SDTD_BASE/engine --exec $SDTD_BASE/engine/7DaysToDie.x86 -- $OPTS ...

change it to:

LD_LIBRARY_PATH=$SDTD_BASE/linux_files/x86 $SSD --start $SSD_PID $SSD_DAEMON $SSD_USER --chdir $SDTD_BASE/engine --exec /usr/bin/taskset -- -c 0 $SDTD_BASE/engine/7DaysToDie.x86 $OPTS ...

The "-c 0" right in front of the 7dtd.x86 is the affinity list, use whatever you like there.

Link to post
Share on other sites

yeah i meant 0,3 I just copied pasted it from that site... but i did change it when I did it in ssh

 

and locale....

LANG=en_GB.UTF-8

LANGUAGE=

LC_CTYPE="en_GB.UTF-8"

LC_NUMERIC="en_GB.UTF-8"

LC_TIME="en_GB.UTF-8"

LC_COLLATE="en_GB.UTF-8"

LC_MONETARY="en_GB.UTF-8"

LC_MESSAGES="en_GB.UTF-8"

LC_PAPER="en_GB.UTF-8"

LC_NAME="en_GB.UTF-8"

LC_ADDRESS="en_GB.UTF-8"

LC_TELEPHONE="en_GB.UTF-8"

LC_MEASUREMENT="en_GB.UTF-8"

LC_IDENTIFICATION="en_GB.UTF-8"

LC_ALL=

Link to post
Share on other sites

Hm, ok, that should not be any problem. Thought it might be that in some locales the server starts but some threads could run into problems with data if the locale is a bit weirder ;)

 

Please tell us if setting the CPU affinity does have any (hopefully positive) effect on performance ,)

Link to post
Share on other sites

Fun never ends

 

Thank for putting this together! I followed the automatic installation and created my instance; however, when I run the instance I get a "Failed!" response looking at the stdout I see this

/usr/local/lib/7dtd/start-stop-daemon/start-stop-daemon: unable to stat /home/sdtd/engine/7DaysToDie.x86 (No such file or directory)

I can confirm I do not have an engine directory at all, did something go awry with my install and if so should I uninstall and reinstall everything or is there a simple fix/point where I can pick up at? I'm running ubuntu 12.04 lts (32bit).

 

UPDATE

I got the engine problem resolved, I'm still getting a failed though and the output is

Found path: /home/sdtd/engine/7DaysToDie.x86

There is no data folder

Edited by radhaz
new info (see edit history)
Link to post
Share on other sites
Looks like downloading 7dtd itself did not work. Try rerunning "7dtd.sh updateengine".
I "may" have figured it out as it says I have "no subscription" do I have to use my steam account that owns 7dtd? I have a separate steamcmd account that I use for hosting dedicated server games.

 

gameserver@gameserver:/home/sdtd$ sudo 7dtd.sh updateengine

A newer version of the engine is available.

Local buildid: 0

Available buildid: 298550

 

Continue? (yn) y

Updating...

Redirecting stderr to '/home/gameserver/Steam/logs/stderr.txt'

[ 0%] Checking for available updates...

[----] Verifying installation...

Steam Console Client © Valve Corporation

-- type 'quit' to exit --

Loading Steam3...OK.

"@sSteamCmdForcePlatformType" = "windows"

 

Logging in user '########' to Steam Public...Success.

ERROR! Failed to install app '251570' (No subscription)

/home/buildbot/buildslave/steam_rel_client_linux/build/src/clientdll/configstore .cpp (1280) : Assertion Failed: Saving local config store failed during shutdown

/home/buildbot/buildslave/steam_rel_client_linux/build/src/clientdll/configstore .cpp (101) : Assertion Failed: ConfigStore (UserLocalConfigStore) is dirty, and being destroyed, we're discarding data

/home/buildbot/buildslave/steam_rel_client_linux/build/src/clientdll/configstore .cpp (1280) : Assertion Failed: Saving local config store failed during shutdown

/home/buildbot/buildslave/steam_rel_client_linux/build/src/clientdll/configstore .cpp (101) : Assertion Failed: ConfigStore (InstallConfigStore) is dirty, and be ing destroyed, we're discarding data

cp: cannot stat `/home/sdtd/engine/Install/32bit/SteamworksManaged.dll': No such file or directory

 

UPDATE

Answered my own question by researching it at https://developer.valvesoftware.com/wiki/Dedicated_Servers_List yes you have to have the account you registered the game on unfortunately

Edited by radhaz (see edit history)
Link to post
Share on other sites

Yeh so I did try LD_LIBRARY_PATH=$SDTD_BASE/linux_files/x86 $SSD

 

though would not work because on mine it was LD_LIBRARY_PATH=$SDTD_BASE/linux_files $SSD

 

without the x86.. it did work so limited it to just 2cores on startup now..

 

any seems the cpu spiking like that doesn't seem to be 7dtd server, seems more like the server was getting ddos attacks and that was causing cpu usage spikes all processes just looked like it was 7dtd at the time, but then I noticed massive spiking on other processes at random time periods when 7dtd wasn't running.

Link to post
Share on other sites

Wonder how it could ignore CPU affinity if set for all threads ... ;)

Unfortunately I can't do much about such issues, but just as a note: Haven been playing on a server the last days with up to 5 players being online concurrently. No crash, no other problems, CPU load on 4 cores between 40% (2 players) and almost 200% (i.e. two cores almost completely busy) (5 players) but even than it was running fine.

Link to post
Share on other sites

Thanks for this guide!

 

Had to try it, so I dug up an old Dell laptop (Latitude D430) with 2gb or RAM, installed Ubuntu Server 14.4 (32bit). I've currently only tried it within my own LAN at home with only myself playing, but no lag what so ever. Will open up ports in my FW and get a friend or two to log on and and stress-test it a bit... the laptop hosting the server is currently connected with WiFi too - not an optimal solution, I know, but I'm just testing atm.

 

Anyway - the guide was easy and straightforward to follow, so thumbs up from me! :)

Link to post
Share on other sites

Easiest way:

. /usr/local/lib/7dtd/common.sh
telnetCommand <sessionName> "say Hello"

 

You can also decrease the time the script waits after sending the message, should not matter for using "say":

. /usr/local/lib/7dtd/common.sh
telnetCommand <sessionName> "say Hello" 0.3

 

Regards,

Chris

Link to post
Share on other sites

Thank you very much!!!!!!!! :)

 

 

Easiest way:

. /usr/local/lib/7dtd/common.sh
telnetCommand <sessionName> "say Hello"

 

You can also decrease the time the script waits after sending the message, should not matter for using "say":

. /usr/local/lib/7dtd/common.sh
telnetCommand <sessionName> "say Hello" 0.3

 

Regards,

Chris

 

- - - Updated - - -

 

Thanks, but the control panel opens for a few seconds and then is forever asking to put the password again.

Link to post
Share on other sites
Thanks, but the control panel opens for a few seconds and then is forever asking to put the password again.

 

Can you be a bit more specific? I.e. what did you do exactly and what's happening then?

Link to post
Share on other sites
Can you be a bit more specific? I.e. what did you do exactly and what's happening then?

 

when I open the panel (myip:8080), it stays open for a few seconds. And then ends the session and asks to enter the password again. It is in this loop forever.

Link to post
Share on other sites

H3llghost is almost right ... the first character being a shebang of course ... ;)

#!/bin/sh
. /usr/local/lib/7dtd/common.sh

telnetCommand $1 "say Hello to $4"

  • Like 1
Link to post
Share on other sites

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
×
×
  • Create New...