Skip to content

Commit

Permalink
Merge pull request #969 from urso/enh/cfg-maxprocs
Browse files Browse the repository at this point in the history
Add config option beat.max_procs
  • Loading branch information
andrewkroh committed Feb 11, 2016
2 parents ae30528 + e0e5c9e commit df6d71f
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 3 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
4 changes: 4 additions & 0 deletions filebeat/filebeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,10 @@ shipper:
# Internal queue size for single events in processing pipeline
#queue_size: 1000

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

# Configure local GeoIP database support.
# If no paths are not configured geoip is disabled.
#geoip:
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
4 changes: 4 additions & 0 deletions libbeat/etc/libbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ shipper:
# Internal queue size for single events in processing pipeline
#queue_size: 1000

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

# Configure local GeoIP database support.
# If no paths are not configured geoip is disabled.
#geoip:
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
9 changes: 6 additions & 3 deletions metricbeat/metricbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ metricbeat:
# expvar:
# period: 10s
apache:
hosts:
- "http://192.168.99.100/"
hosts: "http://127.0.0.1/"
metricsets:
status:
period: 1s
Expand Down Expand Up @@ -40,7 +39,7 @@ output:
# Scheme and port can be left out and will be set to the default (http and 9200)
# In case you specify and additional path, the scheme is required: http://localhost:9200/path
# IPv6 addresses should always be defined as: https://[2001:db8::1]:9200
hosts: ["192.168.99.100:9200"]
hosts: ["localhost:9200"]

# Optional protocol and basic auth credentials.
#protocol: "https"
Expand Down Expand Up @@ -231,6 +230,10 @@ shipper:
# Internal queue size for single events in processing pipeline
#queue_size: 1000

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

# Configure local GeoIP database support.
# If no paths are not configured geoip is disabled.
#geoip:
Expand Down
4 changes: 4 additions & 0 deletions packetbeat/packetbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,10 @@ shipper:
# Internal queue size for single events in processing pipeline
#queue_size: 1000

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

# Configure local GeoIP database support.
# If no paths are not configured geoip is disabled.
#geoip:
Expand Down
4 changes: 4 additions & 0 deletions topbeat/topbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ shipper:
# Internal queue size for single events in processing pipeline
#queue_size: 1000

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

# Configure local GeoIP database support.
# If no paths are not configured geoip is disabled.
#geoip:
Expand Down
4 changes: 4 additions & 0 deletions winlogbeat/winlogbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ shipper:
# Internal queue size for single events in processing pipeline
#queue_size: 1000

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

# Configure local GeoIP database support.
# If no paths are not configured geoip is disabled.
#geoip:
Expand Down

0 comments on commit df6d71f

Please sign in to comment.