Skip to content

Commit fcbef24

Browse files
committed
Resolve 413 Payload Too Large
In particular AWS ElasticSearch often allows maximum 10MiB HTTP request payloads Fixes #785
1 parent 1be83ba commit fcbef24

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/logstash/outputs/elasticsearch/http_client.rb

+4-5
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,15 @@ module LogStash; module Outputs; class ElasticSearch;
1212
# there really isn't a good reason to configure it.
1313
#
1414
# The criteria used are:
15-
# 1. We need a number that's less than 100MiB because ES
16-
# won't accept bulks larger than that.
15+
# 1. We need a number that's less than 10MiB because ES is commonly
16+
# configured (particular in AWS Elasticsearch Service) to not
17+
# accept bulks larger than that.
1718
# 2. It must be large enough to amortize the connection constant
1819
# across multiple requests.
1920
# 3. It must be small enough that even if multiple threads hit this size
2021
# we won't use a lot of heap.
2122
#
22-
# We wound up agreeing that a number greater than 10 MiB and less than 100MiB
23-
# made sense. We picked one on the lowish side to not use too much heap.
24-
TARGET_BULK_BYTES = 20 * 1024 * 1024 # 20MiB
23+
TARGET_BULK_BYTES = 9 * 1024 * 1024 # 9MiB
2524

2625
class HttpClient
2726
attr_reader :client, :options, :logger, :pool, :action_count, :recv_count

0 commit comments

Comments
 (0)