Permalink
Browse files

Set GOMAXPROCS to 128, to allow Go to achieve SSD disk I/O throughput.

  • Loading branch information...
manishrjain committed Jul 18, 2017
1 parent 7aed607 commit 30237a1429debab73eff38fea2f724914ca38b77
Showing with 5 additions and 0 deletions.
  1. +5 −0 cmd/dgraph/main.go
View
@@ -669,6 +669,11 @@ func setupServer(che chan error) {
func main() {
rand.Seed(time.Now().UnixNano())
// Setting a higher number here allows more disk I/O calls to be scheduled, hence considerably
// improving throughput. The extra CPU overhead is almost negligible in comparison. The
// benchmark notes are located in badger-bench/randread.
runtime.GOMAXPROCS(128)
setupConfigOpts()
x.Init() // flag.Parse is called here

2 comments on commit 30237a1

@linkerlin

This comment has been minimized.

Show comment
Hide comment
@linkerlin

linkerlin Aug 7, 2017

A very cool optimization!

linkerlin replied Aug 7, 2017

A very cool optimization!

@manishrjain

This comment has been minimized.

Show comment
Hide comment
@manishrjain
Member

manishrjain replied Aug 8, 2017

Thanks, @linkerlin.

Please sign in to comment.