[ 
https://issues.apache.org/jira/browse/KAFKA-4432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15687106#comment-15687106
 ] 

ASF GitHub Bot commented on KAFKA-4432:
---------------------------------------

GitHub user SandeshKarkera opened a pull request:

    https://github.com/apache/kafka/pull/2158

    KAFKA-4432: Added support to supply custom message payloads to 
perf-producer script.

    Current implementation of ProducerPerformance creates static payload. This 
is not very useful in testing compression or when you want to test with 
production/custom payloads. So, we decided to add support for providing payload 
file as an input to producer perf test script.
    
    We made the following changes:
    1. Added support to provide a payload file which can have the list of 
payloads that you actually want to send.
    2. Moved payload generation inside the send loop for cases when payload 
file is provided.
    
    Following are the changes to how the producer-performance is evoked:
    1. You must provide "--record-size" or "--payload-file" but not both. This 
is because, record size cannot be guaranteed when you are using custom events.
      e.g. ./kafka-producer-perf-test.sh --topic test_topic --num-records 
100000 --producer-props bootstrap.servers=127.0.0.1:9092 acks=0 
buffer.memory=33554432 compression.type=gzip batch.size=10240 linger.ms=10 
--throughput -1 --payload-file ./test_payloads --payload-delimiter ,
    2. Earlier "--record-size" was a required config, now you must provide 
exactly one of "--record-size" or "--payload-file". Providing both will result 
in an error.
    3. Support for an additional parameter "--payload-delimiter" has been added 
which defaults to "\n"

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/SandeshKarkera/kafka PerfProducerChanges

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/kafka/pull/2158.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2158
    
----
commit af6c6d910ae3915c769ebac326ade329a724cda4
Author: Sandesh K <sandesh.kark...@flipkart.com>
Date:   2016-11-22T11:08:03Z

    KAFKA-4432: Added support to supply custom message payloads

commit df278060a04fa844f150f30ae534a310c47c0eb3
Author: Sandesh K <sandesh.kark...@flipkart.com>
Date:   2016-11-22T15:53:52Z

    KAFKA-4432: Fixed checkstyle issues

----


> ProducerPerformance.java : Add support to supply custom message payloads.
> -------------------------------------------------------------------------
>
>                 Key: KAFKA-4432
>                 URL: https://issues.apache.org/jira/browse/KAFKA-4432
>             Project: Kafka
>          Issue Type: Improvement
>            Reporter: Sandesh Karkera
>            Priority: Minor
>             Fix For: 0.10.2.0
>
>
> Currently, kafka-producer-perf-test.sh does not support supplying custom 
> payloads to read messages from. The payload generated is a static payload 
> which is not very useful when testing features like compression. 
> We can improve the ProducerPerformance.java to accept a "-payload-file" and 
> "-payload-delimiter"(optional) parameters instead of "-record-size". This 
> will enable to user to run performance tests using custom payloads. 
> Before every send, we'll pick up a random payload from the payload-file 
> provided. 
> -payload-file: Will consists of messages delimited by "-payload-delimiter". 
> -payload-delimiter: Takes a default value of "\n" if not specified.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to