Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Understanding elasticsearch circuit_breaking_exception

I am trying to figure out why I am getting this error when indexing a document from a python web app.

The document in this case is a base64 encoded string of a file of size 10877 KB.

I post it to my web app, which then posts it via elasticsearch.py to my elastic instance.

My elastic instance throws an error:

    TransportError(429, 'circuit_breaking_exception', '[parent] Data                         
    too large, data for [<http_request>] would be 
    [1031753160/983.9mb], which is larger than the limit of 
    [986932838/941.2mb], real usage: [1002052432/955.6mb], new bytes 
    reserved: [29700728/28.3mb], usages [request=0/0b, 
    fielddata=0/0b, in_flight_requests=29700728/28.3mb, 
    accounting=202042/197.3kb]')

I am trying to understand why my 10877 KB file ends up at a size of 983mb as reported by elastic.

I understand that increasing the JVM max heap size may allow me to send bigger files, but I am more wondering why it appears the request size is 10x the size of what I am expecting.

like image 844
Liquidmetal Avatar asked Jan 25 '23 08:01

Liquidmetal


1 Answers

Let us see what we have here, step by step:

[parent] Data too large, data for [<http_request>]

gives the name of the circuit breaker

would be [1031753160/983.9mb], 

says, how the heap size will look, when the request would be executed

which is larger than the limit of [986932838/941.2mb],

tells us the current setting of the circuit breaker above

real usage: [1002052432/955.6mb],

this is the real usage of the heap

new bytes reserved: [29700728/28.3mb],

actually an estimatiom, what impact the request will have (the size of the data structures which needs to be created in order to process the request). Your ~10MB file will probably consume 28.3MB.

usages [
    request=0/0b, 
    fielddata=0/0b,
    in_flight_requests=29700728/28.3mb, 
    accounting=202042/197.3kb
]

This last line tells us how the estmation is being calculated.

like image 196
ibexit Avatar answered Jan 29 '23 08:01

ibexit