Giter Club home page Giter Club logo

Comments (3)

josepowera avatar josepowera commented on July 19, 2024

We are java shop, however we're brainstorming some ideas... Could it be, that kafka sends too many records to consumer in one consumer request (that would explain -why problem only occurs when we have a big backlog of messages to process in kafka)

In java could limit Kafka consumer with
properties.put(ConsumerConfig.MAX_POLL_RECORDS_CONFIG,MAXKAFKAFETCH);

Now checking if something similar could be done in go.

https://godoc.org/github.com/Shopify/sarama#Config
// The maximum number of message bytes to fetch from the broker in a
// single request. Messages larger than this will return
// ErrMessageTooLarge and will not be consumable, so you must be sure
// this is at least as large as your largest message. Defaults to 0
// (no limit). Similar to the JVM's fetch.message.max.bytes. The
// global sarama.MaxResponseSize still applies.
Max int32

from clickhouse_sinker.

sundy-li avatar sundy-li commented on July 19, 2024

I think the memory consumption problem may be here. https://github.com/housepower/clickhouse_sinker/blob/master/input/kafka.go#L72.

There is a big channel. Yet we can reduce this channel size, we make it be 1024 in production.
clickhouse_sinker still takes lots of memory because it must buffer the records to batch insert into ClickHouse. There are some ways to reduce the memory usage, such as use row binary format, but it throws the load to clickhouse server.

In our production env, 256GB machine * 36 instances of clickhouse_sinker and other services. It takes about 10% memory to consume 100 tasks.

image

I don't think it's a memory leak, the memory will not grow endless, it grows up to a cap limit.

from clickhouse_sinker.

josepowera avatar josepowera commented on July 19, 2024

Sorry.. No, it's was not a memory leak (continous memory grow). It was just excessive memory usage... However the fix that you commited helped us to cut down 2GB memory limit with OOM to 700MB.

That means this fix works and is great!

from clickhouse_sinker.

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.