Giter Site home page Giter Site logo

Back pressure handling document about gogstash HOT 3 OPEN

tsaikd avatar tsaikd commented on September 16, 2024
Back pressure handling document

from gogstash.

Comments (3)

tsaikd avatar tsaikd commented on September 16, 2024

Depends on olivere library configuration, you can check the details there.

My guess is it will retry by Backoff algorithm until some special status codes.

from gogstash.

helgeolav avatar helgeolav commented on September 16, 2024

If you look at https://github.com/tsaikd/gogstash/blob/master/output/elastic/outputelastic.go you will see the default parameters buffer sizes. This is used during normal operations.

In case of issues one of three things can happen.

  1. The message is not accepted and dropped.
  2. The message is declined and requed. By default, see line 21, it will retry messages where Elasticsearch returns with HTTP status codes 408, 429, 503, 507.
  3. The message is not delivered and remain in the queue.

From what I can see what will happen is that - over time under an error condition with new messages coming in - the output will consume all memory and gogstash will crash. I can't find anywhere that a message is dropped when not delivered. The parameter ExponentialBackoffMaxTimeout does not seem to drop messages over time.

I tested with two error conditions; Elasticsearch down and Elasticsearch in read-only mode (high watermark/disk util).

Should we discuss implementing some kind of backpressure mechanism where the output can pause the input. Many inputs can support this while others have issues with it.

from gogstash.

tsaikd avatar tsaikd commented on September 16, 2024

You can have many strategies for handling delivering errors, and in my opinion, an important thing for a logging system is keeping the logs integrity. If you drop messages somewhere, you might miss a chance to be notified for the unstable system state. Case by case, sometimes you may want to drop messages to prevent memory exhaustion.

from gogstash.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.