-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3272 from QuivrHQ/release/load-test-kms
feat: load test KMS
- Loading branch information
Showing
14 changed files
with
604 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,8 @@ EXTERNAL_SUPABASE_URL=http://localhost:54321 | |
SUPABASE_SERVICE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU | ||
PG_DATABASE_URL=postgresql://postgres:[email protected]:54322/postgres | ||
PG_DATABASE_ASYNC_URL=postgresql+asyncpg://postgres:[email protected]:54322/postgres | ||
SQLALCHEMY_POOL_SIZE=10 | ||
SQLALCHEMY_MAX_POOL_OVERFLOW=0 | ||
JWT_SECRET_KEY=super-secret-jwt-token-with-at-least-32-characters-long | ||
AUTHENTICATE=true | ||
TELEMETRY_ENABLED=true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
# Function to handle cleanup on exit | ||
cleanup() { | ||
echo "Cleaning up..." | ||
# Stop Uvicorn server if running | ||
if [[ ! -z "$UVICORN_PID" ]]; then | ||
kill "$UVICORN_PID" | ||
wait "$UVICORN_PID" | ||
fi | ||
exit 0 | ||
} | ||
|
||
# Trap signals (like Ctrl+C, SIGTERM) to run the cleanup function | ||
#trap cleanup SIGINT SIGTERM | ||
|
||
# Reset and start Supabase | ||
supabase db reset && supabase stop && supabase start | ||
|
||
# Remove old benchmark data | ||
rm -f benchmarks/data.json | ||
|
||
# Load new data | ||
rye run python benchmarks/load_data.py | ||
|
||
# Start Uvicorn server in the background | ||
LOG_LEVEL=info rye run uvicorn quivr_api.main:app --log-level info --host 0.0.0.0 --port 5050 --workers 5 --loop uvloop & | ||
UVICORN_PID=$! | ||
|
||
# Wait a bit to ensure the server is running | ||
sleep 1 | ||
|
||
# Run Locust for benchmarking | ||
rye run locust -f benchmarks/locustfile_kms.py -H http://localhost:5050 | ||
|
||
# Wait for all background processes (including Uvicorn) to finish | ||
wait "$UVICORN_PID" |
Oops, something went wrong.