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

Neha Narkhede commented on KAFKA-1282:
--------------------------------------

Took a look at the patch. How about the following -
1. Limit the LRU cache size to the number of active connections that should be 
supported by the Kafka server. I'm guessing this should be a config. 
2. Override removeEldestEntry to evict the oldest entry if the cache size 
exceeds the configured number of LRU connections.

That way, we don't have to traverse the map several times in the main loop, 
which can be expensive.

> Disconnect idle socket connection in Selector
> ---------------------------------------------
>
>                 Key: KAFKA-1282
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1282
>             Project: Kafka
>          Issue Type: Bug
>          Components: producer 
>    Affects Versions: 0.8.2
>            Reporter: Jun Rao
>            Assignee: Neha Narkhede
>              Labels: newbie++
>             Fix For: 0.9.0
>
>         Attachments: 
> kafka-1282__Disconnect_idle_socket_connection_in_Selector.patch
>
>
> To reduce # socket connections, it would be useful for the new producer to 
> close socket connections that are idle. We can introduce a new producer 
> config for the idle time.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to