Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Couchbase | Couchbase Server 1.8.x

increased performance with repetition

2 replies [Last post]
  • Login or register to post comments
Tue, 08/21/2012 - 17:09
sco
Offline
Joined: 08/21/2012
Groups: None

I've been running a few tests using the Couchbase 1.8 server and comparing it with a memcached server, using both the CouchbaseClient (on the Couchbase server) and the spy MemcachedClient(on both servers). Over 1000 repetitions of a cache.getBulk(collection) call surrounded in time stamps, the time stamps claim the calls are getting quicker the more iterations run.

This happens during all three trials, with both clients and both servers.

I am running both the client and the server locally on my Windows machine.

The first call takes about 9-10 milliseconds to complete (from previous reading this is expected), then the numbers drop to 0-3 ms with most occurring in the 1-2 ms range. However, after about 200 iterations, the CouchbaseClient and the MemcachedClient(running on the Memcached server) getBulk() calls drop to between 0-1 ms. The MemcachedClient(running on the Couchbase server) hits the 0-1 ms mark a little bit later, around 400 iterations.

I can't figure out why the fetches keep getting faster and faster. Any light shed on the matter will be greatly appreciated.

	Collection<String> collection = new HashSet<String>();
 
	collection.add("p1");
	collection.add("p2");
	collection.add("p3");
	collection.add("p4");
	collection.add("p5");
 
	Map<String,Object> m;
 
	/////////////////////////////
	//time stuff
	start = System.nanoTime(); 
	m = cache.getBulk(collection);  		//call to cache
	finish = System.nanoTime();
	total = Math.round((finish - start) / 1000000); //convert to ms
	fileWriter.write(total + "\r\n");
	////////////////////////////

Top
  • Login or register to post comments
Wed, 08/22/2012 - 10:14
mikew
Offline
Joined: 03/14/2011
Groups:

First off you aren't actually measuring the latency of Couchbase, you are measuring the latency of the Java SDK + Couchbase. Couchbase very likely has consistent latency, but the Java SDK is showing decreasing latency and this may be happening because Java's JIT compiler will do things to optimize code execution paths and it takes a little bit of time before this happens.

Top
  • Login or register to post comments
Wed, 08/22/2012 - 11:08
sco
Offline
Joined: 08/21/2012
Groups: None

Thank you for your response. It is much appreciated and makes a lot of sense.

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker