Return-Path: X-Original-To: apmail-ignite-user-archive@minotaur.apache.org Delivered-To: apmail-ignite-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 55FCE18675 for ; Wed, 29 Jul 2015 11:08:25 +0000 (UTC) Received: (qmail 39683 invoked by uid 500); 29 Jul 2015 11:08:17 -0000 Delivered-To: apmail-ignite-user-archive@ignite.apache.org Received: (qmail 39639 invoked by uid 500); 29 Jul 2015 11:08:17 -0000 Mailing-List: contact user-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ignite.incubator.apache.org Delivered-To: mailing list user@ignite.incubator.apache.org Received: (qmail 39628 invoked by uid 99); 29 Jul 2015 11:08:17 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jul 2015 11:08:17 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id C561C1933C5 for ; Wed, 29 Jul 2015 11:08:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.129 X-Spam-Level: *** X-Spam-Status: No, score=3.129 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id oX6CPR3Kk2oW for ; Wed, 29 Jul 2015 11:08:15 +0000 (UTC) Received: from mail-ob0-f179.google.com (mail-ob0-f179.google.com [209.85.214.179]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id E9B7E210DF for ; Wed, 29 Jul 2015 11:08:14 +0000 (UTC) Received: by obdeg2 with SMTP id eg2so4469998obd.0 for ; Wed, 29 Jul 2015 04:07:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=Lnb0Hvmit++MJVCXsSUMHyzozmarHVj/ABgVW8oWJkU=; b=fqBAAtf+GAHratIUCFkgRVdWmr01zZ+PBils+JhNm78YXcEAZ9ACQ/ZvEGq7CjfMrX hyxd8xVdUJeHVb4iepDAbnjYvTQKzD1TTsvxOiKex9dRm39Sdro6lLb/fQB/PZPH16gd Y/TDeqzIWARQjcFiiMBIWeYAwYT4tPO7qG764Ox7jq8UKzKSDPnVu8EKVn7lUWcxQ72n xYb6Vwpt1UJAtYOLhi4H+af+QqCqtpgdVHOJBNOAGBwJJhKKcnH/hMnaZ2B0OyLy7AwU YMwm3BDQLcolqNBoI5uwEj4BLTWJkrnehdE1cgpRvf89Wnq4LhMA/7W21Ppo1cJOHtNk YIag== MIME-Version: 1.0 X-Received: by 10.182.142.202 with SMTP id ry10mr39234159obb.27.1438168049342; Wed, 29 Jul 2015 04:07:29 -0700 (PDT) Received: by 10.202.61.212 with HTTP; Wed, 29 Jul 2015 04:07:29 -0700 (PDT) Date: Wed, 29 Jul 2015 16:37:29 +0530 Message-ID: Subject: Optimistic transaction very slow on v1.3.2 community edition From: Sajal Gupta To: user@ignite.incubator.apache.org Content-Type: multipart/alternative; boundary=001a1130caeab55db1051c019754 --001a1130caeab55db1051c019754 Content-Type: text/plain; charset=UTF-8 Trying the below sample where I am putting 20000 entries in cache within transaction on a single node(JRE 7, heap 4GB),it takes more than 20sec to commit. The thread dumps below shows thread executing GridCacheMvccManager.addNext most of the time.The same sample with pessimistic mode takes less than 5sec Let me know if there is any other setting that should be specified or is it the best we can get considering everything is happening in memory on single node? URL url = TestCache.class.getResource("/unittest/gridgain/example-ignite.xml"); Ignite ignite = Ignition.start(url); System.out.println(); System.out.println(">>> Cache API example started."); CacheConfiguration cfg = new CacheConfiguration(); cfg.setName("myCache"); cfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL); cfg.setCacheMode(CacheMode.PARTITIONED); cfg.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED); cfg.setRebalanceMode(CacheRebalanceMode.ASYNC); cfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_ASYNC); cfg.setOffHeapMaxMemory(2 * 1024L * 1024L * 1024L); IgniteCache cache = ignite.createCache(cfg); byte[] valArr = new byte[16000]; for(int i=0;i

Trying the below sample where I am putting 20000 entrie= s in cache within transaction on a single node(JRE 7, heap 4GB),it takes mo= re than 20sec to commit. The thread dumps below shows thread executing Grid= CacheMvccManager.addNext most of the time.The same sample with pessimistic = mode takes less than 5sec
Let me know if there is any other setting that= should be specified or is it the best we can get considering everything is= happening in memory on single node?

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0URL url =3D TestCache.class.getResource("/unittest/gridgai= n/example-ignite.xml");
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 Ignite ignite =3D Ignition.start(url);
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 System.out.println();
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 System.out.println(">>> Cache API ex= ample started.");

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 CacheConfiguration cfg =3D new CacheConfiguration();
=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 cfg.setName("myCache");
= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 cfg.setAtomicityMode(Cache= AtomicityMode.TRANSACTIONAL);
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 cfg.setCacheMode(CacheMode.PARTITIONED);
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 cfg.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED);=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 cfg.setRebalanceMode(C= acheRebalanceMode.ASYNC);
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 cfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_ASYN= C);
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 cfg.setOffHeapMaxMe= mory(2 * 1024L * 1024L * 1024L);
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 IgniteCache<String,byte[]> cache =3D ignite.createCache(cfg= );

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 byte[] valArr = =3D new byte[16000];
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 fo= r(int i=3D0;i<valArr.length;i++){
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 =C2=A0valArr[i] =3D 0x0;
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 lo= ng t1 =3D System.currentTimeMillis();
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 try (Transaction tx =3D (Transaction)Ignition.ignite().tran= sactions().txStart(TransactionConcurrency.OPTIMISTIC,TransactionIsolation.R= EPEATABLE_READ)){
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= for(int i=3D0;i<20000;i++){
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 =C2=A0cache.put("K"+(long)i,valArr);=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0
=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 tx.commit();
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 }
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 long t2 =3D= System.currentTimeMillis();
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 System.out.println("Time taken:"=C2=A0 + (t2-t= 1));


"main" prio=3D= 6 tid=3D0x0000000002c33800 nid=3D0x454 runnable [0x0000000002b4e000]
=C2= =A0=C2=A0 java.lang.Thread.State: RUNNABLE
=C2=A0at java.util.LinkedList= .add(LinkedList.java:336)
=C2=A0at org.apache.ignite.internal.processors= .cache.GridCacheMvccManager.addNext(GridCacheMvccManager.java:733)
=C2= =A0at org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtCa= cheEntry.addDhtLocal(GridDhtCacheEntry.java:230)
=C2=A0at org.apache.ign= ite.internal.processors.cache.distributed.dht.GridDhtCacheEntry.tmLock(Grid= DhtCacheEntry.java:244)
=C2=A0at org.apache.ignite.internal.processors.c= ache.transactions.IgniteTxManager.lockMultiple(IgniteTxManager.java:1586)=C2=A0at org.apache.ignite.internal.processors.cache.transactions.IgniteT= xManager.prepareTx(IgniteTxManager.java:882)
=C2=A0at org.apache.ignite.= internal.processors.cache.transactions.IgniteTxLocalAdapter.userPrepare(Ign= iteTxLocalAdapter.java:410)
=C2=A0at org.apache.ignite.internal.processo= rs.cache.distributed.near.GridNearTxLocal.prepareAsyncLocal(GridNearTxLocal= .java:852)
--001a1130caeab55db1051c019754--