mirror of
https://github.com/elastic/logstash.git
synced 2025-04-23 22:27:21 -04:00
Revert to use only a single worker by default on outputs
The move to auto-scale output workers was great in theory, but a lot of outputs just weren't built to support it well, they often used too many resources or had logical errors. Fixes #4904
This commit is contained in:
parent
92ba0bfb95
commit
1902353cfe
2 changed files with 4 additions and 6 deletions
|
@ -37,6 +37,8 @@ module LogStash; class Pipeline
|
|||
:config_str,
|
||||
:original_settings
|
||||
|
||||
DEFAULT_OUTPUT_WORKERS = 1
|
||||
|
||||
DEFAULT_SETTINGS = {
|
||||
:default_pipeline_workers => LogStash::Config::CpuCoreStrategy.maximum,
|
||||
:pipeline_batch_size => 125,
|
||||
|
@ -460,7 +462,7 @@ module LogStash; class Pipeline
|
|||
klass = LogStash::Plugin.lookup(plugin_type, name)
|
||||
|
||||
if plugin_type == "output"
|
||||
LogStash::OutputDelegator.new(@logger, klass, default_output_workers, pipeline_scoped_metric.namespace(:outputs), *args)
|
||||
LogStash::OutputDelegator.new(@logger, klass, DEFAULT_OUTPUT_WORKERS, pipeline_scoped_metric.namespace(:outputs), *args)
|
||||
elsif plugin_type == "filter"
|
||||
LogStash::FilterDelegator.new(@logger, klass, pipeline_scoped_metric.namespace(:filters), *args)
|
||||
else
|
||||
|
@ -468,10 +470,6 @@ module LogStash; class Pipeline
|
|||
end
|
||||
end
|
||||
|
||||
def default_output_workers
|
||||
@settings[:pipeline_workers] || @settings[:default_pipeline_workers]
|
||||
end
|
||||
|
||||
# for backward compatibility in devutils for the rspec helpers, this method is not used
|
||||
# in the pipeline anymore.
|
||||
def filter(event, &block)
|
||||
|
|
|
@ -226,7 +226,7 @@ describe LogStash::Pipeline do
|
|||
pipeline.run
|
||||
|
||||
expect(pipeline.outputs.size ).to eq(1)
|
||||
expect(pipeline.outputs.first.workers.size ).to eq(pipeline.default_output_workers)
|
||||
expect(pipeline.outputs.first.workers.size ).to eq(::LogStash::Pipeline::DEFAULT_OUTPUT_WORKERS)
|
||||
expect(pipeline.outputs.first.workers.first.num_closes ).to eq(1)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue