openethereum / parity-ethereum

The fast, light, and robust client for Ethereum-like networks.
Other
6.83k stars 1.69k forks source link

Big memory difference between official build and official docker image #11735

Open palkeo opened 4 years ago

palkeo commented 4 years ago

Hey,

As explained on discord, I saw a big drop in memory when upgrading from parity 2.7.2 to openethereum 3.0.0, on docker alpine. I later tried your official build and the memory usage went back to something identical to parity 2.7.2.

I was able to reproduce it on two different servers. And it definitely seems related to whether I use your official docker image on alpine, or a normal ubuntu-based build like your official one.

I guessed it could be related to alpine using musl and ubuntu using glibc, but I have no data to back this up.

Here are the arguments passed to one of my node:

                  "--fat-db", "off",
                  "--cache-size-db", "5000",
                  "--cache-size-blocks", "256",
                  "--cache-size-state", "2000",                  
                  "--jsonrpc-server-threads", "8",
                  "--pruning", "fast",
                  "--tracing", "on",
                  "--mode", "active",                  
                  "--db-compaction", "ssd",           
                  "--no-serve-light",
                  "--no-periodic-snapshot",
                  "--tx-queue-size", "1024",
                  "--no-secretstore",
                  "--scale-verifiers",
                  "--no-persistent-txqueue",
                  "--no-download",

And some screenshots:

image

First server. The big drop is going from parity to openethereum 3.0.0 docker image (alpine). Then I used the openethereum official build (made on ubuntu) and it went back to consuming a lot of memory. And at the end I went back to openethereum docker image (alpine), and it dropped again.

image

Above is another server with a similar config. The drop happened when upgrading from parity 2.7.2 to openethereum 3.0.0 on docker alpine.

That's it, I though it would be worth investigating.

denisgranha commented 4 years ago

hi! so the first time you mentioned this issue in the discord channel I understood it in the opposite way.

So it actually uses less memory, that's interesting.

Please clarify me these things if possible:

  1. First screenshot refers both to docker images with the same chaindata, you just switched the docker versions but maintained the volumes where data is stored.
  2. Second screenshot you refer to a docker build and also a native binary for Ubuntu? how was the storage shared in this case?

Thank you for contributing with your tickets for a better client

palkeo commented 4 years ago

Yes, docker alpine does use less memory, which was surprising but in a good way!

  1. Yes, the chaindata is the same. (well, with the DB one-way upgrade when I switched from 2.7 to openethereum).
  2. It was the same chaindata directory again, that was mounted as a volume for docker.