Jump to content
Sign in to follow this  
Dwarden

ARMA 2: Operation Arrowhead - Linux Server beta 1.60.89244

Recommended Posts

Download:

[url]ftp://downloads.bistudio.com/arma2.com/update/a2oa-server-1.60.89244.tar.bz2[/url]

mirror:

CRC32: 69A69711

MD5: F26F1051F4B23CBC84E804ED6BD6855F

SHA-1: 3BE23650D35BBBA90EB71ABB1C39F249F4E4A2C2

Newest fix: resolved long loading times

oldfer fix: resolved issue with "Failed to load TextureHeaderManager" , no need use -noTexHeaders commandline parameter!

Warning: This is 1.60 branch release, not MP compatible backward with 1.59 branch (1.59 client can't join)

Note that it requires Arma 2: Operation Arrowhead data to be updated to version 1.60 first in order to run properly.

Please provide us with feedback to this topic.

* this version brings linux in sync with actual windows server improvements and ai/mp fixes ...

Arma 2: Operation Arrowhead - Linux Standalone Server 1.60

===============================================================

Copyrigt © 2010 Bohemia Interactive Studio. All rights reserved.

For more information please visit

http//community.bistudio.com/wiki/ArmA:_Dedicated_Server"]http://community.bistudio.com/wiki/ArmA:_Dedicated_Server[/size[/url]]

Installation instructions:

==========================

1. Following programs must have been installed on your Linux-box:

tar, gcc. Optional: md5sum (for setup integrity check)

1a. On some verions of Linux (this was reported for RedHat 9

and Gentoo linux 2.4.20) the NSCD deamon must be installed to

run ArmA 2 server successfully. Caching of DNS would be sufficient.

2. Copy the whole "ArmA 2 Operation Arrowhead" directory from Windows

to some Linux-directory (arma2arrowhead). DON'T DO ANY DATA CONVERSIONS

(even "dos2unix" translation of text files is not necessary).

Example: you can use PKZIP (WinZip, PowerArchiver, etc.) on

Windows and "unzip" on Linux.

Don't use upper case letters in the ArmA2 directory name

(/home/bob/arma2arrowhead will be good, /home/bob/ArmA2ArrowHead

may cause some troubles).

ArmA2 directory should contain subdirectories "Addons", "Bin",

"Campaigns", etc.

3. Copy the "server-x.xx.tar.gz" (x.xx is version number) file into

the arma2arrowhead directory. Unpack and install it with commands:

arma2arrowhead$ tar -xjf server-x.xx.tar.bz2

arma2arrowhead$ ./install

Watch the messages - they will inform you whether your installation

is successful.

4. Dedicated server can be started in foreground:

arma2arrowhead$ ./server

Or in background:

o$ nohup ./server > out.txt 2> err.txt &

[1] <pid>

5. Running server can be stopped by executing:

$ kill -s SIGINT <pid>

Where <pid> is process-id of mother server thread (printed out in

"nohup" command).

6. ArmA2 ArrowHead server has a feature: command-line parameter

"-pid=<pid_file>". It causes creation of <pid_file> with

PID of root ArmA2 process. If IP port specified in "-port=<nn>"

parameter is busy (in usage), ArmA2 will terminate immediately

and <pid_file> won't be written..

7. The "arma2server" script is provided for automatic server

start/restart/status query/etc. Please be sure to edit

CONFIGURATION PARAMETERS in lines 12 to 18 !

After this is done, install (hard-link?) the script into

"/etc/rc.d/init.d/arma2server" file. After that it can be managed

by "chkconfig" (see info/man).

previous thread about 1.60.88775 beta linux :

Edited by Dwarden

Share this post


Link to post
Share on other sites
Oh, that was fast, thank you! :)

//Soppa

we actually thank You, sir!

got more tricks in pockets?

Share this post


Link to post
Share on other sites

Just updated server, seems it didn't help.

[armasrv]$ date;./server

