#!/bin/bash # Get the maximum allowable number of open files per process on the host nr_open=`sysctl fs.nr_open | cut -d' ' -f3` # Ensure it's large enough; for 2^20 clients, the client simulator # process will need two file descriptors per client (one socket to # its ingestion server and one to its storage server), plus a handful # that don't depend on the number of clients (logfiles, etc.) needed_nr_open=$(((1<<21) + 10)) if [ $nr_open -lt $needed_nr_open ]; then echo "sysctl fs.nr_open is too low: currently $nr_open; needed $needed_nr_open" >&2 exit 1 fi # The SYS_NICE capability allows you to use numactl to pin processes to # NUMA nodes and/or individual cores docker run -d --cap-add SYS_NICE --rm --device /dev/sgx_enclave \ --device /dev/sgx_provision --name ${TEEMS_DOCKER_PREFIX}teems \ --ulimit nofile=${needed_nr_open}:${needed_nr_open} \ -h ${TEEMS_DOCKER_PREFIX}teems -t ${TEEMS_DOCKER_PREFIX}teems bash