Skip to content

Commit

Permalink
Merge pull request #2112 from influxdb/gomaxprocs
Browse files Browse the repository at this point in the history
Set GOMAXPROCS.
  • Loading branch information
pauldix committed Mar 29, 2015
2 parents caf3259 + b4b3996 commit 5d905b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
- [#2101](https://github.com/influxdb/influxdb/pull/2101): SHOW DATABASES should name returned series "databases".
- [#2104](https://github.com/influxdb/influxdb/pull/2104): Include NEQ when calculating field filters.

### Bugfixes
- [#2112](https://github.com/influxdb/influxdb/pull/2112): Set GOMAXPROCS on startup. This may have been causing extra leader elections, which would cause a number of other bugs or instability.

## v0.9.0-rc16 [2015-03-24]

### Features
Expand Down
8 changes: 6 additions & 2 deletions cmd/influxd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,19 @@ const (

func main() {
log.SetFlags(0)
log.SetPrefix(`[srvr] `)
log.SetFlags(log.LstdFlags)
rand.Seed(time.Now().UnixNano())

// If commit not set, make that clear.
if commit == "" {
commit = "unknown"
}

// Set parallelism.
runtime.GOMAXPROCS(runtime.NumCPU())
log.Printf("GOMAXPROCS set to %d", runtime.GOMAXPROCS(0))

// Shift binary name off argument list.
args := os.Args[1:]

Expand Down Expand Up @@ -113,8 +119,6 @@ func execRun(args []string) {

// Print sweet InfluxDB logo and write the process id to file.
fmt.Print(logo)
log.SetPrefix(`[srvr] `)
log.SetFlags(log.LstdFlags)
writePIDFile(*pidPath)

// Parse configuration file from disk.
Expand Down

0 comments on commit 5d905b9

Please sign in to comment.