From 8977fb4c93f74eebd5d10fecca2eb154d7745254 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Mon, 20 May 2024 03:16:10 +0300 Subject: [PATCH] Adjust network buffer sizes --- install/install_binary.sh | 24 +++++++++++++++++++----- install/install_docker.sh | 23 +++++++++++++++++++---- install/install_quilibrium_service.sh | 14 ++++++++++++++ 3 files changed, 52 insertions(+), 9 deletions(-) diff --git a/install/install_binary.sh b/install/install_binary.sh index 4886a7c..e0bc66e 100644 --- a/install/install_binary.sh +++ b/install/install_binary.sh @@ -14,26 +14,40 @@ sleep 2 # Add a 2-second delay apt-get update apt-get upgrade -y -# Step 2:Download Ceremonyclient +# Step 2: Adjust network buffer sizes +echo "Adjusting network buffer sizes..." +if grep -q "^net.core.rmem_max=600000000$" /etc/sysctl.conf; then + echo "net.core.rmem_max=600000000 found inside /etc/sysctl.conf, skipping..." +else + echo -e "\n# Change made to increase buffer sizes for better network performance for ceremonyclient\nnet.core.rmem_max=600000000" | sudo tee -a /etc/sysctl.conf > /dev/null +fi +if grep -q "^net.core.wmem_max=600000000$" /etc/sysctl.conf; then + echo "net.core.wmem_max=600000000 found inside /etc/sysctl.conf, skipping..." +else + echo -e "\n# Change made to increase buffer sizes for better network performance for ceremonyclient\nnet.core.wmem_max=600000000" | sudo tee -a /etc/sysctl.conf > /dev/null +fi +sudo sysctl -p + +# Step 3:Download Ceremonyclient echo "Downloading Ceremonyclient" sleep 2 # Add a 2-second delay git clone https://github.com/QuilibriumNetwork/ceremonyclient.git cd ~/ceremonyclient/node -# Step 3:Download Binary +# Step 4:Download Binary echo "Downloading Binary" sleep 2 # Add a 2-second delay wget https://github.com/QuilibriumNetwork/ceremonyclient/releases/download/v1.4.17/node-1.4.17-linux-amd64.bin ls mv node*.bin node -# Step 4:Make the file executable +# Step 5:Make the file executable echo "Making the Binary executable" sleep 2 # Add a 2-second delay chmod +x node -# Step 5:Create Ceremonyclient Service +# Step 6:Create Ceremonyclient Service echo "Creating Ceremonyclient Service" sleep 2 # Add a 2-second delay sudo tee /lib/systemd/system/ceremonyclient.service > /dev/null < /dev/null +fi +if grep -q "^net.core.wmem_max=600000000$" /etc/sysctl.conf; then + echo "net.core.wmem_max=600000000 found inside /etc/sysctl.conf, skipping..." +else + echo -e "\n# Change made to increase buffer sizes for better network performance for ceremonyclient\nnet.core.wmem_max=600000000" | sudo tee -a /etc/sysctl.conf > /dev/null +fi +sudo sysctl -p + + +# Step 6:Download Ceremonyclient echo "Downloading Ceremonyclient" sleep 2 # Add a 2-second delay git clone https://github.com/QuilibriumNetwork/ceremonyclient.git cd ~/ceremonyclient -# Step 5:Build Docker Container +# Step 7:Build Docker Container echo "Building Ceremonyclient Container" sleep 2 # Add a 2-second delay docker build --build-arg GIT_COMMIT=$(git log -1 --format=%h) -t quilibrium -t quilibrium:1.4.17 . -# Step 5:Run Ceremonyclient Container +# Step 8:Run Ceremonyclient Container echo "Running Ceremonyclient Container" sleep 2 # Add a 2-second delay docker compose up -d -# Step 5:Logs Ceremonyclient Container +# Step 9:Logs Ceremonyclient Container echo "Welcome to Quilibrium Ceremonyclient" echo "CTRL + C to exit the logs." sleep 5 # Add a 5-second delay diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index 4c2faf9..03a4b73 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -14,6 +14,20 @@ sleep 2 # Add a 2-second delay apt-get update apt-get upgrade -y +# Step 2: Adjust network buffer sizes +echo "Adjusting network buffer sizes..." +if grep -q "^net.core.rmem_max=600000000$" /etc/sysctl.conf; then + echo "net.core.rmem_max=600000000 found inside /etc/sysctl.conf, skipping..." +else + echo -e "\n# Change made to increase buffer sizes for better network performance for ceremonyclient\nnet.core.rmem_max=600000000" | sudo tee -a /etc/sysctl.conf > /dev/null +fi +if grep -q "^net.core.wmem_max=600000000$" /etc/sysctl.conf; then + echo "net.core.wmem_max=600000000 found inside /etc/sysctl.conf, skipping..." +else + echo -e "\n# Change made to increase buffer sizes for better network performance for ceremonyclient\nnet.core.wmem_max=600000000" | sudo tee -a /etc/sysctl.conf > /dev/null +fi +sudo sysctl -p + # Installing Go 1.20.14 wget https://go.dev/dl/go1.20.14.linux-amd64.tar.gz