forked from lightningnetwork/lnd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b8ff827
commit 4ec8326
Showing
3 changed files
with
110 additions
and
23 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
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,29 @@ | ||
#!/bin/bash | ||
|
||
# Get all the variables. | ||
PROCESSES=$1 | ||
TRANCHES=$2 | ||
SHUFFLE_SEED=$3 | ||
|
||
|
||
# Remove a previous postgres instance if it exists. | ||
containers = $(docker ps --filter name=lnd-postgres* -aq) | ||
docker rm containers --force --volumes || echo "Starting new postgres container" | ||
|
||
# Start a fresh postgres instance. Allow a maximum of 500 connections so that | ||
# multiple lnd instances with a maximum number of connections of 20 each can | ||
# run concurrently. Note that many of the settings here are specifically for | ||
# integration testing and are not fit for running production nodes. The | ||
# increase in max connections ensures that there are enough entries allocated | ||
# for the RWConflictPool to allow multiple conflicting transactions to track | ||
# serialization conflicts. The increase in predicate locks and locks per | ||
# transaction is to allow the queries to lock individual rows instead of entire | ||
# tables, helping reduce serialization conflicts. Disabling sequential scan for | ||
# small tables also helps prevent serialization conflicts by ensuring lookups | ||
# lock only relevant rows in the index rather than the entire table. | ||
docker run --name lnd-postgres -e POSTGRES_PASSWORD=postgres -p 6432:5432 -d postgres:13-alpine -N 1500 -c max_pred_locks_per_transaction=1024 -c max_locks_per_transaction=128 -c enable_seqscan=off | ||
docker logs -f lnd-postgres >itest/postgres.log 2>&1 & | ||
|
||
# Wait for the instance to be started. | ||
sleep $(POSTGRES_START_DELAY) | ||
|