Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B15C71873D for ; Mon, 28 Sep 2015 17:55:22 +0000 (UTC) Received: (qmail 18989 invoked by uid 500); 28 Sep 2015 17:55:13 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 18955 invoked by uid 500); 28 Sep 2015 17:55:13 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 18941 invoked by uid 99); 28 Sep 2015 17:55:13 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Sep 2015 17:55:13 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 92C26C68D4 for ; Mon, 28 Sep 2015 17:55:12 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.935 X-Spam-Level: ** X-Spam-Status: No, score=2.935 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_IMAGE_ONLY_28=0.726, HTML_MESSAGE=3, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, T_REMOTE_IMAGE=0.01, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=datastax.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id zrblfD1WawdS for ; Mon, 28 Sep 2015 17:55:05 +0000 (UTC) Received: from mail-yk0-f176.google.com (mail-yk0-f176.google.com [209.85.160.176]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 5EFDE439D0 for ; Mon, 28 Sep 2015 17:55:05 +0000 (UTC) Received: by ykdz138 with SMTP id z138so189022453ykd.2 for ; Mon, 28 Sep 2015 10:55:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datastax.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=gaW6grCSYFZZlyWy8d0EqzDHOuefhozRmwe8TChVi3U=; b=rX5GgVIW51uLKBNSWGyqcWT1G8eunlOV2huK3PmWeq4y0BBjHh0PdH9okdvL38jDou YU9tK0FKXWGwfKv4Qgj475BjwsX/AQaPJ1j6kHXdALULVjOof29F/StZ0+pfp1VlHYf6 FaIP+3BUa9ioEk096nXWMAe2oTZmxb82aCvmc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=gaW6grCSYFZZlyWy8d0EqzDHOuefhozRmwe8TChVi3U=; b=LZiVL6hlwjfdrpQzb8te+JNWuZTPfmQd4Fh7WJBUax+E7JYu8iw04WRrS+qzSOgDl6 3QWcxCRn47b2qCDHWvs4/gURjz0h715Xi/3ffkZZTPrMieahdnWx+DD8yZ6Y0c0lz701 JGd9Xe9FM/dh0AE+2Ab45aVPdXtUakbljoL86VItfCRBm6hH3MGpRN6EK7Icx2N9oCy7 66pKzioUsSTLhz15j1Cud2GuBRoynMTXZC3B7O7iDx832bd5RkrQd8buCzmJv7DdvZR4 Ww23VvrFklXOQZRF7x3eWY/8rdM+o727ti+yjHQn3dxJ5wrRkthyQ/lhnOhT6cO5NFdW avYQ== X-Gm-Message-State: ALoCoQlcIgYaiE73+ucqV6klEYWmOUkK9Y6s3ifNaLq0Ft9UHfFDvn55CwszXhqBd/ib135md1D4 X-Received: by 10.129.43.134 with SMTP id r128mr18303840ywr.9.1443462904786; Mon, 28 Sep 2015 10:55:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.254.134 with HTTP; Mon, 28 Sep 2015 10:54:45 -0700 (PDT) In-Reply-To: References: From: Alex Popescu Date: Mon, 28 Sep 2015 10:54:45 -0700 Message-ID: Subject: Re: memory usage problem of Metadata.tokenMap.tokenToHost To: user Content-Type: multipart/alternative; boundary=001a11413648afe3f80520d26513 --001a11413648afe3f80520d26513 Content-Type: text/plain; charset=UTF-8 Besides the others' advice that 2000+ keyspaces might be too much, the latest Java driver (2.0.11) includes an option to disable the Metadata API http://www.datastax.com/dev/blog/datastax-java-driver-2-0-11-released. I'm not sure at this moment if this has been merged into 2.1 already. On Sun, Sep 20, 2015 at 9:22 AM, joseph gao wrote: > cassandra: 2.1.7 > java driver: datastax java driver 2.1.6 > > Here is the problem: > My application uses 2000+ keyspaces, and will dynamically create > keyspaces and tables. And then in java client, the > Metadata.tokenMap.tokenToHost would use about 1g memory. so this will cause > a lot of full gc. > As I see, the key of the tokenToHost is keyspace, and the value is a > tokenId_to_replicateNodes map. > > When I try to solve this problem, I find something not sure: all > keyspaces have same 'tokenId_to_replicateNodes' map. > My replication strategy of all keyspaces is : simpleStrategy and > replicationFactor is 3 > > So would it be possible if keyspaces use same strategy, the value of > tokenToHost map use a same map. So it would extremely reduce the memory > usage > > thanks a lot > > -- > ------ > Joseph Gao > PhoneNum:15210513582 > QQ: 409343351 > -- Bests, Alex Popescu | @al3xandru Sen. Product Manager @ DataStax --001a11413648afe3f80520d26513 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Besides the others' advice that 2000+ keyspaces might = be too much, the latest Java driver (2.0.11) includes an option to disable = the Metadata API=C2=A0http://www.datastax.com/dev/blog/datastax-java= -driver-2-0-11-released. I'm not sure at this moment if this has be= en merged into 2.1 already.

On Sun, Sep 20, 2015 at 9:22 AM, joseph gao <gaojf.b= okecc@gmail.com> wrote:
cassandra: 2.1.7
java driver: datastax java driver 2.1.6<= /div>

Here is the problem:
=C2=A0 =C2=A0My app= lication uses 2000+ keyspaces, and will dynamically create keyspaces and ta= bles. And then in java client, the Metadata.tokenMap.tokenToHost would use = about 1g memory. so this will cause a lot of =C2=A0full gc.
=C2= =A0 =C2=A0As I see, the key of the tokenToHost is keyspace, and the value i= s a tokenId_to_replicateNodes map.

=C2=A0 =C2=A0Wh= en I try to solve this problem, I find something not sure: all keyspaces ha= ve same 'tokenId_to_replicateNodes' map.
=C2=A0 =C2=A0 My= replication strategy of all keyspaces is : simpleStrategy and replicationF= actor is 3

=C2=A0 =C2=A0 So would it be possible i= f keyspaces use same strategy, the value of tokenToHost map use a same map.= So it would extremely reduce the memory usage

=C2= =A0 =C2=A0 =C2=A0thanks a lot

--
------
Joseph Gao
PhoneNum:15210513582
QQ: 409343351



--
Bests,

Alex Popescu = |=C2=A0@al3xandru
Sen. Product Manager @ DataStax

<= br>

--001a11413648afe3f80520d26513--