Merge pull request #2112 from influxdb/gomaxprocs

Set GOMAXPROCS.
pull/2114/head
Paul Dix 2015-03-29 19:08:17 -04:00
commit 5d905b91b2
2 changed files with 9 additions and 2 deletions

View File

@ -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

View File

@ -38,6 +38,8 @@ 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.
@ -45,6 +47,10 @@ func main() {
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:]
@ -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.