karafka | Ruby and Rails efficient Kafka processing framework | Stream Processing library
kandi X-RAY | karafka Summary
kandi X-RAY | karafka Summary
Framework used to simplify Apache Kafka based Ruby applications development. Karafka allows you to capture everything that happens in your systems in large scale, providing you with a seamless and stable core for consuming and processing this data, without having to focus on things that are not your business domain. Karafka not only handles incoming messages but also provides tools for building complex data-flow applications that receive and send messages.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Initialize the listener
- Validates that the response is received .
- Validates the message and raises an error message
- attempts to a topic .
- Initialize the consumer .
- Reloads the given loader .
- Reloads reloads .
- Get the consumer
- Dispatch the response .
- Issues a signal to notice .
karafka Key Features
karafka Examples and Code Snippets
Community Discussions
Trending Discussions on karafka
QUESTION
I am using karafka to read from a topic, and call an external service. Each call to external service takes roughly 300ms. And with 3 consumers (3 pods in the k8s) running in the consumer group, I expect to achieve 10 events per second. I see these loglines , which also confirm the 300ms expectation for processing each individual event. However, the overall throughput doesn't add up. Each karafka processes seems stuck for a long time between processing two batches of events.
Following instrumentation around the consume
method, implies that the consumer code itself is not taking time.
https://github.com/karafka/karafka/blob/master/lib/karafka/backends/inline.rb#L12
...ANSWER
Answered 2021-Jun-24 at 08:27There are a couple of problems you may be facing. It is a bit of a guessing from my side without more details but let's give it a shot.
From the Kafka perspectiveAre you sure you're evenly distributing data across partitions? Maybe it is eating up things from one partition?
What you wrote here:
INFO Inline processing of topic production.events with 8 messages took 2571 ms
This indicates that there was a batch of 8 processed altogether by a single consumer. This could indicate that the data is not distributed evenly.
From the performance perspectiveThere are two performance properties that can affect your understanding of how Karafka operates: throughput and latency.
- Throughput is the number of messages that can be processed in a given time
- Latency is the time it takes a message from the moment it was produced to it been processed.
As far as I understand, all messages are being produced. You could try playing with the Karafka settings, in particular this one: https://github.com/karafka/karafka/blob/83a9a5ba417317495556c3ebb4b53f1308c80fe0/lib/karafka/setup/config.rb#L114
From the logger perspectiveLogger that is being used flushes data from time to time, so you won't see it immediately but after a bit of time. You can validate this by looking at the log time.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install karafka
Kafka on Rails: Using Kafka with Ruby on Rails – Part 1 – Kafka basics and its advantages
Kafka on Rails: Using Kafka with Ruby on Rails – Part 2 – Getting started with Ruby and Kafka
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page