MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
Linux lib for HL-based servers
Linux lib for HL-based servers
Posts: 90
Threads: 16
Joined: Nov 2009
Reputation:
0
02-10-2011, 03:34 AM
(This post was last modified: 02-10-2011, 03:34 AM by saintjimmygd .)
Can anyone make a linux library that loads in hlds_run or srcds_run via LD_PRELOAD and do the following :
Quote: -automatic bind hlds/srcds server to random cores (from cpu0 to cpu15)
-has a rule that will not bind more than 6 servers on one core
Can it be done ? Of cuorse, it would be great to be even more "inteligent", like knowing that it's wrong tu bind a hlds and srcds server to the same cpu core , or even more , knowing not to bind high slots servers on same core ...
I am willing to pay via paypal for something like this.
Thank you.
Posts: 226
Threads: 2
Joined: Aug 2009
Reputation:
1
Why don't you script it in bash? It's easier than writing the logic in C code.
Posts: 90
Threads: 16
Joined: Nov 2009
Reputation:
0
02-10-2011, 05:56 PM
(This post was last modified: 02-10-2011, 05:58 PM by saintjimmygd .)
Because the servers are started with GameCP .. so it's easier to load the lib directly into hlds_run / srcds_run .
And second reason is that i don't know how to script
Posts: 2,031
Threads: 27
Joined: Nov 2008
Reputation:
17
this is done much easier with a script. you could just change the srcds_run / hlds_run script to do this. if you want to try it on your own, I give you a hint: taskset or cset is the command to bind a process to a cpu.
Posts: 90
Threads: 16
Joined: Nov 2009
Reputation:
0
I know about taskset but the lib would have to be more complicated :
1.Auto detect numbers of cpu cores
2.Auto detect number of hlds/srcds servers on HDD
3.Auto bind maximum 6 hlds/srcds servers to one core
4.Don't bind hlds and srcds to the same cpu
5.Don't bind more than 3 hlds servers on one cpu that have > 22 slots
6.Don't bind more than 3 srcds servers on one cpu that have > 22 slots
It's hard to do such a lib that's why i said that i'm willing to pay.
Posts: 2,031
Threads: 27
Joined: Nov 2008
Reputation:
17
(02-10-2011, 08:29 PM) saintjimmygd Wrote: I know about taskset but the lib would have to be more complicated :
but this can be done in a shell script much easier...
Quote: 1.Auto detect numbers of cpu cores
Code:
NCPU=`cat /proc/cpuinfo | grep processor | wc -l`
Quote: 2.Auto detect number of hlds/srcds servers on HDD
depends on server layout. you can detect the number of running processes with:
Code:
NSRCDS=`ps ax | grep srcds_i686 | wc -l`
NHLDS=`ps ax | grep hlds_i686 | wc -l`
NSRV=$(( NSRCDS + NHLDS ))
Quote: 3.Auto bind maximum 6 hlds/srcds servers to one core
6 server per cpu? that's mad. nevertheless I would design the script to put a new server on the cpu with the lowest number of server currently running on. that is of course not so easy to do, but it doesn't get easier in a ld_preload lib. I would use:
Code:
cat /proc/<PID>/status | grep Cpus_allowed:
to find out the CPU a server process is running on.
Quote: 4.Don't bind hlds and srcds to the same cpu
don't run hlds and srcds on the same machine. binding them to different cpus does not make it better. only physical separation on different machines helps.
Quote: 5.Don't bind more than 3 hlds servers on one cpu that have > 22 slots
6.Don't bind more than 3 srcds servers on one cpu that have > 22 slots
finding out the number of slots can be done by analysing the command line quite easy in a shell script.
Quote: It's hard to do such a lib that's why i said that i'm willing to pay.
it's still easier to do it as a shell script. ld_preload is simply the wrong tool for this. it's like putting nails into a wall with a screw driver...
(I did not test all of the code above...)
Posts: 1
Threads: 0
Joined: Jul 2009
Reputation:
0
**COUGH**
Useless use of 'cat' spotted.
Posts: 226
Threads: 2
Joined: Aug 2009
Reputation:
1
Posts: 2,031
Threads: 27
Joined: Nov 2008
Reputation:
17
**COUGH**
trolls spotted.
Posts: 18
Threads: 0
Joined: Sep 2006
Reputation:
0
03-08-2011, 08:40 PM
(This post was last modified: 03-08-2011, 09:16 PM by DeaD_EyE .)
(02-27-2011, 05:15 PM) HiDef-Laws Wrote: **COUGH**
Useless use of 'cat' spotted.
Code:
NCPU=`cat /proc/cpuinfo | grep processor | wc -l`
NCPU=`grep processor /proc/cpuinfo | wc -l`
NCPU=`grep -c processor /proc/cpuinfo`
Quote: finding out the number of slots can be done by analysing the command line quite easy in a shell script.
Example:
Code:
#!/bin/bash
maxplayers() {
maxplayers=0
while [ $# -gt 0 ]; do
case "$1" in
"-maxplayers")
maxplayers=$2
break
;;
esac
shift
done
}
maxplayers $*
echo "-maxplayers = $maxplayers"
#do something with $maxplayers
./srcds_run $*
Users browsing this thread: 1 Guest(s)