This commit is contained in:
openoms 2022-05-17 15:18:30 +01:00 committed by GitHub
parent e6fa69ee03
commit c0b601a95b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 68 additions and 4 deletions

View File

@ -4,6 +4,7 @@
- New: WebUI
- New: BackendAPI
- New: ZRAM - compressed swap in memory [details](https://github.com/rootzoll/raspiblitz/issues/2905)
- New: Core Lightning GRPC plugin [details](https://github.com/rootzoll/raspiblitz/pull/3109)
- Update: Bitcoin Core v23.0 [details](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-23.0.md)
- Update: Core Lightning (CLN - formerly C-lightning) v0.11.0.1 [details](https://github.com/ElementsProject/lightning/releases/tag/v0.11.0.1)

View File

@ -66,7 +66,7 @@ echo "deprecatedrpc=addresses" >> /mnt/hdd/bitcoin/bitcoin.conf 2>/dev/null
# backup SSH PubKeys
/home/admin/config.scripts/blitz.ssh.sh backup
# optimze mempool if RAM >1GB
# optimize mempool if RAM >1GB
kbSizeRAM=$(cat /proc/meminfo | grep "MemTotal" | sed 's/[^0-9]*//g')
if [ ${kbSizeRAM} -gt 1500000 ]; then
echo "Detected RAM >1GB --> optimizing ${network}.conf"
@ -77,6 +77,9 @@ if [ ${kbSizeRAM} -gt 3500000 ]; then
sed -i "s/^maxmempool=.*/maxmempool=300/g" /mnt/hdd/${network}/${network}.conf
fi
# zram on for all devices
/home/admin/config.scripts/blitz.zram.sh on
# link and copy HDD content into new OS on sd card
echo "Copy HDD content for user admin" >> ${logFile}
mkdir /home/admin/.${network} >> ${logFile} 2>&1

View File

@ -0,0 +1,60 @@
#!/bin/bash
# using https://github.com/foundObjects/zram-swap
VERSION="205ea1ec5b169f566e5e98ead794e9daf90cf245"
# command info
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo "config script to install ZRAM"
echo "blitz.zram.sh [on|off]"
echo "using https://github.com/foundObjects/zram-swap"
exit 1
fi
mkdir /home/admin/download 2>/dev/null
cd /home/admin/download || exit 1
if [ ! -d zram-swap ]; then
sudo -u admin git clone https://github.com/foundObjects/zram-swap.git
cd zram-swap || exit 1
git reset --hard $VERSION || exit 1
else
cd zram-swap || exit 1
fi
if [ "$1" = on ]; then
if [ $(sudo cat /proc/swaps | grep -c zram) -eq 0 ]; then
# install zram to 1/2 of RAM, activate and prioritize
sudo /home/admin/download/zram-swap/install.sh
# make better use of zram
echo "\
vm.vfs_cache_pressure=500
vm.swappiness=100
vm.dirty_background_ratio=1
vm.dirty_ratio=50
" | sudo tee -a /etc/sysctl.conf
# apply
sudo sysctl --system
echo "# ZRAM is installed and activated"
else
echo "# ZRAM was already installed and active."
fi
echo "Current swap usage:"
sudo cat /proc/swaps
exit 0
fi
if [ "$1" = off ]; then
sudo /home/admin/download/zram-swap/install.sh --uninstall
sudo rm /etc/default/zram-swap
sudo rm -rf /home/admin/download/zram-swap
echo "ZRAM was removed"
echo "Current swap usage:"
sudo cat /proc/swaps
exit 0
fi
echo "FAIL - Unknown Parameter $1"
exit 1

View File

@ -30,8 +30,8 @@ if [ "$1" = on ]; then
# ?wait until txindex finishes?
/home/admin/config.scripts/network.txindex.sh on
# ?activate zram?
# https://github.com/rootzoll/raspiblitz/issues/2905
# activate zram
/home/admin/config.scripts/blitz.zram.sh on
# rpcworkqueue=512
# rpcthreads=128
@ -115,7 +115,7 @@ db_mem=1024
db_max_open_files=200
fast-sync = 1024
# for 8GB RAM
# for 8GB RAM - use settings as for 4GB
#db_max_open_files=500
#fast-sync = 2048