mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
Added config item for queue_size
This commit is contained in:
parent
11239d6d19
commit
ed3ce1ac5e
1 changed files with 5 additions and 2 deletions
|
@ -26,6 +26,9 @@ class LogStash::Inputs::Udp < LogStash::Inputs::Base
|
||||||
|
|
||||||
# I/O workers
|
# I/O workers
|
||||||
config :workers, :validate => :number, :default => 2
|
config :workers, :validate => :number, :default => 2
|
||||||
|
|
||||||
|
# Queue depth
|
||||||
|
config :queue_size, :validate => :number, :default => 2000
|
||||||
|
|
||||||
public
|
public
|
||||||
def initialize(params)
|
def initialize(params)
|
||||||
|
@ -64,8 +67,8 @@ class LogStash::Inputs::Udp < LogStash::Inputs::Base
|
||||||
@udp = UDPSocket.new(Socket::AF_INET)
|
@udp = UDPSocket.new(Socket::AF_INET)
|
||||||
@udp.bind(@host, @port)
|
@udp.bind(@host, @port)
|
||||||
|
|
||||||
@input_to_worker = SizedQueue.new(20000)
|
@input_to_worker = SizedQueue.new(@queue_size)
|
||||||
@worker_to_output = SizedQueue.new(20000)
|
@worker_to_output = SizedQueue.new(@queue_size)
|
||||||
|
|
||||||
@input_workers = @workers.times do
|
@input_workers = @workers.times do
|
||||||
Thread.new { inputworker }
|
Thread.new { inputworker }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue