dragonboat-example icon indicating copy to clipboard operation
dragonboat-example copied to clipboard

Minimizing Hello World example (disk space, ...)

Open jcalfee opened this issue 1 year ago • 0 comments

Could you please direct me on how I might adjust the Hello World to have a small but operational foot-print?

The most obvious thing was the 1.2 Gigs of disk space used by 4 nodes right after start-up. Each of the 4 nodes takes up over 250MB and that must be the reason why it give me a sluggish first-impression.

Maybe it is simply adding a few parameters here and re-compiling?

https://github.com/lni/dragonboat-example/blob/d343e50c89be131b0a6a3f27c1f2719dc9524ce6/helloworld/main.go#L156-L157

I'm not sure how to apply this though. It does not compile when I try these settings below in the config block above.

// GetTinyMemLogDBConfig returns a LogDB config aimed for minimizing memory
// size. When using the returned config, LogDB takes up to 256MBytes memory.
func GetTinyMemLogDBConfig() LogDBConfig {
	cfg := getDefaultLogDBConfig()
	cfg.KVWriteBufferSize = 4 * 1024 * 1024
	cfg.KVMaxWriteBufferNumber = 4
	return cfg
}

GetTinyMemLogDBConfig

Maybe add a link for this: "See GoDoc for all available options"

Thank you!

jcalfee avatar Aug 24 '24 13:08 jcalfee