start-docker 950 B

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