Page MenuHomeFeedback Tracker

Poor performance of Linux dedicated server due to 'mallinfo()' calls
Closed, ResolvedPublic

Description

Hey guys,

we've just installed a Linux dedicated server on an Ubuntu 12.04 (amd64) machine with Intel Xeon E3 (Quadcore with HT enabled, 8GB RAM) and encountered a very poor performance while, according to htop, one thread of 'arma3server' ate up one CPU.

Running 'perf top' with 'libc6-dbg:i386' installed shows that approx. 90% of total system activity take place in glibc's 'mallinfo()', even with no mods and missions loaded, no users connected.

Same after loading COOP missions, mods and connecting a single player.

Further investigations showed that arma3server really calls 'mallinfo()' very often, so it is unlikely that it's a 32bit related bug in Ubuntu's libc.

This bug effectively renders the Linux dedicated server unusable, so it would be good to fix this in a hotfix. {F23745} {F23746}

Details

Legacy ID
400423148
Severity
None
Resolution
Fixed
Reproducibility
Always
Category
Dedicated Server
Steps To Reproduce
  1. ./arma3server -port=2302 -config=serverconfig/server.cfg -name=foo -noSound -world=empty

Event Timeline

nics edited Steps To Reproduce. (Show Details)Apr 18 2014, 9:16 PM
nics edited Additional Information. (Show Details)
nics set Category to Dedicated Server.
nics set Reproducibility to Always.
nics set Severity to None.
nics set Resolution to Fixed.
nics set Legacy ID to 400423148.May 7 2016, 6:26 PM
nics added a comment.Apr 19 2014, 10:24 AM

I did another test:
in order to exclude 32bit-related integer overflow issues, I rerun the above test in a virtual 32bit Ubuntu 12.04 (i386) installation with only 2047MB of RAM attached.

Command line of 'arma3server':

./arma3server -port=2302 -config=serverconfig/server.cfg -name=foo -noSound -world=empty

Performance sampling commands:

  1. sudo perf record -p <arma3server_pid> sleep 10
  2. sudo perf report > perf_report_arma3server_virt_ubuntu1204_i386_2047MB.txt

Again, the same results: dominant activity in glibc's 'mallinfo()'.
I'll attach the output file 'perf_report_arma3server_virt_ubuntu1204_i386_2047MB.txt' to this issue.

nics added a comment.Apr 23 2014, 1:20 PM

btw, server version string seems to be "1.16.113494"

nics added a comment.Apr 28 2014, 1:15 PM

dazhbog: Glad this one got assingned.

Unfortunately, I can't link issues here, so be sure to have a look at
http://feedback.arma3.com/view.php?id=18556 which is somewhat related.

nics added a comment.May 5 2014, 12:21 PM

Since people start compiling their hand-tweaked LFS-glibc already (c.f. http://forums.bistudio.com/showthread.php?169926-Linux-Dedicated-Server-feedback/page18), I'll give you my far more easier solution which will work on any Linux and without glibc modifications:

  • Get the attached dummy_mallinfo.c.txt and rename it to dummy_mallinfo.c.
  • Turn it into a shared object by
  • gcc -shared -m32 -fPIC -o dummy_mallinfo.so dummy_mallinfo.c
  • Set the environment variable LD_LIBRARY_PATH to the _absolute_ directory containing that new dummy_mallinfo.so:
  • export LD_LIBRARY_PATH=/path/to/wherever/:"$LD_LIBRARY_PATH"
  • run arma3server by
  • LD_PRELOAD=dummy_mallinfo.so ./arma3server

This will replace glibc's costly mallinfo() with my nop-implementation at runtime.

k0rd added a subscriber: k0rd.May 7 2016, 6:26 PM
k0rd added a comment.May 5 2014, 1:48 PM

this is really awesome - I shared the link with the linux dedi server thread.

[edit] ICEMAN: can you please link this to 18556?

Iceman added a subscriber: Iceman.May 7 2016, 6:26 PM

Hello,
can you please confirm the fix on current version?
Thank you.

nics added a comment.Jun 23 2014, 6:18 PM

FIXED
Thank you.

How on earth do you download attachments? I'm trying to do Nics' fix for this issue, but clicking on the attachments above does nothing. I must be missing something obvious...

they have disabled the functionality..

Mass-closing all resolved issues not updated in the last month.

Please PM me in BI Forums (http://forums.bistudio.com/member.php?55374-Fireball) if you feel your bug was closed in error.