Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When starting from systemd in server mode, the processor loads 100% #4299

Closed
ddrv opened this issue May 25, 2020 · 7 comments
Closed

When starting from systemd in server mode, the processor loads 100% #4299

ddrv opened this issue May 25, 2020 · 7 comments

Comments

@ddrv
Copy link

ddrv commented May 25, 2020

Description

When I run the command /opt/stk/bin/supertuxkart --server-config=/home/stk/stk/server.xml from the stk user, all ok.
I want to make the stk server available while my vps is on. I make systemd service.
When I staring the systemd service, My server is available in game, but the vps CPU is loaded at 99-100%.

Steps to reproduce

When I run the command /opt/stk/bin/supertuxkart --server-config=/home/stk/stk/server.xml from the stk user, everything is fine. I see a log in the console.

stk@srv:~$ /opt/stk/bin/supertuxkart --server-config=/home/stk/stk/server.xml
[verbose  ] main: Error messages and other text output will be logged to /home/stk/.config/supertuxkart/config-0.10/server.log.
[info   ] [FileManager]: Data files will be fetched from: '/opt/stk/share/supertuxkart/data/'
[info   ] [FileManager]: User directory is '/home/stk/.config/supertuxkart/config-0.10/'.
[info   ] [FileManager]: Addons files will be stored in '/home/stk/.local/share/supertuxkart/addons/'.
[info   ] [FileManager]: Screenshots will be stored in '/home/stk/.local/share/supertuxkart/screenshots/'.
[info   ] [FileManager]: User-defined grand prix will be stored in '/home/stk/.local/share/supertuxkart/grandprix/'.
[info   ] [FileManager]: Asset 0 will be loaded from '/opt/stk/share/supertuxkart/data/challenges/'.
[info   ] [FileManager]: Asset 1 will be loaded from '/opt/stk/share/supertuxkart/data/gfx/'.
[info   ] [FileManager]: Asset 2 will be loaded from '/opt/stk/share/supertuxkart/data/grandprix/'.
[info   ] [FileManager]: Asset 3 will be loaded from '/opt/stk/share/supertuxkart/data/gui/icons/'.
[info   ] [FileManager]: Asset 4 will be loaded from '/opt/stk/share/supertuxkart/data/gui/screens/'.
[info   ] [FileManager]: Asset 5 will be loaded from '/opt/stk/share/supertuxkart/data/gui/dialogs/'.
[info   ] [FileManager]: Asset 6 will be loaded from '/opt/stk/share/supertuxkart/data/replay/'.
[info   ] [FileManager]: Asset 7 will be loaded from '/opt/stk/share/supertuxkart/data/shaders/'.
[info   ] [FileManager]: Asset 8 will be loaded from '/opt/stk/share/supertuxkart/data/skins/'.
[info   ] [FileManager]: Asset 9 will be loaded from '/opt/stk/share/supertuxkart/data/ttf/'.
[info   ] [FileManager]: Asset 10 will be loaded from '/opt/stk/share/supertuxkart/data/po/'.
[info   ] [FileManager]: Asset 11 will be loaded from '/opt/stk/share/supertuxkart/data/library/'.
[info   ] [FileManager]: Asset 12 will be loaded from '/opt/stk/share/supertuxkart/data/models/'.
[info   ] [FileManager]: Asset 13 will be loaded from '/opt/stk/share/supertuxkart/data/music/'.
[info   ] [FileManager]: Asset 14 will be loaded from '/opt/stk/share/supertuxkart/data/sfx/'.
[info   ] [FileManager]: Asset 15 will be loaded from '/opt/stk/share/supertuxkart/data/textures/'.
[info   ] [FileManager]: Asset 16 will be loaded from '/opt/stk/share/supertuxkart/data/tracks/'.
..:: Antarctica Rendering Engine 2.0 ::..
Linux 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2 (2020-04-29) x86_64
[info   ] HTTPRequest: Sending userid=******&token=************************ to https://online.supertuxkart.net/api/v2/user/saved-session/
[info   ] GrandPrixManager: Loading Grand Prix files from /opt/stk/share/supertuxkart/data/grandprix/
[info   ] GrandPrixManager: Loading Grand Prix files from /home/stk/.local/share/supertuxkart/grandprix/
[warn   ] Material: Cannot determine texture full path: zipper_collect.png
[error  ] material: Cannot find texture 'zipper_collect.png'.
[warn   ] Material: Cannot determine texture full path: bowling-icon.png
[error  ] material: Cannot find texture 'bowling-icon.png'.
[warn   ] Material: Cannot determine texture full path: bubblegum-icon.png
[error  ] material: Cannot find texture 'bubblegum-icon.png'.
[warn   ] Material: Cannot determine texture full path: cake-icon.png
[error  ] material: Cannot find texture 'cake-icon.png'.
[warn   ] Material: Cannot determine texture full path: anchor-icon.png
[error  ] material: Cannot find texture 'anchor-icon.png'.
[warn   ] Material: Cannot determine texture full path: swap-icon.png
[error  ] material: Cannot find texture 'swap-icon.png'.
[warn   ] Material: Cannot determine texture full path: swatter-icon.png
[error  ] material: Cannot find texture 'swatter-icon.png'.
[warn   ] Material: Cannot determine texture full path: rubber_ball-icon.png
[error  ] material: Cannot find texture 'rubber_ball-icon.png'.
[warn   ] Material: Cannot determine texture full path: parachute-icon.png
[error  ] material: Cannot find texture 'parachute-icon.png'.
[warn   ] Material: Cannot determine texture full path: plunger-icon.png
[error  ] material: Cannot find texture 'plunger-icon.png'.
[warn   ] Material: Missing container id for parachute-attach-icon.png, no texture compression for it will be done.
[warn   ] Material: Missing container id for bomb-attach-icon.png, no texture compression for it will be done.
[warn   ] Material: Missing container id for anchor-attach-icon.png, no texture compression for it will be done.
[warn   ] Material: Missing container id for shield-icon.png, no texture compression for it will be done.
[info   ] Achievements: Synching achievement 1,2,3,4,5,6,7,8,9,11,12 to server.
[info   ] HTTPRequest: Sending userid=******&token=************************&achievementid=1%2C2%2C3%2C4%2C5%2C6%2C7%2C8%2C9%2C11%2C12 to https://online.supertuxkart.net/api/v2/user/achieving/
Mon May 25 11:34:04 2020 [info   ] STKHost: Host initialized.
Mon May 25 11:34:04 2020 [info   ] STKHost: Server port is 2759
Mon May 25 11:34:04 2020 [info   ] ServerLobby: Resetting the server to its initial state.
Mon May 25 11:34:04 2020 [info   ] ProtocolManager: A 11ServerLobby protocol has been started.
Mon May 25 11:34:04 2020 [info   ] main: Creating a WAN server 'my-server'.
Mon May 25 11:34:04 2020 [warn   ] LayoutManager: Widget 'timeout-message' has a height of 0 (left_space = 0, fraction = 1.000000, max_width = )

Available command:
help, Print this.
quit, Shut down the server.
kickall, Kick all players out of STKHost.
kick #, kick # peer of STKHost.
kickban #, kick and ban # peer of STKHost.
listpeers, List all peers with host ID and IP.
listban, List IP ban list of server.
speedstats, Show upload and download speed.
Mon May 25 11:34:04 2020 [info   ] STKHost: Listening has been started.
Mon May 25 11:34:04 2020 [info   ] ServerLobby: Public server address ***.***.***.***:2759
Mon May 25 11:34:04 2020 [info   ] HTTPRequest: Sending userid=******&token=************************&address=**********&port=2759&private_port=2759&name=my-server&max_players=8&difficulty=3&game_mode=3&password=*&version=6 to https://online.supertuxkart.net/api/v2/server/create/
Mon May 25 11:34:04 2020 [info   ] HTTPRequest: Sending userid=******&token=************************&visitingid=****** to https://online.supertuxkart.net/api/v2/user/get-friends-list/
Mon May 25 11:34:04 2020 [info   ] ServerLobby: Server 133312 is now online.

My server appears in the list of private servers. I can connect and play. The processor is loaded at 5%.

Now I want to make the stk server available while my vps is on.

I create user stk and systemd service /etc/systemd/system/stk.service:

[Unit]
Description=SuperTuxKart game server
After=network.target auditd.service

[Service]
EnvironmentFile=/home/stk/stk/env
ExecStart=/opt/stk/bin/supertuxkart --server-config=/home/stk/stk/server.xml
User=stk
Group=stk
Restart=always
Type=simple
[Install]
WantedBy=multi-user.target

I run service.

systemctl start stk.service

journalctl -u stk.service -f command output shows:

May 25 11:30:06 srv systemd[1]: Started SuperTuxKart game server.
May 25 11:30:07 srv sh[2384]: [verbose  ] main: Error messages and other text output will be logged to /home/stk/.config/supertuxkart/config-0.10/server.log.
May 25 11:30:07 srv sh[2384]: [info   ] [FileManager]: Data files will be fetched from: '/opt/stk/share/supertuxkart/data/'
May 25 11:30:07 srv sh[2384]: [info   ] [FileManager]: User directory is '/home/stk/.config/supertuxkart/config-0.10/'.
May 25 11:30:07 srv sh[2384]: [info   ] [FileManager]: Addons files will be stored in '/home/stk/.local/share/supertuxkart/addons/'.
May 25 11:30:07 srv sh[2384]: [info   ] [FileManager]: Screenshots will be stored in '/home/stk/.local/share/supertuxkart/screenshots/'.
May 25 11:30:07 srv sh[2384]: [info   ] [FileManager]: User-defined grand prix will be stored in '/home/stk/.local/share/supertuxkart/grandprix/'.
May 25 11:30:07 srv sh[2384]: [info   ] [FileManager]: Asset 0 will be loaded from '/opt/stk/share/supertuxkart/data/challenges/'.
May 25 11:30:07 srv sh[2384]: [info   ] [FileManager]: Asset 1 will be loaded from '/opt/stk/share/supertuxkart/data/gfx/'.
May 25 11:30:07 srv sh[2384]: [info   ] [FileManager]: Asset 2 will be loaded from '/opt/stk/share/supertuxkart/data/grandprix/'.
May 25 11:30:07 srv sh[2384]: [info   ] [FileManager]: Asset 3 will be loaded from '/opt/stk/share/supertuxkart/data/gui/icons/'.
May 25 11:30:07 srv sh[2384]: [info   ] [FileManager]: Asset 4 will be loaded from '/opt/stk/share/supertuxkart/data/gui/screens/'.
May 25 11:30:07 srv sh[2384]: [info   ] [FileManager]: Asset 5 will be loaded from '/opt/stk/share/supertuxkart/data/gui/dialogs/'.
May 25 11:30:07 srv sh[2384]: [info   ] [FileManager]: Asset 6 will be loaded from '/opt/stk/share/supertuxkart/data/replay/'.
May 25 11:30:07 srv sh[2384]: [info   ] [FileManager]: Asset 7 will be loaded from '/opt/stk/share/supertuxkart/data/shaders/'.
May 25 11:30:07 srv sh[2384]: [info   ] [FileManager]: Asset 8 will be loaded from '/opt/stk/share/supertuxkart/data/skins/'.
May 25 11:30:07 srv sh[2384]: [info   ] [FileManager]: Asset 9 will be loaded from '/opt/stk/share/supertuxkart/data/ttf/'.
May 25 11:30:07 srv sh[2384]: [info   ] [FileManager]: Asset 10 will be loaded from '/opt/stk/share/supertuxkart/data/po/'.
May 25 11:30:07 srv sh[2384]: [info   ] [FileManager]: Asset 11 will be loaded from '/opt/stk/share/supertuxkart/data/library/'.
May 25 11:30:07 srv sh[2384]: [info   ] [FileManager]: Asset 12 will be loaded from '/opt/stk/share/supertuxkart/data/models/'.
May 25 11:30:07 srv sh[2384]: [info   ] [FileManager]: Asset 13 will be loaded from '/opt/stk/share/supertuxkart/data/music/'.
May 25 11:30:07 srv sh[2384]: [info   ] [FileManager]: Asset 14 will be loaded from '/opt/stk/share/supertuxkart/data/sfx/'.
May 25 11:30:07 srv sh[2384]: [info   ] [FileManager]: Asset 15 will be loaded from '/opt/stk/share/supertuxkart/data/textures/'.
May 25 11:30:07 srv sh[2384]: [info   ] [FileManager]: Asset 16 will be loaded from '/opt/stk/share/supertuxkart/data/tracks/'.
May 25 11:30:07 srv sh[2384]: ..:: Antarctica Rendering Engine 2.0 ::..
May 25 11:30:07 srv sh[2384]: Linux 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2 (2020-04-29) x86_64
May 25 11:30:07 srv sh[2384]: [info   ] HTTPRequest: Sending userid=******&token=************************ to https://online.supertuxkart.net/api/v2/user/saved-session/
May 25 11:30:07 srv sh[2384]: [info   ] GrandPrixManager: Loading Grand Prix files from /opt/stk/share/supertuxkart/data/grandprix/
May 25 11:30:07 srv sh[2384]: [info   ] GrandPrixManager: Loading Grand Prix files from /home/stk/.local/share/supertuxkart/grandprix/
May 25 11:30:07 srv sh[2384]: [warn   ] Material: Cannot determine texture full path: zipper_collect.png
May 25 11:30:07 srv sh[2384]: [error  ] material: Cannot find texture 'zipper_collect.png'.
May 25 11:30:07 srv sh[2384]: [warn   ] Material: Cannot determine texture full path: bowling-icon.png
May 25 11:30:07 srv sh[2384]: [error  ] material: Cannot find texture 'bowling-icon.png'.
May 25 11:30:07 srv sh[2384]: [warn   ] Material: Cannot determine texture full path: bubblegum-icon.png
May 25 11:30:07 srv sh[2384]: [error  ] material: Cannot find texture 'bubblegum-icon.png'.
May 25 11:30:07 srv sh[2384]: [warn   ] Material: Cannot determine texture full path: cake-icon.png
May 25 11:30:07 srv sh[2384]: [error  ] material: Cannot find texture 'cake-icon.png'.
May 25 11:30:07 srv sh[2384]: [warn   ] Material: Cannot determine texture full path: anchor-icon.png
May 25 11:30:07 srv sh[2384]: [error  ] material: Cannot find texture 'anchor-icon.png'.
May 25 11:30:07 srv sh[2384]: [warn   ] Material: Cannot determine texture full path: swap-icon.png
May 25 11:30:07 srv sh[2384]: [error  ] material: Cannot find texture 'swap-icon.png'.
May 25 11:30:07 srv sh[2384]: [warn   ] Material: Cannot determine texture full path: swatter-icon.png
May 25 11:30:07 srv sh[2384]: [error  ] material: Cannot find texture 'swatter-icon.png'.
May 25 11:30:07 srv sh[2384]: [warn   ] Material: Cannot determine texture full path: rubber_ball-icon.png
May 25 11:30:07 srv sh[2384]: [error  ] material: Cannot find texture 'rubber_ball-icon.png'.
May 25 11:30:07 srv sh[2384]: [warn   ] Material: Cannot determine texture full path: parachute-icon.png
May 25 11:30:07 srv sh[2384]: [error  ] material: Cannot find texture 'parachute-icon.png'.
May 25 11:30:07 srv sh[2384]: [warn   ] Material: Cannot determine texture full path: plunger-icon.png
May 25 11:30:07 srv sh[2384]: [error  ] material: Cannot find texture 'plunger-icon.png'.
May 25 11:30:07 srv sh[2384]: [warn   ] Material: Missing container id for parachute-attach-icon.png, no texture compression for it will be done.
May 25 11:30:07 srv sh[2384]: [warn   ] Material: Missing container id for bomb-attach-icon.png, no texture compression for it will be done.
May 25 11:30:07 srv sh[2384]: [warn   ] Material: Missing container id for anchor-attach-icon.png, no texture compression for it will be done.
May 25 11:30:07 srv sh[2384]: [warn   ] Material: Missing container id for shield-icon.png, no texture compression for it will be done.
May 25 11:30:07 srv sh[2384]: [info   ] Achievements: Synching achievement 1,2,3,4,5,6,7,8,9,11,12 to server.
May 25 11:30:07 srv sh[2384]: [info   ] HTTPRequest: Sending userid=******&token=************************&achievementid=1%2C2%2C3%2C4%2C5%2C6%2C7%2C8%2C9%2C11%2C12 to https://online.supertuxkart.net/api/v2/user/achieving/
May 25 11:30:07 srv sh[2384]: Mon May 25 11:30:07 2020 [info   ] STKHost: Host initialized.
May 25 11:30:07 srv sh[2384]: Mon May 25 11:30:07 2020 [info   ] STKHost: Server port is 2759
May 25 11:30:07 srv sh[2384]: Mon May 25 11:30:07 2020 [info   ] ServerLobby: Resetting the server to its initial state.
May 25 11:30:07 srv sh[2384]: Mon May 25 11:30:07 2020 [info   ] ProtocolManager: A 11ServerLobby protocol has been started.
May 25 11:30:07 srv sh[2384]: Mon May 25 11:30:07 2020 [info   ] main: Creating a WAN server 'my-server'.
May 25 11:30:07 srv sh[2384]: Mon May 25 11:30:07 2020 [warn   ] LayoutManager: Widget 'timeout-message' has a height of 0 (left_space = 0, fraction = 1.000000, max_width = )
May 25 11:30:07 srv sh[2384]: Available command:
May 25 11:30:07 srv sh[2384]: help, Print this.
May 25 11:30:07 srv sh[2384]: quit, Shut down the server.
May 25 11:30:07 srv sh[2384]: kickall, Kick all players out of STKHost.
May 25 11:30:07 srv sh[2384]: kick #, kick # peer of STKHost.
May 25 11:30:07 srv sh[2384]: kickban #, kick and ban # peer of STKHost.
May 25 11:30:07 srv sh[2384]: listpeers, List all peers with host ID and IP.
May 25 11:30:07 srv sh[2384]: listban, List IP ban list of server.
May 25 11:30:07 srv sh[2384]: speedstats, Show upload and download speed.

My server appears in the list of private servers. I can connect and play (with lags). The processor is loaded at 99-100%.

The log is only updated when I stop the service systemctl stop stk.service

May 25 11:31:09 srv systemd[1]: stk.service: Current command vanished from the unit file, execution of the command list won't be resumed.
May 25 11:31:09 srv systemd[1]: Stopping SuperTuxKart game server...
May 25 11:31:10 srv sh[2384]: Mon May 25 11:30:07 2020 [info   ] ServerLobby: Public server address ***.***.***.***:2759
May 25 11:31:10 srv sh[2384]: Mon May 25 11:30:07 2020 [info   ] HTTPRequest: Sending userid=******&token=************************&address=**********&port=2759&private_port=2759&name=my-server&max_players=8&difficulty=3&game_mode=3&password=*&version=6 to https://online.supertuxkart.net/api/v2/server/create/
May 25 11:31:10 srv sh[2384]: Mon May 25 11:30:07 2020 [info   ] STKHost: Listening has been started.
May 25 11:31:10 srv sh[2384]: Mon May 25 11:30:08 2020 [info   ] HTTPRequest: Sending userid=******&token=************************&visitingid=****** to https://online.supertuxkart.net/api/v2/user/get-friends-list/
May 25 11:31:10 srv sh[2384]: Mon May 25 11:30:09 2020 [info   ] ServerLobby: Server 133310 is now online.
May 25 11:31:10 srv sh[2384]: Mon May 25 11:31:09 2020 [info   ] ProtocolManager: A 11ServerLobby protocol has been terminated.
May 25 11:31:10 srv sh[2384]: Mon May 25 11:31:09 2020 [info   ] ServerLobby: Unregister server address 185.159.129.205:2759
May 25 11:31:10 srv sh[2384]: Mon May 25 11:31:09 2020 [info   ] HTTPRequest: Sending userid=******&token=************************&address=**********&port=2759 to https://online.supertuxkart.net/api/v2/server/stop/
May 25 11:31:10 srv sh[2384]: Mon May 25 11:31:10 2020 [info   ] STKHost: Listening has been stopped.
May 25 11:31:10 srv sh[2384]: [info   ] HTTPRequest: Sending userid=******&token=************************ to https://online.supertuxkart.net/api/v2/user/client-quit/
May 25 11:31:10 srv sh[2384]: [verbose  ] Thread: Start waiting 1257570.580000
May 25 11:31:10 srv sh[2384]: [verbose  ] Thread: Waited 0.446000 seconds for thread to become deleteable.
May 25 11:31:10 srv sh[2384]: [verbose  ] Thread: Stop waiting 1257571.026000
May 25 11:31:10 srv sh[2384]: [info   ] Singleton: Destroyed singleton.
May 25 11:31:10 srv sh[2384]: 
May 25 11:31:10 srv systemd[1]: stk.service: Succeeded.
May 25 11:31:10 srv systemd[1]: Stopped SuperTuxKart game server.

Configuration

STK release version: 1.1

STK Source (PPA, distribution package, official binary, etc.): branch 1.1 of github. compiled with cmake and -DSERVER_ONLY=ON option.

System: Debian stretch

Graphics card: unknown

CPU:

stk@srv:~$ sudo lscpu 
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
Address sizes:       40 bits physical, 48 bits virtual
CPU(s):              1
On-line CPU(s) list: 0
Thread(s) per core:  1
Core(s) per socket:  1
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               44
Model name:          Westmere E56xx/L56xx/X56xx (IBRS update)
Stepping:            1
CPU MHz:             3066.774
BogoMIPS:            6133.54
Virtualization:      VT-x
Hypervisor vendor:   KVM
Virtualization type: full
L1d cache:           32K
L1i cache:           32K
L2 cache:            4096K
L3 cache:            16384K
NUMA node0 CPU(s):   0
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid tsc_known_freq pni pclmulqdq vmx ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes hypervisor lahf_lm pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid tsc_adjust arat

Gamepads/keyboards models if related to the issue: none

@Benau
Copy link
Contributor

Benau commented May 25, 2020

try use the server creation shell script in tools or gnu scrern / tmux

@Benau
Copy link
Contributor

Benau commented May 25, 2020

also try disable network console because it eats your stdin

@ddrv
Copy link
Author

ddrv commented May 25, 2020

@Benau do you mean add --no-console-log option? I run script without console-log option

@Benau
Copy link
Contributor

Benau commented May 25, 2020

<!-- Enable network console, which can do for example kickban. -->
    <enable-console value="false" />

You seem to have it "true"

@ddrv
Copy link
Author

ddrv commented May 25, 2020

@Benau Thank you! It's works!

@ddrv ddrv closed this as completed May 25, 2020
@licaon-kter
Copy link
Contributor

Any reason it would use 5% continuously in idle? I have a bunch of other services and they stay at 0% if no activity.

Debian Buster, arm64, RPi3+, build from git SERVER_ONLY.

@Benau
Copy link
Contributor

Benau commented Oct 25, 2020

Because enet has no conditonal wait

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants