Use ENV to control the server name of the servers run workers with.

export SERVER_NAME=myserver1

This way you can deploy separately and only end the processes of that server.

@return string|null
160885
public function buildServerString() {
		$serverName = env('SERVER_NAME') ?: gethostname();
		if (!$serverName) {
			$user = env('USER');
			$logName = env('LOGNAME');
			if ($user || $logName) {
				$serverName = $user . '@' . $logName;
			}
		}

		return $serverName ?: null;
	}
1268278
protected function getServerPhpConfig()
    {
        $phpConfig = [];

        // Ensure $_ENV is populated.
        $variables_order = ini_get('variables_order');
        if (strpos($variables_order, 'E') === false) {
            $phpConfig['variables_order'] = 'E' . $variables_order;
        }

        return $phpConfig;
    }
1333672
protected function findShell()
	{
		if (self::$shell)
		{
			return self::$shell;
		}

		$command = "/usr/bin/env %s -c 'echo Hello'";

		foreach (array('bash', 'zsh', 'ksh', 'csh') as $shell)
		{
			if (rtrim(shell_exec(sprintf($command, $shell))) === 'Hello')
			{
				self::$shell = $shell;

				return $shell;
			}
		}

		return null;
	}
523716
public function getProxyServer()
    {
        $proxy_options = $this->getOption(EnumRequestOption::PROXY_OPTIONS, []);
        return isset($proxy_options[EnumProxyOption::PROXY_SERVER]) ? $proxy_options[EnumProxyOption::PROXY_SERVER] : '';
    }
360896
public function detectEnvName()
    {
        // Detect from local env file
        if ($this->envFile && is_file($this->envFile)) {
            $this->name = require $this->envFile;
            if ($this->name) {
                return;
            }
        }

        // Return if env name is detected, or, or continue detecting by IP
        if ($this->detector && $this->name = call_user_func($this->detector)) {
            return;
        }

        // Executes in web server, like Apache, Nginx
        if (isset($this->server['SERVER_ADDR'])) {
            $ip = $this->server['SERVER_ADDR'];
            if (isset($this->ipMap[$ip])) {
                $this->name = $this->ipMap[$ip];
            } else {
                $this->name = 'prod';
            }
            return;
        }

        // Executes in CLI
        if (php_sapi_name() == 'cli' && $ips = $this->getServerIps()) {
            foreach ($ips as $ip) {
                if (isset($this->ipMap[$ip])) {
                    $this->name = $this->ipMap[$ip];
                    return;
                }
            }
        }

        $this->name = 'prod';
        return;
    }
594176
protected function getServerCommandLine()
    {
        $this->checkJar(self::$ngJarFile);
        $this->checkJar(self::$jarFile);

        $classPath = array(
            self::$ngJarFile,
            self::$jarFile,
        );

        // The command for the server that should show up in the process list
        $server = array(
            self::$javaExecutable,
            '-server',
            '-cp', implode(':', $classPath),
            self::NG_SERVER,
        );

        return $server;
    }
1343772
private function getShell()
    {
        if (null !== self::$shell) {
            return self::$shell;
        }

        self::$shell = false;

        if (file_exists('/usr/bin/env')) {
            // handle other OSs with bash/zsh/ksh/csh if available to hide the answer
            $test = "/usr/bin/env %s -c 'echo OK' 2> /dev/null";
            foreach (array('bash', 'zsh', 'ksh', 'csh') as $sh) {
                if ('OK' === rtrim(shell_exec(sprintf($test, $sh)))) {
                    self::$shell = $sh;
                    break;
                }
            }
        }

        return self::$shell;
    }
