Skip to content

Instantly share code, notes, and snippets.

@dheavy
Created April 21, 2024 21:42
Show Gist options
  • Save dheavy/8d7504ac0f4ed4b2a1f13c538ef8aa65 to your computer and use it in GitHub Desktop.
Save dheavy/8d7504ac0f4ed4b2a1f13c538ef8aa65 to your computer and use it in GitHub Desktop.
vespa-flyio-ulimit-shell
#!/bin/bash
# Try to set ulimits
ulimit -n 262144 || echo "Failed to set nofile limit"
ulimit -u 409600 || echo "Failed to set nproc limit"
ulimit -c unlimited || echo "Failed to set core limit"
# Start Vespa configuration server and services
if [ "$1" == "configserver" ]; then
echo "Starting Vespa Config Server..."
/opt/vespa/bin/vespa-start-configserver
elif [ "$1" == "services" ]; then
echo "Starting Vespa Services..."
/opt/vespa/bin/vespa-start-services
elif [ "$1" == "configserver,services" ]; then
echo "Starting Vespa Config Server and Services..."
/opt/vespa/bin/vespa-start-configserver && /opt/vespa/bin/vespa-start-services
else
echo "Allowed arguments to entrypoint are 'configserver', 'services' or 'configserver,services'."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment