Skip to content

Commit

Permalink
Add shipper.max_procs option
Browse files Browse the repository at this point in the history
  • Loading branch information
urso committed Feb 11, 2016
1 parent ae30528 commit d6fd331
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ https://github.com/elastic/beats/compare/v1.1.0...master[Check the HEAD diff]
- Add option to elasticsearch output to pass http parameters in index operations {issue}805[805]
- Improve logstash and elasticsearch backoff behavior. {pull}927[927]
- Add experimental Kafka output. {pull}942[942]
- Add config file option to configure GOMAXPROCS. {pull}969[969]

*Packetbeat*
- Change the DNS library used throughout the dns package to github.com/miekg/dns. {pull}803[803]
Expand Down
7 changes: 7 additions & 0 deletions libbeat/beat/beat.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ func (b *Beat) LoadConfig() error {

logp.Debug("beat", "Initializing output plugins")

if b.Config.Shipper.MaxProcs != nil {
maxProcs := *b.Config.Shipper.MaxProcs
if maxProcs > 0 {
runtime.GOMAXPROCS(maxProcs)
}
}

pub, err := publisher.New(b.Name, b.Config.Output, b.Config.Shipper)
if err != nil {
return fmt.Errorf("error Initialising publisher: %v\n", err)
Expand Down
5 changes: 5 additions & 0 deletions libbeat/docs/shipperconfig.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ value is 1000.

(DO NOT TOUCH) The internal queue size for bulk events in the processing pipeline. The default value is 0.

===== max_procs

Sets the maximum number of CPUs that can be executing simultaneously. The
default is the number of logical CPUs available in the system.

===== geoip.paths

This configuration option is currently used by Packetbeat only.
Expand Down
2 changes: 2 additions & 0 deletions libbeat/publisher/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ type ShipperConfig struct {
// internal publisher queue sizes
QueueSize *int `yaml:"queue_size"`
BulkQueueSize *int `yaml:"bulk_queue_size"`

MaxProcs *int `yaml:"max_procs"`
}

type Topology struct {
Expand Down

0 comments on commit d6fd331

Please sign in to comment.