Thu Feb 9 19:37:12 EET 2012

19:45:17 Dedicated host created.

19:45:20 BattlEye Server: Initialized (v1.126)

19:45:20 Host identity created.

ArmA 2 OA Console version 1.60 : port 2302 - Sockets

Still takes roughly 8min :butbut:

When I hexedit from file offset F90CB0

69C3E8030000 -> 69C3D0070000

[armasrv]$ date;./server

Thu Feb 9 19:57:23 EET 2012

19:57:30 Dedicated host created.

19:57:32 BattlEye Server: Initialized (v1.126)

19:57:32 Host identity created.

ArmA 2 OA Console version 1.60 : port 2302 - Sockets

NOTE: for others, do not use this hexedit "fix" because I think it will cause some server FPS issues unless you revert memory value back to default after server has started. Its only meant to demonstrate that server will start up faster when you mess up with that function.

//Soppa

Edited by Soppa

Share this post


Link to post
Share on other sites

[Thu Feb  9 19:30:47 CET 2012] Starting server (port 2402)...
19:31:03 Dedicated host created.
19:31:04 Host identity created.
ArmA 2 OA Console version 1.60 : port 2402 - Sockets

I think I can wait 15 sec for server to start, can/is it be BE-related?

Share this post


Link to post
Share on other sites

Soppa do you have huge amount of missions on Your server or something very strange ? mods etc

Share this post


Link to post
Share on other sites
Soppa do you have huge amount of missions on Your server or something very strange ? mods etc

It has no effect if there is one or 40 missions. Also started without mods.

Had this same issue also with Poject Reality server which was running on different hardware but same distro.

I think it has nothing to do with mods or missions because if you just change that value, server starts very fast even there is ace + huge load of missions. Starting time only increases slightly.

Here is debug trace of process when I start server:

clock_gettime(CLOCK_REALTIME, {1328827299, 707267000}) = 0
futex(0x91fb460, FUTEX_WAKE_PRIVATE, 1) = 0
gettimeofday({1328827299, 707324}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1328827299, 707352000}) = 0
futex(0x91fb460, FUTEX_WAKE_PRIVATE, 1) = 0
gettimeofday({1328827299, 707408}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1328827299, 707435000}) = 0
futex(0x91fb460, FUTEX_WAKE_PRIVATE, 1) = 0
gettimeofday({1328827299, 707493}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1328827299, 707521000}) = 0
futex(0x91fb460, FUTEX_WAKE_PRIVATE, 1) = 0
gettimeofday({1328827299, 707582}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1328827299, 707626000}) = 0
futex(0x91fb460, FUTEX_WAKE_PRIVATE, 1) = 0
gettimeofday({1328827299, 707698}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1328827299, 707726000}) = 0
futex(0x91fb460, FUTEX_WAKE_PRIVATE, 1) = 0
gettimeofday({1328827299, 707783}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1328827299, 707811000}) = 0
futex(0x91fb460, FUTEX_WAKE_PRIVATE, 1) = 0
gettimeofday({1328827299, 707874}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1328827299, 707904000}) = 0
futex(0x91fb460, FUTEX_WAKE_PRIVATE, 1) = 0
gettimeofday({1328827299, 707962}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1328827299, 707989000}) = 0
futex(0x91fb460, FUTEX_WAKE_PRIVATE, 1) = 0
gettimeofday({1328827299, 708054}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1328827299, 708082000}) = 0
futex(0x91fb460, FUTEX_WAKE_PRIVATE, 1) = 0
gettimeofday({1328827299, 708143}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1328827299, 708171000}) = 0
futex(0x91fb460, FUTEX_WAKE_PRIVATE, 1) = 0
gettimeofday({1328827299, 708233}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1328827299, 708265000}) = 0
.
.
.

And as you can see its only checking system time in a loop :)

After 8 minutes here it gets out of that loop..

