will help you I've heard that under linux on multicore server it would be impossible to reach top performance when you have just 1 process but multiple threads because Linux have some limitations on the IO, so that 1 process with 8 threads on 8-core server might be slower than 8 processes. , Drawbacks of Threads Threads:
Share state between processes in different network namespaces
Does that help 32 processes in 32 network name spaces is already pretty significant, so I guess you want something serious and that can scale. Then I'd suggest you use a modern and scalable Linux IPC system.
Is there a programmatic way in C to determine the number of processes ever used in a group of processes under Linux?
314 * Copy credentials for the new process created by fork()
316 * We share if we can, but under some circumstances we have to generate a new
317 * set.
319 * The new process gets the current process's subjective credentials as its
320 * objective and subjective credentials
322 int copy_creds(struct task_struct *p, unsigned long clone_flags)
The maximum number of processes (or, more precisely on Linux,
threads) that can be created for the real user ID of the
calling process. Upon encountering this limit, fork(2) fails
with the error EAGAIN.
start an application with linux network namespaces using a bash function
wish helps you The key issue here is that sudo -u myuser -i starts a new shell session. Further commands, like cd /home, aren't run until in the shell session; instead, they're run after the shell session. Thus, you need to move startServer into the sudo command, instead of running it after the sudo command.
sudo ip netns exec controlnet sudo -u myuser bash -s <<'EOF'
local endTime startTime retval
while :; do
./hlds_run -game cstrike -pidfile ogp_game_startup.pid +map de_dust +ip 220.127.116.11 +port 27015 +maxplayers 14; retval=$?
if (( (endTime - startTime) > 15 )); then
echo "Server crashed with exit code $retval. Respawning..." >&2
echo "Server exited with status $retval after less than 15 seconds" >&2
echo " not attempting to respawn" >&2
cd /home/ || exit
List all Processes & Threads under processes from Linux core dump using gdb