190165
public function getServerInfo()
    {
        // init empty variables (can be filled if exec is allowed)
        $iMemTotal = $iMemFree = $sCpuModelName = $sCpuModel = $sCpuFreq = $iCpuCores = null;

        // fill, if exec is allowed
        if ($this->isExecAllowed()) {
            $iCpuAmnt = $this->_getCpuAmount();
            $iCpuMhz = $this->_getCpuMhz();
            $iBogo = $this->_getBogoMips();
            $iMemTotal = $this->_getMemoryTotal();
            $iMemFree = $this->_getMemoryFree();
            $sCpuModelName = $this->_getCpuModel();
            $sCpuModel = $iCpuAmnt . 'x ' . $sCpuModelName;
            $sCpuFreq = $iCpuMhz . ' MHz';

            // prevent "division by zero" error
            if ($iBogo && $iCpuMhz) {
                $iCpuCores = $iBogo / $iCpuMhz;
            }
        }

        $aServerInfo = [
            'Server OS'     => @php_uname('s'),
            'VM'            => $this->_getVirtualizationSystem(),
            'PHP'           => $this->_getPhpVersion(),
            'MySQL'         => $this->_getMySqlServerInfo(),
            'Apache'        => $this->_getApacheVersion(),
            'Disk total'    => $this->_getDiskTotalSpace(),
            'Disk free'     => $this->_getDiskFreeSpace(),
            'Memory total'  => $iMemTotal,
            'Memory free'   => $iMemFree,
            'CPU Model'     => $sCpuModel,
            'CPU frequency' => $sCpuFreq,
            'CPU cores'     => round($iCpuCores, 0),
        ];

        return $aServerInfo;
    }
916397
public function getServerPort()
    {
        return isset($this->swooleRequest->server['SERVER_PORT']) ? (int) $this->swooleRequest->server['SERVER_PORT'] : null;
    }
697574
public static function detect(){

        $file = Composer::getRootPath('/app/config/env.php');

        if(is_file($file)) {
            $config = include $file;
        } else {
            $config = include dirname(__DIR__).'/../config/env.php';
        }

        if(defined('ZE_ENV')){

            return ZE_ENV;

        } elseif(isset($_SERVER['ZE_ENV'])){

            define('ZE_ENV', $_SERVER['ZE_ENV']);

            return ZE_ENV;

        } elseif(is_array($config)) {

            $env = 'production';

            foreach($config as $key => $value){
                if(is_callable($value) && $value instanceof \Closure && $value()){
                    $env = $key;
                } elseif(is_string($value)) {

                    if(preg_match('/\//i', $value)){
                        // Not the safest way !
                        if(preg_match($value, getenv('HTTP_HOST') )){
                            $env = $key;
                        }
                    } else {
                        if(preg_match('/'.$value.'/i', getenv('HTTP_HOST') )){
                            $env = $key;
                        }
                    }
                }
            }

            define('ZE_ENV', $env);

            return ZE_ENV;
        }
    }
1054254
private static function environment() {
	$environment = getenv('APP_ENV') ?: 'production';
	
	define('alsvanzelf\fem\ENVIRONMENT',  $environment);
	define('alsvanzelf\fem\ROOT_DIR',     realpath(__DIR__.'/../../../../').'/');
	define('alsvanzelf\fem\ROOT_DIR_APP', \alsvanzelf\fem\ROOT_DIR.'application/');
	define('alsvanzelf\fem\CLI',          (strpos(php_sapi_name(), 'cli') !== false || defined('STDIN')));
	
	if (constant('\alsvanzelf\fem\ENVIRONMENT') == false) {
		echo 'no environment set';
		exit;
	}
}
225182
public function getHost()
    {
        $host = $this->headers->get('HTTP_HOST');
        if ($host) {
            if (strpos($host, ':') !== false) {
                $hostParts = explode(':', $host);

                return $hostParts[0];
            }

            return $host;
        }

        return $this->env->get('SERVER_NAME');
    }