.
.
.
clock_gettime(CLOCK_REALTIME, {1328828140, 617841000}) = 0
futex(0xae41460, FUTEX_WAKE_PRIVATE, 1) = 0
gettimeofday({1328828140, 617902}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1328828140, 617933000}) = 0
futex(0xae41460, FUTEX_WAKE_PRIVATE, 1) = 0
gettimeofday({1328828140, 618000}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1328828140, 618031000}) = 0
futex(0xae41460, FUTEX_WAKE_PRIVATE, 1) = 0
gettimeofday({1328828140, 618093}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1328828140, 618123000}) = 0
futex(0xae41460, FUTEX_WAKE_PRIVATE, 1) = 0
gettimeofday({1328828140, 621993}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1328828140, 622036000}) = 0
futex(0xae41460, FUTEX_WAKE_PRIVATE, 1) = 0
gettimeofday({1328828140, 622100}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1328828140, 622131000}) = 0
futex(0xae41460, FUTEX_WAKE_PRIVATE, 1) = 0
gettimeofday({1328828140, 622193}, NULL) = 0
brk(0x18377000)                         = 0x18377000
brk(0x18398000)                         = 0x18398000
brk(0x183c5000)                         = 0x183c5000
gettimeofday({1328828140, 624976}, NULL) = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP) = 114
setsockopt(114, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
setsockopt(114, SOL_SOCKET, SO_RCVBUF, [65535], 4) = 0
setsockopt(114, SOL_IP, IP_MTU_DISCOVER, [0], 4) = 0
getsockopt(114, SOL_SOCKET, SO_RCVBUF, [17180000254], [4]) = 0
getsockopt(114, SOL_SOCKET, SO_SNDBUF, [562941363615744], [4]) = 0
bind(114, {sa_family=AF_INET, sin_port=htons(2304), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
gettimeofday({1328828140, 625480}, NULL) = 0
gettimeofday({1328828140, 625514}, NULL) = 0
uname({sys="Linux", node="olutta.org", ...}) = 0
open("/etc/resolv.conf", O_RDONLY)      = 115
fstat64(115, {st_mode=S_IFREG|0644, st_size=156, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xfffffffff7d52000

Here is full trace log if you are interested

http://olutta.org/arma2start.zip (its huge when unpacked, 153M)

//Soppa

Edited by Soppa

Share this post


Link to post
Share on other sites

gettimeofday({1328827299, 707324}, NULL) = 0
clock_gettime(CLOCK_REALTIME, {1328827299, 707352000}) = 0
futex(0x91fb460, FUTEX_WAKE_PRIVATE, 1) = 0

Here is full trace log if you are interested

http://olutta.org/arma2start.zip (its huge when unpacked, 153M)

//Soppa

Looks like CentOS specific problem. http://bugs.centos.org/view.php?id=3996

Edit: probably not CentOS specific. We would need to detect synchronization of what makes the server busy. Will try to prepare some linux server with multiple debugging opportunities for you...

Edited by Bebul

Share this post


Link to post
Share on other sites

It has shown to be somewhat hard. In fact, your hexedit hotfix is really surprising.

I have tried to use different implementation of Timeout calculation.

Soppa, can you try this version, please?

ftp://downloads.bistudio.com/arma2.com/update/a2oa-server-1.60.89343-testVer.tar.bz2

Backup your older version first, this one would be harder to hexedit

(different implementation, no 1000 multiplication), but who knows, it could fix your problem...

Share this post


Link to post
Share on other sites
It has shown to be somewhat hard. In fact, your hexedit hotfix is really surprising.

I have tried to use different implementation of Timeout calculation.

Soppa, can you try this version, please?

ftp://downloads.bistudio.com/arma2.com/update/a2oa-server-1.60.89343-testVer.tar.bz2

Backup your older version first, this one would be harder to hexedit

(different implementation, no 1000 multiplication), but who knows, it could fix your problem...

Sure, its my pleasure to help.

[armaoa]$ date;./server

Fri Feb 10 20:30:30 EET 2012

20:35:19 Dedicated host created.

20:35:23 BattlEye Server: Initialized (v1.126)

20:35:23 Host identity created.

ArmA 2 OA Console version 1.60 : port 2302 - Sockets

Hmm.. seems it actually did help a bit. Its been always +8 minutes and now it was roughly 5min.

Still some difference to "normal" ~20s loading time, but yes it was better now :)

//Soppa

Share this post


Link to post
Share on other sites

Hmm.. seems it actually did help a bit. Its been always +8 minutes and now it was roughly 5min.

Still some difference to "normal" ~20s loading time, but yes it was better now :)

//Soppa

Ok, still very bad. :(

Can you provide us the following, please?

1. check, using strace, there are clock_gettime instead of gettimeofday in new version (no need to wait until server starts, only check)

2. revert to older previous version (with gettimeofday in strace) and

a) start it with strace and count the number of gettimeofday inside the strace log

b) the same as in a) but hack it using your smart hotfix

The question is, how much the counts of gettimeofday differs in a) vs b) ?

