Leveldb can only run at single process.

why Ethereum can run p2p, create block, rpc server at the same time, and the leveldb no lock?


2 Answers 2


All the modules you mention: p2p, blocks, rpc, etc, are executed inside a unique process: geth.

Inside geth the different modules have access to leveldb synchronized through mutexes and other synchronization primitives like locks.


When you run a key-value-store like levelDb, the bottleneck is not the CPU-usage but the disc-IO. So it does not matter if you use 1 or more processes to handle the sets and gets, but mostly the speed of the hard-drive is relevant.

  • This doesn't answer how geth access to leveldb.
    – Ismael
    Commented Jul 28, 2018 at 2:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.