strakh
(Strakh)
January 26, 2017, 1:08pm
1
I'm experiencing connection timeout sending bunches of requests to input http plugin (logstash v2.3.4).
strace shows that logstash listen call is made with backlog 50 which is default for jvm, while Puma::Server default is 1024.
It looks like the backlog parameter was lost during JRuby compilation process.
Here is strace output, and some links a found related to the issue.
[pid 38804] bind(43, {sa_family=AF_INET6, sin6_port=htons(8080), inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = 0
[pid 38804] listen(43, 50) = 0
# Using this input you can receive single or multiline events over http(s).
# Applications can send a HTTP POST request with a body to the endpoint started by this
# input and Logstash will convert it into an event for subsequent processing. Users
# can pass plain text, JSON, or any formatted data and use a corresponding codec with this
# input. For Content-Type `application/json` the `json` codec is used, but for all other
# data formats, `plain` codec is used.
#
# This input can also be used to receive webhook requests to integrate with other services
# and applications. By taking advantage of the vast plugin ecosystem available in Logstash
# you can trigger actionable events right from your application.
#
# ==== Security
# This plugin supports standard HTTP basic authentication headers to identify the requester.
# You can pass in an username, password combination while sending data to this input
#
# You can also setup SSL and send data securely over https, with an option of validating
# the client's certificate. Currently, the certificate setup is through
# https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html[Java Keystore
# format]
#
class LogStash::Inputs::Http < LogStash::Inputs::Base
env_hash['LISTEN_FDS'].to_i.times do |index|
sock = TCPServer.for_fd(socket_activation_fd(index))
key = begin # Try to parse as a path
[:unix, Socket.unpack_sockaddr_un(sock.getsockname)]
rescue ArgumentError # Try to parse as a port/ip
port, addr = Socket.unpack_sockaddr_in(sock.getsockname)
addr = "[#{addr}]" if addr&.include? ':'
[:tcp, addr, port]
end
@activated_sockets[key] = sock
@log_writer.debug "Registered #{key.join ':'} for activation from LISTEN_FDS"
end
["LISTEN_FDS", "LISTEN_PID"] # Signal to remove these keys from ENV
end
# Synthesize binds from systemd socket activation
#
# When systemd socket activation is enabled, it can be tedious to keep the
# binds in sync. This method can synthesize any binds based on the received
# activated sockets. Any existing matching binds will be respected.
#
system
(system)
Closed
February 23, 2017, 1:08pm
2
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.