Share this post


Link to post
Share on other sites

1) Correct, its now using clock_gettime

futex(0xafe8464, FUTEX_WAKE_PRIVATE, 1) = 0
clock_gettime(CLOCK_MONOTONIC, {2047517, 305024104}) = 0
clock_gettime(CLOCK_MONOTONIC, {2047517, 305051104}) = 0
futex(0xafe8464, FUTEX_WAKE_PRIVATE, 1) = 0
clock_gettime(CLOCK_MONOTONIC, {2047517, 305107104}) = 0
clock_gettime(CLOCK_MONOTONIC, {2047517, 305139104}) = 0
futex(0xafe8464, FUTEX_WAKE_PRIVATE, 1) = 0
clock_gettime(CLOCK_MONOTONIC, {2047517, 305202104}) = 0
clock_gettime(CLOCK_MONOTONIC, {2047517, 305230104}) = 0
futex(0xafe8464, FUTEX_WAKE_PRIVATE, 1) = 0
clock_gettime(CLOCK_MONOTONIC, {2047517, 305287104}) = 0
clock_gettime(CLOCK_MONOTONIC, {2047517, 305315104}) = 0

2) Seems running through strace it starts pretty fast with stock binary also and patched takes longer than usually :O

PATCHED:

23:07:52 Start

23:09:07 Dedicated host created.

System call usage summary for 32 bit mode:
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
88.36    0.027498           0   1090135           gettimeofday
10.59    0.003297           0     17979       655 futex
 0.77    0.000239          17        14           getdents
 0.17    0.000052           0      1664           brk
 0.06    0.000020          10         2           waitpid
 0.05    0.000015           0       152       115 open
 0.00    0.000000           0        36           read
 0.00    0.000000           0         4           write
 0.00    0.000000           0        47           close
 0.00    0.000000           0         1         1 unlink
 0.00    0.000000           0         4           time
 0.00    0.000000           0         9         7 access
 0.00    0.000000           0         1           rename
 0.00    0.000000           0         1         1 mkdir
 0.00    0.000000           0         2           pipe
 0.00    0.000000           0         3           ioctl
 0.00    0.000000           0        22           munmap
 0.00    0.000000           0         1           sysinfo
 0.00    0.000000           0        12           clone
 0.00    0.000000           0        10           uname
 0.00    0.000000           0        23           mprotect
 0.00    0.000000           0         3           _llseek
 0.00    0.000000           0        81           select
 0.00    0.000000           0        39           nanosleep
 0.00    0.000000           0         4           poll
 0.00    0.000000           0         3           rt_sigaction
 0.00    0.000000           0         1           rt_sigprocmask
 0.00    0.000000           0         3           getcwd
 0.00    0.000000           0         1           getrlimit
 0.00    0.000000           0        64           mmap2
 0.00    0.000000           0       248           stat64
 0.00    0.000000           0       149           fstat64
 0.00    0.000000           0        33           fcntl64
 0.00    0.000000           0         1           set_thread_area
 0.00    0.000000           0         1           set_tid_address
 0.00    0.000000           0       716           clock_gettime
 0.00    0.000000           0         1           set_robust_list
 0.00    0.000000           0         8           socket
 0.00    0.000000           0         3           bind
 0.00    0.000000           0         4         2 connect
 0.00    0.000000           0         2           send
 0.00    0.000000           0         2           sendto
 0.00    0.000000           0         3           recvfrom
 0.00    0.000000           0         7           setsockopt
 0.00    0.000000           0         4           getsockopt
------ ----------- ----------- --------- --------- ----------------
100.00    0.031121               1111503       781 total

UNPATCHED:

23:06:18 Start

23:07:34 Dedicated host created.

System call usage summary for 32 bit mode:
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
35.16    0.027157           0   1082805           futex
32.41    0.025037           0   1069472           clock_gettime
32.03    0.024739           0   1097261           gettimeofday
 0.18    0.000136          10        13           getdents
 0.10    0.000076           0      1664           brk
 0.07    0.000053           0       152       115 open
 0.03    0.000021          11         2           waitpid
 0.02    0.000017           1        22           munmap
 0.02    0.000012           0       248           stat64
 0.00    0.000000           0        36           read
 0.00    0.000000           0         4           write
 0.00    0.000000           0        47           close
 0.00    0.000000           0         1         1 unlink
 0.00    0.000000           0         4           time
 0.00    0.000000           0         9         7 access
 0.00    0.000000           0         1         1 mkdir
 0.00    0.000000           0         2           pipe
 0.00    0.000000           0         3           ioctl
 0.00    0.000000           0         1           sysinfo
 0.00    0.000000           0        12           clone
 0.00    0.000000           0        10           uname
 0.00    0.000000           0        23           mprotect
 0.00    0.000000           0         3           _llseek
 0.00    0.000000           0       268           select
 0.00    0.000000           0        37           nanosleep
 0.00    0.000000           0         4           poll
 0.00    0.000000           0         3           rt_sigaction
 0.00    0.000000           0         1           rt_sigprocmask
 0.00    0.000000           0         3           getcwd
 0.00    0.000000           0         1           getrlimit
 0.00    0.000000           0        64           mmap2
 0.00    0.000000           0       149           fstat64
 0.00    0.000000           0        33           fcntl64
 0.00    0.000000           0         1           set_thread_area
 0.00    0.000000           0         1           set_tid_address
 0.00    0.000000           0         1           set_robust_list
 0.00    0.000000           0         8           socket
 0.00    0.000000           0         3           bind
 0.00    0.000000           0         4         2 connect
 0.00    0.000000           0         2           send
 0.00    0.000000           0         2           sendto
 0.00    0.000000           0         3           recvfrom
 0.00    0.000000           0         7           setsockopt
 0.00    0.000000           0         4           getsockopt
------ ----------- ----------- --------- --------- ----------------
100.00    0.077248               3252394       126 total

Edited by Soppa

Share this post


Link to post
Share on other sites

2) Seems running through strace it starts pretty fast with stock binary also and patched takes longer than usually :O

PATCHED:

23:07:52 Start

23:09:07 Dedicated host created.

UNPATCHED:

23:06:18 Start

23:07:34 Dedicated host created.

Are you sure? Looks like both are running almost the same time.

FYI, your PATCH changes the following function:

   struct timespec *CalcTimeout(unsigned long timeout,struct timespec &ts)
   {
     if (timeout==(unsigned long)-1) return NULL;
     struct timeval now;
     gettimeofday(&now, NULL);
     unsigned long usec = now.tv_usec + timeout%1000*1000; 
     ts.tv_sec = (now.tv_sec + timeout / 1000) + usec / 1000000;
     ts.tv_nsec = usec % 1000000 * 1000;   //<-- you change it to ...*2000; in your PATCH
     return &ts;
   }

The return value is used for thread synchronization purposes through pthread_cond_timedwait.

So ts.tv_nsec is set from the fraction of second to the twice of its original value!

Any ideas why it can make the two competing threads run faster?

Edit: I am convinced this CalcTimeout is called mostly with timeout=0, which can be interpreted as pthread_cond_timedwait should return immediately. But after your patch, it would typically wait little or longer. I suppose both clock_gettime and futex are called from pthread_cond_timedwait and to tell the truth I am confused their calls counts are so low...

Edited by Bebul

Share this post


Link to post
Share on other sites
Are you sure? Looks like both are running almost the same time.

FYI, your PATCH changes the following function:

What I meant was that when running patched version through strace, it takes longer than it does without strace.

23:50:15 Start without strace (patched version)

23:50:24 Dedicated host created.

^ Running it through strace is taking server longer to start.

And using strace makes unpatched version starting faster O.o

Could this has something to do with high resolution timers because they were introduced on 2.6.21 and we are using 2.6.18 kernel which is using jiffies?

cat /sys/devices/system/clocksource/clocksource0/current_clocksource

jiffies

//Soppa

Edited by Soppa

Share this post


Link to post
Share on other sites

I've seen this exact behaviour before with very similar code (tight looping in pthread_cond_timewait) and don't remember the exact solution. I do know that a reboot or various service restarts (sighup various daemons such as syslogd, etc.) fixed the problem. Also might be wise to get to 2.6.28 or later if you can...

Share this post


Link to post
Share on other sites

We like to stay with stock enterprise linux 5 kernel for several reasons and restarting system wont help with this.

Tried also to disable ntp if its messing with clock but didnt help.

Speedstep/scaling set to disable didnt help either.

From fixunix:

"You should use clock_gettime(CLOCK_MONOTONIC) instead of

gettimeofday() for interval timing. As soon as NTP software is

running, the result of gettimeofday() can jump forward or backward in

time. The result of clock_gettime() is guaranteed to be monotonic, and

additionally the resolution of clock_gettime() is higher than

gettimeofday() -- 1 ns instead of 1 us."

//Soppa

Edited by Soppa

Share this post


Link to post
Share on other sites

From fixunix:

"You should use clock_gettime(CLOCK_MONOTONIC) instead of

gettimeofday() for interval timing.

//Soppa

Would be nice to test once again, whether the change to CLOCK_MONOTONIC has helped at least a little (8min -> 5min).

Can you upload the huge strace log of PATCHED older version too?

The internet is full of clock_gettime + gettimeofday + futex looping, but I was not lucky to find any solution. So, probably, it is really some timing or race bug in linux engine code...

Share this post


Link to post
Share on other sites

PERFECT! Working good :)

[armasrv] date;./server

Mon Feb 13 11:48:27 EET 2012

11:48:39 Dedicated host created.

11:48:39 BattlEye Server: Initialized (v1.126)

11:48:39 Host identity created.

ArmA 2 OA Console version 1.60 : port 2302 - Sockets

//Soppa

Share this post


Link to post
Share on other sites
PERFECT! Working good :)

[armasrv] date;./server

Mon Feb 13 11:48:27 EET 2012

11:48:39 Dedicated host created.

11:48:39 BattlEye Server: Initialized (v1.126)

11:48:39 Host identity created.

ArmA 2 OA Console version 1.60 : port 2302 - Sockets

//Soppa

Looks like even 2 times faster compared to your patch ;-)

Share this post


Link to post
Share on other sites

Yes, very good job! And thanks for fixing this :)

//Soppa

Share this post


Link to post
Share on other sites
Yes, very good job! And thanks for fixing this :)

//Soppa

We should still wait whether everything would work as expected.

Was a pleasure to work with your fast and precise response, thank you.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×