Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restart and remap are too slow #86

Closed
zhaojkun opened this issue Mar 7, 2018 · 3 comments
Closed

Restart and remap are too slow #86

zhaojkun opened this issue Mar 7, 2018 · 3 comments

Comments

@zhaojkun
Copy link

zhaojkun commented Mar 7, 2018

prolems

We use bolt options like etcd

const initialMmapSize = 10 * 1024 * 1024 * 1024 // 10G
db, err := bolt.Open("my.db", 0600, &bolt.Options{
		MmapFlags:       syscall.MAP_POPULATE,
		InitialMmapSize: initialMmapSize,
})

Restart boltdb is very slow.From the system metrics there are lots of disk reads duration db restart. When open returns, all the db file will be in the page cache. From this, I guess all bytes of the db file may be read into memory.

When the memory cannot hold all the db file and some pages of the file has been swapped out, boltdb's remap will be also very slow.

Is there some methods to speed up boltdb's restart and remap

system

  • System memory : 96G
  • Disk: SATA HDD
  • DB File Size: >= 10G
@heyitsanthony
Copy link
Contributor

@zhaojkun try it without MAP_POPULATE...

@C-Otto
Copy link

C-Otto commented Dec 5, 2021

I don't know a lot about bbolt, but I know that in my setup reading the DB file into memory (using cat, basically) improves startup time a lot (factor >10x). Please have a look at the lnd issue linked above.

@zhaojkun zhaojkun closed this as completed Dec 7, 2021
@C-Otto
Copy link

C-Otto commented Dec 7, 2021

@zhaojkun could you please reopen (or explain why this is closed)?

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

No branches or pull requests

3 participants