Return-Path: Delivered-To: apmail-incubator-cassandra-user-archive@minotaur.apache.org Received: (qmail 36015 invoked from network); 14 Nov 2009 12:01:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Nov 2009 12:01:19 -0000 Received: (qmail 26053 invoked by uid 500); 14 Nov 2009 12:01:19 -0000 Delivered-To: apmail-incubator-cassandra-user-archive@incubator.apache.org Received: (qmail 26029 invoked by uid 500); 14 Nov 2009 12:01:19 -0000 Mailing-List: contact cassandra-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cassandra-user@incubator.apache.org Delivered-To: mailing list cassandra-user@incubator.apache.org Received: (qmail 26020 invoked by uid 99); 14 Nov 2009 12:01:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Nov 2009 12:01:19 +0000 X-ASF-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of tuxracer69@gmail.com designates 74.125.78.148 as permitted sender) Received: from [74.125.78.148] (HELO ey-out-1920.google.com) (74.125.78.148) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Nov 2009 12:01:16 +0000 Received: by ey-out-1920.google.com with SMTP id 26so1105878eyw.8 for ; Sat, 14 Nov 2009 04:00:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=qesOu3fmPamlaiqF/oUI2VdFNYSfTin8GuxhIkiYF6A=; b=hZB6ot2Ad5U2Jvv8fvgStWHrWsTcCzwArjBLT5XMcoscUCfFGIZs0IET+4KtvNM5U1 ByUvDPga4U68j4Y8GFxyoi5b0wnuDYeEw0Vddk2Dun3U8jOAme6CGxQepEuSwVmQ1xSc MUqaQl3PVD8Ryrv/B8eKE3pP3KCVMtZVLK+GU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=wYEZrTQUNsAbFmcyyDtyipWUF5wfjFKJHbyOdvuDd6Nb3BWaYJhzcC7kJ4YPSvtPsL dmeM0i87aiNJqMDGIlDeUXujbYaGJ9pkGmV37KTw5cudc8paBvF/EYWoHkDbeQKlUGTD P+oqckH8PnDJ9rs39pvWlYdTFqVcgoTAP50O8= Received: by 10.213.63.75 with SMTP id a11mr698329ebi.63.1258200054945; Sat, 14 Nov 2009 04:00:54 -0800 (PST) Received: from ?192.168.1.66? (78-86-128-147.zone2.bethere.co.uk [78.86.128.147]) by mx.google.com with ESMTPS id 7sm2905304eyg.9.2009.11.14.04.00.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 14 Nov 2009 04:00:54 -0800 (PST) Message-ID: <4AFE9BF5.4090404@gmail.com> Date: Sat, 14 Nov 2009 12:00:53 +0000 From: TuxRacer69 User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090701) MIME-Version: 1.0 To: cassandra-user@incubator.apache.org Subject: Re: Why cassandra single node so slow? References: <9b048d180911140347y5c28ff3fl7e155bb0f5e216cd@mail.gmail.com> In-Reply-To: <9b048d180911140347y5c28ff3fl7e155bb0f5e216cd@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi Ruslan, did you store the logs and the data on 2 different disks as described at: http://wiki.apache.org/cassandra/StorageConfiguration and http://wiki.apache.org/cassandra/FAQ#what_kind_of_hardware_should_i_use ? Cheers TuxRacer ruslan usifov wrote: > Hello! > > I'm new in cassandra son i can misunderstand some things. > > In follow "benchmark". I have insert 4000000 records like this > > {"value": str(i), "text": "some small text"} > > I use lazyboy lib (http://github.com/digg/lazyboy) to simplify work > with cassandra thrift interface. So my insert python program look like > this: > > from lazyboy import * > from lazyboy.key import Key; > > import time; > import random; > > # Define your cluster(s) > connection.add_pool('test', ['localhost:9160']) > > for j in xrange(0, 41): > bt = time.time(); > begin = 100000 * j; > > for i in xrange(begin, begin + 100000): > if (i != begin) and ((i % 10000) == 0): > print time.time() - bt; > bt = time.time() > > rec = record.Record(); > rec.key = Key("test", "Aquarium", str(i)); > > rec.update({"value": str(i), "text": "ruslan text"}) > rec.save(); > > print time.time() - bt; > print "%s'th 100000 inserts done" % (j); > > time.sleep(10); > > > Then i try to fetch random records from my storage: > > begin = time.time(); > > for i in xrange(0, 100000): > if i and (i % 10000) == 0: > print time.time() - begin; > begin = time.time() > > rec = record.Record(); > rec.load(Key("test", "Aquarium", str(random.randint(0, 3000000)))); > > print time.time() - begin; > > > And on evry 10000 requests i get about 8 seconds: > > 8.04699993134 > 8.07800006866 > 8.18799996376 > 8.17199993134 > 8.15600013733 > 8.09399986267 > 8.07800006866 > 8.04699993134 > 8.06200003624 > 8.06299996376 > > > Then i do similar test with MySQL on InnoDB storage engine, with > follow program: > > import MySQLdb as dbi; > from MySQLdb.cursors import *; > > import time; > import random; > import sys; > > g_dbh = dbi.connect(db="test", user="root", passwd="root"); > cursor = g_dbh.cursor(); > > begin = time.time(); > > for i in xrange(0, 100000): > if i and (i % 10000) == 0: > print time.time() - begin; > begin = time.time() > > cursor.execute("select * from test where value=%s", > random.randint(0, 3000000)); > cursor.fetchone(); > > print time.time() - begin; > > > And get about 1.5 seconds per 10000 requests: > 1.54699993134 > 1.57800006852 > 1.18799996376 > 1.46671993134 > 1.76670013733 > 1.50399986267 > 1.57800003872 > 1.50699993134 > 1.50200003624 > 1.50099996313 > > Is it normal? Or i do something wrong. i have that cassandra slow in > 8/1.5 = 5.3 times less than Mysql InnoDB > > > In cassandra i off all debugging, and my keyspace look like this: > > > > > > > > > My innoDb table look like this: > > CREATE TABLE `test` ( > `value` int(11) NOT NULL, > `text` char(255) NOT NULL, > PRIMARY KEY (`value`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8 > > > In mysql i use TCP/IP connection to server not UNIX domain sockets. > All test where done on Intel core 2 duo 8600 3Gz. On FreeBSD 7.2 >