Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 64CE71023D for ; Tue, 2 Jul 2013 17:09:22 +0000 (UTC) Received: (qmail 12544 invoked by uid 500); 2 Jul 2013 17:09:21 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 12454 invoked by uid 500); 2 Jul 2013 17:09:21 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 12445 invoked by uid 99); 2 Jul 2013 17:09:21 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Jul 2013 17:09:21 +0000 Date: Tue, 2 Jul 2013 17:09:21 +0000 (UTC) From: "Jason Brown (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-5719) Expire entries out of ThriftSessionManager MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-5719?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jason Brown updated CASSANDRA-5719: ----------------------------------- Attachment: 5719-v1.patch v1 patch replaces the TSM's Map with guava's Cache object. The guava Cache allows us to expire items out of the cache based on lastAccess time (if it's exceeded some threshold, drop the entry). I selected some basic defaults for the cache (150,000 max entries, and 4 hour time limit for last usage), but I'm open to adjusting those values. > Expire entries out of ThriftSessionManager > ------------------------------------------ > > Key: CASSANDRA-5719 > URL: https://issues.apache.org/jira/browse/CASSANDRA-5719 > Project: Cassandra > Issue Type: Improvement > Components: Core > Affects Versions: 1.2.0 > Reporter: Jason Brown > Assignee: Jason Brown > Priority: Minor > Labels: cache, thrift > Fix For: 1.2.7, 2.0 beta 1 > > Attachments: 5719-v1.patch > > > TSM maintains a map of SocketAddress (IpAddr, and the ephemeral port) to ClientState. If the connection goes away, for whatever reason, entries are not removed from the map. In most cases this is a tiny leakage. However, at Netflix, we auto-scale services up and down everyday, sometimes with client instance lifetimes of around 36 hours. These clusters can add hundreds of servers at peak time, and indescriminantly terminate them at the trough. The net effect for cassandra is that we'll leave thousands of dead entries in the TSM.activeSocketSessions map. When I looked at an instance in a well-used cluster yesterday, there were almost 400,000 entries in the map. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira