FakeFishGames / Barotrauma

A 2D online multiplayer game taking place in a submarine travelling through the icy depths of Jupiter's moon Europa.
http://www.barotraumagame.com/
1.76k stars 406 forks source link

Poor performance when hosting server via Ptedoractyl (docker) #11483

Open jefvaia opened 1 year ago

jefvaia commented 1 year ago

Disclaimers

What happened?

I hire a virtual server for game hosting. I have never had problems while hosting Barotrauma servers, but when I switched to use Pterodctyl (which uses docker) the performance was terrible.

For reference, the server has 8 cores AMD EPYC, 30 GB ram and 800 GB disk space, of which I don't restrict it. I use a pre generated egg: link

Something I have noticed is when starting a level it uses 100% cpu in Pterodactyl (aka 100% of one core) and when the level is loaded, it hangs around 30%, which is less than half of only one core.

Also, for some weird reason the console gets flooded by unknown characters (see Relevant Error Messages for what I mean).

Reproduction steps

  1. I started the server with the right port forwards and 20 tickrate
  2. I joined that server. It was still working
  3. I started a round and for some reason, I rubberband like crazy and I get low performance messages in console.

Bug prevalence

Happens every time I play

Version

0.21.6.0

-

No response

Which operating system did you encounter this bug on?

Linux

Relevant error messages and crash reports

[03/11/2023 14:49:07] Selected sub: Azimuth
[03/11/2023 14:49:07] Selected shuttle: Hemulen
[03/11/2023 14:49:07] [03/11/2023 14:49:07]
  Starting the server...
[03/11/2023 14:49:07] [03/11/2023 14:49:07]
  Using Lidgren networking. Manual port forwarding may be required. If players cannot connect to the server, you may want to use the in-game hosting menu (which uses SteamP2P networking and does not require port forwarding).
[03/11/2023 14:49:07] New task: ModSender (1/5000)
[03/11/2023 14:49:08] [03/11/2023 14:49:08]
  Server started
[03/11/2023 14:49:18] [03/11/2023 14:49:18]
  Refreshed server info on the server list.
[03/11/2023 14:49:18] Task ModSender completed (0/5000)
[03/11/2023 14:49:43] ��.�&~�xhajyGR1@reenable{eonm{nm�H."�U@z�U@��!�U@�.��.�>�UUhA��.���.���UU8Abth�x�SUx�SU��.���UU0�.�(�X�P�������@vU��SU��xXUp�.��W�@vUW�!�U�~��-���~����>U��.�jN[��.�>�UUhA��.���.���UU8Abth�x�SUx�SU��.���UU��W��W��.�8�����:.��.�ctedPTimeOutmeO H�.�+!���"�U��.�>�UUhA��.���.���UU8Abth�x�SUx�SU��.���UU���!�U�}��-���}���.��3O�0�UU��.����!�U H�.��"�U��.�>�UUhA��.���.���UU8Abth�x�SUx�SU��.���UU�6��XJ�p�.�0J�p�.����� ��!�Up�.��N����!4�����.�����.��(�!�U�T����x�.�m<����.���UU8Abth�x�SUx�SU��.���UU�6��p�.����(�!�U��.��(�!�U�(�!�U��.� H�.�8A�"�U��.�p�"�U+�
[03/11/2023 14:49:43] Command "��.�&~�xhajyGR1@reenable{eonm{nm�H.�U@z�U@��!�U@�.��.�>�UUhA��.���.���UU8Abth�x�SUx�SU��.���UU0�.�(�X�P�������@vU��SU��xXUp�.��W�@vUW�!�U�~��-���~����>U��.�jN[��.�>�UUhA��.���.���UU8Abth�x�SUx�SU��.���UU��W��W��.�8�����:.��.�ctedPTimeOutmeO H�.�+!����U��.�>�UUhA��.���.���UU8Abth�x�SUx�SU��.���UU���!�U�}��-���}���.��3O�0�UU��.����!�U" not found.
[03/11/2023 14:49:45] Y8�.���.���UU8Abth�x�SUx�SU��.���UU`�.�0J�`�.����� ��!�U`�.��N����! H�.�P��"�U��.�p�"�U��8�.��(�!�U�M���.�bth�x�SUx�SU��.���UU`�.�0J���`�.�p�.����(�!�U��.��(�!�U H�.� �.��"�U��.�p�"�U���8�.��(�!�U�M���.�bth�x�SUx�SU��.���UU���������(�!�U0
[03/11/2023 14:49:45] Command "Y8�.���.���UU8Abth�x�SUx�SU��.���UU`�.�0J�`�.�����" not found.
[03/11/2023 14:49:59] SteamManager authenticating Steam client STEAM_1:0:221666568
[03/11/2023 14:50:00] 76561198403598864 validation: OK, True
[03/11/2023 14:50:01] �(�!�U�;���������!�UP�.��IR����!�U�}�� H�.���UU�"�U��.�p�"�UZ�8�.��(�!�U�M���.�bth�x�SUx�SU��.���UUif�HX�".P�.��}�P���8)�!�UH1X�{��8)�!�U��.� H�.��"�U��.�p�"�U��*M8�.��(�!�U�M���.�bth�x�SUx�SU��.���UUP�.�_Jt�`�!�U�_�1X�{���.�`|�V��.� H�.�X��!�U�"�U��.�p�"�U`g@�8�.��(�!�U�M���.�bth�x�SUx�SU��.���UU���<le{ere����.���xh H�.���.��"�U��.�p�"�Ul�:�8�.��(�!�U�M���.�bth�x�SUx�SU��.���UU���<le{ere����.���xh H�.���.��"�U��.�p�"�U$/C8�.��(�!�U�M���.�bth�x�SUx�SU��.���UU�������!�U �.��IR����!�U�}��-���}�� �.��3O�@��T H�.��"�U��.�p�"�U�KA8�.��(�!�U�M���.�bth�x�SUx�SU��.���UU �.��N��PN����!�U ��!�UP�.��F���(�!�U ��!�U(�.���.� H�.��"�U��.�p�"�U��T~8�.��(�!�U�M���.�bth�x�SUx�SU��.���UU �.��F���(�!�U ��!�U��.�`�.��;���������!�U`�.��IR� H�.�`�.��"�U��.�p�"�U�\e�8�.��(�!�U�M���.�bth�x�SUx�SU��.���UU(\����.�1X�{��\����.����������������(�!�U H�.���.��"�U��.�p�"�U��f�8�.��(�!�U�M���.�bth�x�SUx�SU��.���UU(\����.�1X�{��\����.����������������(�!�U H�.���.��"�U��.�p�"�U��o58�.��(�!�U�M���.�bth�x�SUx�SU��.���UU(\����.�1X�{��\����.����������������(�!�U H�.���.��"�U��.�p�"�U��r8�.��(�!�U�M���.�bth�x�SUx�SU��.���UU0�.��W��|UX��~��-���~��-�>Up�.�jN[����������(�!�U H�.�h?XU�"�U��.�p�"�U�;��8�.��(�!�U�M���.�bth�x�SUx�SU��.���UU���!�U��.��T_���.��.�k�/U�S��R�RH%�Wk H�.��"�U��.�p�"�UP��8�.��(�!�U�M���.�bth�x�SUx�SU��.���UU��������@8)�!�U����H|��@���� H�.��"�U��.�p�"�U�S�)8�.��(�!�U�M���.�bth�x�SUx�SU��.���UU���~���.�Xi5V@�T(�U���~��1X�{�� H�.�p�.��"�U��.�p�"�U��f8�.��(�!�U�M���.�bth�x�SUx�SU��.���UU���~���.�Xi5V@�T(�U���~��1X�{�� H�.���.��"�U��.�p�"�U���8�.��(�!�U�M���.�bth�x�SUx�SU��.���UU���~���.�Xi5V@�T(�U���~��1X�{�� H�.���.��"�U��.�p�"�Um���8�.��(�!�U�M���.�bth�x�SUx�SU��.���UU���~���.�Xi5V@�T(�U���~��1X�{�� H�.���.��"�U��.�p�"�U���8�.��(�!�U�M���.�bth�x�SUx�SU��.���UUT�.����������������(�!�U���(�!�U�;���������!�Up�.� H�.��}���"�U��.�p�"�UH��8�.��(�!�U�M���.�bth�x�SUx�SU��.���UUT�.����������������(�!�U���(�!�U�;���������!�Up�.� H�.���.��"�U��.�p�"�U"n�8�.��(�!�U�M���.�bth�x�SUx�SU��.���UUT�.����#H��#�V�((��#`�.�x*)WT�.����#�V�(45 H�.���ZU�"�U��.�p�"�U��=8�.��(�!�U�M���.�bth�x�SUx�SU��.���UUT�.����#H��#�V�((��#`�.�x*)WT�.����#�V�(45 H�.���.��"�U��.�p�"�Uo��8�.��(�!�U�M���.�bth�x�SUx�SU��.���UU8��*x��-��.�4�2W��d�A�-�T�-���8�.�8�.������������(�!�U�
[03/11/2023 14:50:01] Command "�(�!�U�;���������!�UP�.��IR����!�U�}��" not found.
[03/11/2023 14:50:11] [03/11/2023 14:50:11]
  jefvaia has joined the server.
[03/11/2023 14:50:11] [03/11/2023 14:50:11]
  Saving client permissions
[03/11/2023 14:50:11] Sending initial lobby update to jefvaia
[03/11/2023 14:50:11] Compressed message: 2459 to 2046
[03/11/2023 14:50:11] [03/11/2023 14:50:11]
  Refreshed server info on the server list.
[03/11/2023 14:50:16] �(�!�U�;���������!�U��.��IR����!�U�}��-����.�bth�x�SUx�SU��.���UUP�.�P�2W�l�l�l�l�A�-�"�U��.�p�"�U���6�(�!�U�����.�����f�.��f�����-�g��.�(h�i�-��.�bth���.�+�2WP�.��.1WH��"�U��.�p�"�U��t�(�!�U�����.�����f�.��f�����g��.�(h��.�bth���.�+�2WP�.��.1W�(�!�U�"�U��.�p�"�U����(�!�U�����.�����f�.��f�����g��.�(h��.�bth���.�+�2W�L.�
[03/11/2023 14:50:16] Command "�(�!�U�;���������!�U��.��IR����!�U�}��-����.�bth�x�SUx�SU��.���UUP�.�P�2W�l�l�l�l�A�-��U��.�p��U���6�(�!�U�����.�����f�.��f�����-�g��.�(h�i�-��.�bth���.�+�2WP�.��.1WH���U��.�p��U��t�(�!�U�����.�����f�.��f�����g��.�(h��.�bth���.�+�2WP�.��.1W�(�!�U��U��.�p��U����(�!�U�����.�����f�.��f�����g��.�(h��.�bth���.�+�2W�L.�" not found.
timgagliardi commented 1 year ago

Had the same issue and after a seemingly unrelated change everything is working fine. Maybe that also fixes it for you. See: https://github.com/timgagliardi/barotrauma-server/commit/bf677221147cc591ed8ace2c7d83ee6c5f5ef9f8

If I would have to guess, I would assume that ptedoractyl has an issue with the formated logs of barotrauma and somehow pauses the container while trying to process them.

I would assume this is not a problem of barotrauma.

jefvaia commented 1 year ago

I see you created a docker image. So when I use that docker image, it should work just fine? And btw. Pterodactyl uses so called "eggs". I don't know how to use custom docker images with Pterodactyl (or if it's even possible). Is there any way I could use that docker image in Pterodactyl or is it Docker only?

timgagliardi commented 1 year ago

I (more or less) followed these two guides to create a custom egg. To my knowledge Pterodactyl just uses docker in the background for the servers. The egg was created by a friend who hosts the server, so I can't describe it in detail.

Here would be the egg configuration the friend used (with the email address removed) https://gist.github.com/timgagliardi/41fcd8b6fb2c962aa869bd9cd77ba2f9

The Docs: https://pterodactyl.io/community/config/eggs/creating_a_custom_egg.html https://pterodactyl.io/community/config/eggs/creating_a_custom_image.html

Sean-Destefano commented 9 months ago

I was able to solve this while using this egg by modifying the startup command to add in the text transformation. ./DedicatedServer -batchmode 2>&1 | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g"

HEPOSHEIKKI commented 8 months ago

I am having this same issue in pufferpanel. This issue doesn't come up when connecting to the volume, running bash and then running ./DedicatedServer. In every other case, I get garbled text. Any fixes?

jefvaia commented 7 months ago

The issue I posted was mainly about poor performance, but it did mention the text spam. I have no experience with pufferpanel, but it sound like what @Sean-Destefano posted should be the fix for the text spam. If the performance is bad like I had, try either updating the server or, if possible, try using a different container. @timgagliardi posted one that should work (never tested it though).

If this still doesn't work, I can't help further because I'm no expert on Barotrauma's code or docker. Maybe try opening an issue on either the Barotrauma Github page (right here), or ask someone who knows pufferpanel about it.

I looked at pufferpanels documentation and it also doesn't show Barotrauma as a "Supported Game", so this is uncharted territory for me...

HEPOSHEIKKI commented 7 months ago

The issue I posted was mainly about poor performance, but it did mention the text spam. I have no experience with pufferpanel, but it sound like what @Sean-Destefano posted should be the fix for the text spam. If the performance is bad like I had, try either updating the server or, if possible, try using a different container. @timgagliardi posted one that should work (never tested it though).

If this still doesn't work, I can't help further because I'm no expert on Barotrauma's code or docker. Maybe try opening an issue on either the Barotrauma Github page (right here), or ask someone who knows pufferpanel about it.

I looked at pufferpanels documentation and it also doesn't show Barotrauma as a "Supported Game", so this is uncharted territory for me...

Leaving this here in case someone else stumbles upon this later, but the text spam can be fixed with this mod by evilfactory.