mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2026-03-01 04:28:51 +00:00
Allow configurable LevelDB options #1492
Labels
No labels
I1
I2
I3
I4
S1
S2
S3
S4
U0
U1
U2
U3
U3
U4
blocked
bug
bug
cli
compiler
config
config
consensus
dependencies
discussion
documentation
enhancement
epic
feature
go
good first issue
help wanted
neotest
network
oracle
performance
question
rpc
security
smartcontract
task
task
task
test
vm
wallet
windows
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neo-go#1492
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lock9 on GitHub (Mar 5, 2025).
Is your feature request related to a problem? Please describe.
The current configuration for LevelDB creates too many files. It's possible to decrease the number of files by changing the CompactionTableSize on LevelDB. The large amount of files has a negative impact on our IT infrastructure.
Describe the solution you'd like
Level DB has some parameters that can be tweaked, such as WriteBufferSize, BlockSize, BlockCacheCapacity, CompactionTableSize, CompactionL0Trigger, and OpenFilesCacheCapacity. These values should be configurable through the config file.
Describe alternatives you've considered
I've tried running 'db dump', but it takes a long time to complete.
Additional context
I've implemented this feature here, without any kind of test.
linkd-academy/neo-go@8ca4a311c0Result with 5GB CompactionTableSize (may not be ideal, 1 GB could be better):

Changing some parameters made it run faster on my macOS. My computer was barely usable during synchronization.
Don't forget to add labels!
enhancement@AnnaShaleva commented on GitHub (Mar 5, 2025):
Patches are always welcomed! Open a PR, and we'll review&merge eventually.
@fyfyrchik commented on GitHub (Mar 6, 2025):
Btw, boltdb also could also have some love.
There are
InitialMmapSizeandAllocSizewhich regulate how big the database is initially and how fast it grows.It may be important, because to grow a database we need to remap it, and we cannot remap if there is an existing session iterator, so all transactions hang. I have reproduced it multiple times in privnet scenario with heavy iterator usage.
With these 2 settings the probability of such event can be made much smaller.
neofs-node also used to configure
MaxBatchSizeandMaxBatchDelaybut I have found them not that useful for neo-go.