zoukankan      html  css  js  c++  java
  • kafka生产者性能监控:Monitor Kafka Producer for Performance

    Introduction

    The producer sends data directly to the broker that is the leader for the partition without any intervening routing tier.

    Optimization Approach

    Batching is one of the big drivers of efficiency, and to enable batching the Kafka producer will attempt to accumulate data in memory and to send out larger batches in a single request. The batching can be configured to accumulate no more than a fixed number of messages and to wait no longer than some fixed latency bound (say 64k or 10 ms). This allows the accumulation of more bytes to send, and few larger I/O operations on the servers. This buffering is configurable and gives a mechanism to trade off a small amount of additional latency for better throughput.

    In order to find the optimal batch size and latency, iterative test supported by producer statistics monitoring is needed.

    Enable Monitoring

    Start the producer with the JMX parameters enabled:

    JMX_PORT=10102 bin/kafka-console-producer.sh --broker-list localhost:9092--topic testtopic

    Producer Metrics

    Use jconsole application via JMX at port number 10102.

    Tip: run jconsole application remotely to avoid impact on broker machine.

    See metrics in MBeans tab.

    10704-screen-shot-2016-12-22-at-85018-pm.png

    The<strong>clientId</strong>parameter is the producer client ID for which you want the statistics.

    <strong>kafka.producer:type=ProducerRequestMetrics,name=ProducerRequestRateAndTimeMs,clientId=console-producer</strong>

    This MBean give values for the rate of producer requests taking place as well as latencies involved in that process. It gives latencies as a mean, the 50th, 75th, 95th, 98th, 99th, and 99.9thlatency percentiles. It also gives the time taken to produce the data as a mean, one minute average, five minute average, and fifteen minute average. It gives the count as well.

    <strong>kafka.producer:type=ProducerRequestMetrics,name=ProducerRequestSize,clientId=console-producer</strong>

    This MBean gives the request size for the producer. It gives the count, mean, max, min, standard deviation, and the 50th, 75th, 95th, 98th, 99th, and 99.9thpercentile of request sizes.

    <strong>kafka.producer:type=ProducerStats,name=FailedSendsPerSec,clientId=console-producer</strong>

    This gives the number of failed sends per second. It gives this value of counts, the mean rate, one minute average, five minute average, and fifteen minute average value for the failed requests per second.

    <strong>kafka.producer:type=ProducerStats,name=SerializationErrorsPerSec,clientId=console-producer</strong>

    This gives the number of serialization errors per second. It gives this value of counts, mean rate, one minute average, five minute average, and fifteen minute average value for the serialization errors per second.

    <strong>kafka.producer:type=ProducerTopicMetrics,name=MessagesPerSec,clientId=console-producer</strong>

    This gives the number of messages produced per second. It gives this value of counts, mean rate, one-minute average, five-minute average, and fifteen-minute average for the messages produced per second.

    References

  • 相关阅读:
    暑假第一周总结
    洛谷P3378 【模板】堆 题解 堆(Heap)入门题
    洛谷P2170 选学霸 题解 并查集+01背包
    洛谷P1433 吃奶酪 题解 状态压缩DP
    洛谷P2835 刻录光盘 题解 点的度数+并查集
    洛谷P1991 无线通讯网 题解 并查集+二分答案
    洛谷P4185 [USACO18JAN]MooTube G 题解 并查集
    洛谷P4145 上帝造题的七分钟2 / 花神游历各国 题解 线段树+懒惰标记
    洛谷P2658 汽车拉力比赛 题解 二分答案+搜索
    洛谷P1546 最短网络 Agri-Net 题解 最小生成树/Prim算法
  • 原文地址:https://www.cnblogs.com/felixzh/p/12857607.html
Copyright © 2011-2022 走看看