1282112
public static function getServerIP()
	{
		static $serverIP = null;
	
		if ($serverIP !== null) {
			return $serverIP;
		}
	
		if (isset($_SERVER)) {
			if (isset($_SERVER['SERVER_ADDR'])) {
				$serverIP = $_SERVER['SERVER_ADDR'];
			} else {
				$serverIP = '0.0.0.0';
			}
		} else {
			$serverIP = getenv('SERVER_ADDR');
		}
	
		return $serverIP;
	}
1287366
public function getProcessEnv() {
		if (file_exists($this->getPrivateKeyPath())) {
			// Key-pair is available, use it.
			$processEnv = array(
				'IDENT_KEY' => $this->getPrivateKeyPath(),
				'GIT_SSH' => BASE_PATH . "/deploynaut/git-deploy.sh"
			);
		} else {
			$processEnv = array();
		}
		$this->extend('updateProcessEnv', $processEnv);
		return $processEnv;
	}
51328
private static function get_process_env_variables() {
		// Ensure we're using the expected `wp` binary
		$bin_dir = getenv( 'WP_CLI_BIN_DIR' ) ?: realpath( __DIR__ . '/../../bin' );
		$vendor_dir = realpath( __DIR__ . '/../../vendor/bin' );
		$path_separator = Utils\is_windows() ? ';' : ':';
		$env = array(
			'PATH' =>  $bin_dir . $path_separator . $vendor_dir . $path_separator . getenv( 'PATH' ),
			'BEHAT_RUN' => 1,
			'HOME' => sys_get_temp_dir() . '/wp-cli-home',
		);
		if ( $config_path = getenv( 'WP_CLI_CONFIG_PATH' ) ) {
			$env['WP_CLI_CONFIG_PATH'] = $config_path;
		}
		if ( $term = getenv( 'TERM' ) ) {
			$env['TERM'] = $term;
		}
		if ( $php_args = getenv( 'WP_CLI_PHP_ARGS' ) ) {
			$env['WP_CLI_PHP_ARGS'] = $php_args;
		}
		if ( $php_used = getenv( 'WP_CLI_PHP_USED' ) ) {
			$env['WP_CLI_PHP_USED'] = $php_used;
		}
		if ( $php = getenv( 'WP_CLI_PHP' ) ) {
			$env['WP_CLI_PHP'] = $php;
		}
		if ( $travis_build_dir = getenv( 'TRAVIS_BUILD_DIR' ) ) {
			$env['TRAVIS_BUILD_DIR'] = $travis_build_dir;
		}
		if ( $github_token = getenv( 'GITHUB_TOKEN' ) ) {
			$env['GITHUB_TOKEN'] = $github_token;
		}
		return $env;
	}
896333
public function getServerFilename(): string
    {
        $MEDIA_DIRECTORY = $this->media->tree()->getPreference('MEDIA_DIRECTORY');

        if ($this->multimedia_file_refn === '' || $this->isExternal()) {
            // External image, or (in the case of corrupt GEDCOM data) no image at all
            return $this->multimedia_file_refn;
        }

        // Main image
        return WT_DATA_DIR . $MEDIA_DIRECTORY . $this->multimedia_file_refn;
    }
1044800
public function getOS()
    {
        // override the detection of the operation system
        // by checking for an env var and returning early
        if (isset($_ENV['PHANTOMJS_PLATFORM'])) {
            return strtolower($_ENV['PHANTOMJS_PLATFORM']);
        }

        if (isset($_SERVER['PHANTOMJS_PLATFORM'])) {
            return strtolower($_SERVER['PHANTOMJS_PLATFORM']);
        }

        $uname = strtolower(php_uname());

        if (strpos($uname, 'darwin') !== false ||
            strpos($uname, 'openbsd') !== false ||
            strpos($uname, 'freebsd') !== false
        ) {
            return 'macosx';
        } elseif (strpos($uname, 'win') !== false) {
            return 'windows';
        } elseif (strpos($uname, 'linux') !== false) {
            return 'linux';
        } else {
            return 'unknown';
        }
    }