Skip to content

Instantly share code, notes, and snippets.

@jarifibrahim
Created January 9, 2019 13:26
Show Gist options
  • Save jarifibrahim/76def0939fb82b01897df2e3355f6f46 to your computer and use it in GitHub Desktop.
Save jarifibrahim/76def0939fb82b01897df2e3355f6f46 to your computer and use it in GitHub Desktop.
Launcher backend failure
#! /bin/bash
set +x
pid=$(pidof "java")
# Let's bombard the server with reindex requests
for i in {1..15}
do
# Using random sleep time
sleep .0$[ ( $RANDOM % 10 ) + 2]s
curl -H "Content-Type: application/json" -X POST -d '{}' "http://localhost:8080/api/booster-catalog/reindex?token=abc"
done
# Wait for 10s so that all the requests are processed
sleep 10s
echo "Number of open files -" $(ls -l /proc/$pid/fd | wc -l)
echo "System limit on number of open files -" $(ulimit -Hn)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment