start-unit.sh 508 B

1234567891011121314151617181920
  1. #!/usr/bin/env bash
  2. CORE_COUNT=$(nproc)
  3. sysctl -w net.core.somaxconn=65535
  4. sysctl -w net.ipv4.tcp_max_syn_backlog=65535
  5. ulimit -n 65535
  6. taskset -c 0-$(($CORE_COUNT-1)) unitd --no-daemon --control unix:/var/run/control.unit.sock &
  7. # unitd --no-daemon --control unix:/var/run/control.unit.sock &
  8. # wait UNIT started
  9. sleep 1
  10. # PUT configure
  11. curl -X PUT \
  12. --data-binary @unit-config.json \
  13. --unix-socket /var/run/control.unit.sock \
  14. http://localhost/config
  15. # Then keep the container alive
  16. wait