Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Smash eating up a lot of resources #169

Open
targetpool opened this issue May 1, 2021 · 5 comments
Open

Smash eating up a lot of resources #169

targetpool opened this issue May 1, 2021 · 5 comments

Comments

@targetpool
Copy link

Smash eating up more than 8 gigs of ram. Also runable pools comes back as 0. Kristijan, please take a look at this so we can finish install and release instructions.

@mmahut
Copy link
Member

mmahut commented May 1, 2021

This is probably related to #145

@ksaric
Copy link
Contributor

ksaric commented May 2, 2021

Smash eating up more than 8 gigs of ram. Also runable pools comes back as 0. Kristijan, please take a look at this so we can finish install and release instructions.

Smash is indeed eating up resources and I'm on it. But, as I already mentioned, the runnable pools have nothing to do with valid pools that you already have.
Also, you attached quite a bit more information in the email, so, please add that info here as well.

@ksaric
Copy link
Contributor

ksaric commented May 2, 2021

This is probably related to #145

Yes, I have already sent @targetpool that issue as a reference, I was able to test it on mainnet and over time it does build up quite a lot of resources. The catch here is that the memory usage increases incrementally, and there are no obvious memory leaks.
But I have a solution for this.

The short-term profiling:

smash_profiling

The long-term profiling:

smash-long-running

This is being addressed.

@targetpool
Copy link
Author

Christijan as you have requested, heres more info from our emails.

so this is what we did when we were building the SMASH server- Please take a look

as a first step we downloaded
curl -s https://github.com/input-output-hk/cardano-db-sync/raw/master/scripts/postgresql-setup.sh -o postgresql-setup.sh
curl https://hydra.iohk.io/build/6077812/download/1/cardano-db-sync-9.0.0-linux.tar.gz -o cardano-db-sync-9.0.0-linux.tar.gz
unpacked this cardano-db-sync-9.0.0-linux.tar.gz into ~/.local/bin/
and
cp postgresql-setup.sh ~/cnode/scripts/
chmod +x ~/cnode/scripts/postgresql-setup.sh

Then we tried to follow instructions on https://docs.cardano.org/projects/smash/en/latest/getting-started/how-to-install-smash.html - but really gathered bits and pieces. Here's what we came up with step by step:

sudo apt install libpq-dev postgresql
cd git/
git clone https://github.com/input-output-hk/smash
cd smash/
cabal update
cabal build smash
cabal install smash
cd ./dist-newstyle/build/x86_64-linux/ghc-8.10.2/smash-1.4.0/x/smash-exe/build/smash-exe/ #(for some reason we ended up with 1.4.0 and on hydra latest is 1.5.0)
cp smash-exe ~/.local/bin/
cd ~/cnode/
cd config/
vi pgpass
sudo systemctl status postgresql
sudo apt install postgresql-client
sudo -u postgres
sudo -i
psql -d smash
cd ../
PGPASSFILE=config/pgpass ./scripts/postgresql-setup.sh --createdb
SMASHPGPASSFILE=config/pgpass smash-exe run-migrations --mdir ../git/smash/schema
SMASHPGPASSFILE=config/pgpass smash-exe run-migrations --config ../git/smash/config/mainnet-config.yaml --mdir ../git/smash/schema
SMASHPGPASSFILE=config/pgpass smash-exe run-app-with-db-sync --config ../git/smash/config/mainnet-config.yaml --socket-path sockets/node.socket --schema-dir ../git/smash/schema/
mkdir state
SMASHPGPASSFILE=config/pgpass smash-exe run-app-with-db-sync --config ../git/smash/config/mainnet-config.yaml --socket-path sockets/node.socket --schema-dir ../git/smash/schema/ --state-dir state/
tmux
SMASHPGPASSFILE=config/pgpass smash-exe run-app-with-db-sync --config ../git/smash/config/mainnet-config.yaml --socket-path sockets/node.socket --schema-dir ../git/smash/schema/ --state-dir state/
cd cnode/
SMASHPGPASSFILE=config/pgpass smash-exe run-app-with-db-sync --config ../git/smash/config/mainnet-config.yaml --socket-path sockets/node.socket --schema-dir ../git/smash/schema/ --state-dir state/

Also for quite a while synch process was without errors and on the second day we noticed this.
image

Obviously there is an internet connection and this SMASH server is running on an active relay and that relay is working properly

@targetpool
Copy link
Author

Hi Kristijan,

Cardano relay node was using about 4.5gigs, when smash was synching we capped at 12.5 so about 7 gigs SMASH ate up. We did a git clone of the latest repository, that was last thursday or Friday- One thing that we noticed that it was compatible with 1.25.1 and we are now running 1.26.2
We checked today on hydra and saw that there were some developments (compatible with 1.26.0) but theres nothing there yet.
image (1)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants