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

Jason Gustafson commented on KAFKA-3135:
----------------------------------------

Interestingly, I can reproduce this pause even using the old consumer on 0.8.2 
if I change the receive buffer size to 32K (as is the default for the new 
consumer). Similarly, by changing the new consumer's receive buffer to 64K (as 
is the default for the old consumer), the problem seems to go away. This may be 
a viable workaround until the root cause is known. Note I have only tested this 
on my macbook (OS-X 10.10.5) with Oracle's jdk (1.8.0_65-b17).

> Unexpected delay before fetch response transmission
> ---------------------------------------------------
>
>                 Key: KAFKA-3135
>                 URL: https://issues.apache.org/jira/browse/KAFKA-3135
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.9.0.0
>            Reporter: Jason Gustafson
>            Assignee: Jason Gustafson
>
> From the user list, Krzysztof Ciesielski reports the following:
> {quote}
> Scenario description:
> First, a producer writes 500000 elements into a topic
> Then, a consumer starts to read, polling in a loop.
> When "max.partition.fetch.bytes" is set to a relatively small value, each
> "consumer.poll()" returns a batch of messages.
> If this value is left as default, the output tends to look like this:
> Poll returned 13793 elements
> Poll returned 13793 elements
> Poll returned 13793 elements
> Poll returned 13793 elements
> Poll returned 0 elements
> Poll returned 0 elements
> Poll returned 0 elements
> Poll returned 0 elements
> Poll returned 13793 elements
> Poll returned 13793 elements
> As we can see, there are weird "gaps" when poll returns 0 elements for some
> time. What is the reason for that? Maybe there are some good practices
> about setting "max.partition.fetch.bytes" which I don't follow?
> {quote}
> The gist to reproduce this problem is here: 
> https://gist.github.com/kciesielski/054bb4359a318aa17561.
> After some initial investigation, the delay appears to be in the server's 
> networking layer. Basically I see a delay of 5 seconds from the time that 
> Selector.send() is invoked in SocketServer.Processor with the fetch response 
> to the time that the send is completed. Using netstat in the middle of the 
> delay shows the following output:
> {code}
> tcp4       0      0  10.191.0.30.55455      10.191.0.30.9092       ESTABLISHED
> tcp4       0 102400  10.191.0.30.9092       10.191.0.30.55454      ESTABLISHED
> {code}
> From this, it looks like the data reaches the send buffer, but needs to be 
> flushed.



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

Reply via email to