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 81281173CD for ; Fri, 24 Apr 2015 12:51:41 +0000 (UTC) Received: (qmail 32698 invoked by uid 500); 24 Apr 2015 12:51:41 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 32664 invoked by uid 500); 24 Apr 2015 12:51:41 -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 32652 invoked by uid 99); 24 Apr 2015 12:51:41 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Apr 2015 12:51:41 +0000 Date: Fri, 24 Apr 2015 12:51:41 +0000 (UTC) From: "Robert Stupp (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-9230) Allow preparing multiple prepared statements at once MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-9230?page=3Dcom.atlas= sian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D= 14510976#comment-14510976 ]=20 Robert Stupp commented on CASSANDRA-9230: ----------------------------------------- I did some benchmarking. Each of the following variants ran in its own JVM = with embedded C* and Java driver connecting to 127.0.0.1. Only a single tab= le and only "re-prepares" since that's what happens in the description. # prepare 10 statements iteratively (=E2=80=9DSingle=E2=80=9D in the full r= esult below) # prepare 10 statements concurrently (=E2=80=9DConcurrent") # prepare 10 statements with new prepare-multi protocol request/response (= =E2=80=9DMulti=E2=80=9D) Variants 1 + 2 are basically equal on a somewhat overloaded system (10 benc= hmark threads on Core i7 + threads created by C* and driver). Approx 1.2 op= erations per millisecond with runtime characteristics (GC, sync, safepoint)= . Variant 3 is interesting since it can perform nearly 8 operations per milli= second with less GC pressure (eden+survivor spaces) and less sync/safepoint= work. References: (Disclaimer: code + benchmark are dirty code) * C* branch (based on trunk): https://github.com/snazy/cassandra/tree/9230-= multi-prepare * Driver branch (based on 2.1): https://github.com/snazy/java-driver/tree/C= 9230-multi-prepare Full results (with JMH 1.9): {code} Benchmark Mode Cnt Score = Error Units Concurrent thrpt 10 1,202 =C2=B1 = 0,102 ops/ms Concurrent:=C2=B7gc.alloc.rate thrpt 10 183,951 = =C2=B1 53,938 MB/sec Concurrent:=C2=B7gc.alloc.rate.norm thrpt 10 256993,905 = =C2=B1 11495,864 B/op Concurrent:=C2=B7gc.churn.PS_Eden_Space thrpt 10 212,334 = =C2=B1 133,280 MB/sec Concurrent:=C2=B7gc.churn.PS_Eden_Space.norm thrpt 10 297916,339 = =C2=B1 168588,842 B/op Concurrent:=C2=B7gc.churn.PS_Survivor_Space thrpt 10 1,045 = =C2=B1 2,626 MB/sec Concurrent:=C2=B7gc.churn.PS_Survivor_Space.norm thrpt 10 1435,132 = =C2=B1 3614,519 B/op Concurrent:=C2=B7gc.count thrpt 10 12,000 = counts Concurrent:=C2=B7gc.time thrpt 10 104,000 = ms Concurrent:=C2=B7rt.safepointSyncTime thrpt 10 0,094 = ms Concurrent:=C2=B7rt.safepointTime thrpt 10 0,497 = ms Concurrent:=C2=B7rt.safepoints thrpt 10 628,000 = counts Concurrent:=C2=B7rt.sync.contendedLockAttempts thrpt 10 19344,000 = locks Concurrent:=C2=B7rt.sync.fatMonitors thrpt 10 4096,000 = monitors Concurrent:=C2=B7rt.sync.futileWakeups thrpt 10 283,000 = counts Concurrent:=C2=B7rt.sync.monitorDeflations thrpt 10 2357,000 = monitors Concurrent:=C2=B7rt.sync.monitorInflations thrpt 10 2361,000 = monitors Concurrent:=C2=B7rt.sync.notifications thrpt 10 680,000 = counts Concurrent:=C2=B7rt.sync.parks thrpt 10 10028,000 = counts Concurrent:=C2=B7threads.alive thrpt 10 189,900 = =C2=B1 10,040 threads Concurrent:=C2=B7threads.daemon thrpt 10 174,400 = =C2=B1 2,869 threads Concurrent:=C2=B7threads.started thrpt 10 4575,000 = threads Multi thrpt 10 7,958 =C2=B1 = 0,727 ops/ms Multi:=C2=B7gc.alloc.rate thrpt 10 944,555 = =C2=B1 262,203 MB/sec Multi:=C2=B7gc.alloc.rate.norm thrpt 10 200015,477 = =C2=B1 7233,297 B/op Multi:=C2=B7gc.churn.PS_Eden_Space thrpt 10 1059,710 = =C2=B1 269,304 MB/sec Multi:=C2=B7gc.churn.PS_Eden_Space.norm thrpt 10 226437,341 = =C2=B1 27154,083 B/op Multi:=C2=B7gc.churn.PS_Survivor_Space thrpt 10 2,598 = =C2=B1 0,675 MB/sec Multi:=C2=B7gc.churn.PS_Survivor_Space.norm thrpt 10 552,092 = =C2=B1 48,209 B/op Multi:=C2=B7gc.count thrpt 10 54,000 = counts Multi:=C2=B7gc.time thrpt 10 235,000 = ms Multi:=C2=B7rt.safepointSyncTime thrpt 10 0,091 = ms Multi:=C2=B7rt.safepointTime thrpt 10 0,698 = ms Multi:=C2=B7rt.safepoints thrpt 10 687,000 = counts Multi:=C2=B7rt.sync.contendedLockAttempts thrpt 10 8145,000 = locks Multi:=C2=B7rt.sync.fatMonitors thrpt 10 2816,000 = monitors Multi:=C2=B7rt.sync.futileWakeups thrpt 10 140,000 = counts Multi:=C2=B7rt.sync.monitorDeflations thrpt 10 2600,000 = monitors Multi:=C2=B7rt.sync.monitorInflations thrpt 10 2604,000 = monitors Multi:=C2=B7rt.sync.notifications thrpt 10 743,000 = counts Multi:=C2=B7rt.sync.parks thrpt 10 7567,000 = counts Multi:=C2=B7threads.alive thrpt 10 120,800 = =C2=B1 9,998 threads Multi:=C2=B7threads.daemon thrpt 10 105,300 = =C2=B1 2,855 threads Multi:=C2=B7threads.started thrpt 10 4507,000 = threads Single thrpt 10 1,159 =C2=B1 = 0,115 ops/ms Single:=C2=B7gc.alloc.rate thrpt 10 181,800 = =C2=B1 55,871 MB/sec Single:=C2=B7gc.alloc.rate.norm thrpt 10 262667,646 = =C2=B1 13349,288 B/op Single:=C2=B7gc.churn.PS_Eden_Space thrpt 10 218,519 = =C2=B1 138,057 MB/sec Single:=C2=B7gc.churn.PS_Eden_Space.norm thrpt 10 314999,297 = =C2=B1 160492,547 B/op Single:=C2=B7gc.churn.PS_Survivor_Space thrpt 10 1,155 = =C2=B1 3,894 MB/sec Single:=C2=B7gc.churn.PS_Survivor_Space.norm thrpt 10 1557,015 = =C2=B1 5198,605 B/op Single:=C2=B7gc.count thrpt 10 12,000 = counts Single:=C2=B7gc.time thrpt 10 106,000 = ms Single:=C2=B7rt.safepointSyncTime thrpt 10 0,086 = ms Single:=C2=B7rt.safepointTime thrpt 10 0,422 = ms Single:=C2=B7rt.safepoints thrpt 10 594,000 = counts Single:=C2=B7rt.sync.contendedLockAttempts thrpt 10 10148,000 = locks Single:=C2=B7rt.sync.fatMonitors thrpt 10 2560,000 = monitors Single:=C2=B7rt.sync.futileWakeups thrpt 10 106,000 = counts Single:=C2=B7rt.sync.monitorDeflations thrpt 10 2221,000 = monitors Single:=C2=B7rt.sync.monitorInflations thrpt 10 2224,000 = monitors Single:=C2=B7rt.sync.notifications thrpt 10 684,000 = counts Single:=C2=B7rt.sync.parks thrpt 10 8969,000 = counts Single:=C2=B7threads.alive thrpt 10 118,000 = =C2=B1 9,798 threads Single:=C2=B7threads.daemon thrpt 10 102,500 = =C2=B1 3,207 threads Single:=C2=B7threads.started thrpt 10 4505,000 = threads {code} > Allow preparing multiple prepared statements at once > ---------------------------------------------------- > > Key: CASSANDRA-9230 > URL: https://issues.apache.org/jira/browse/CASSANDRA-9230 > Project: Cassandra > Issue Type: New Feature > Components: Core > Reporter: Vishy Kasar > Priority: Minor > Labels: ponies > > We have a few cases like this: > 1. Large (40K) clients > 2. Each client preparing the same 10 prepared statements at the start up = and on reconnection to node > 3. Small(ish) number (24) of cassandra nodes=20 > The statement need to be prepared on a casasndra node just once but curre= ntly it is prepared 40K times at startup.=20 > https://issues.apache.org/jira/browse/CASSANDRA-8831 will make the situat= ion much better. A further optimization is to allow clients to create not y= et prepared statements in bulk.This way, client can prepare all the not yet= statements with one round trip to server.=20 -- This message was sent by Atlassian JIRA (v6.3.4#6332)