Thursday, October 01, 2009

A simple load test in Terracotta...

This is a response to the following blog in which the author wrote a micro-benchmark and got some pretty bad results using Terracotta

Since the commenting system on blogger doesn't allow code, I am posting the response on my blog with code attached for reference.

So my approach was to try replicate the author's implementation, to see what kind of performance a straightforward micro-benchmark might achieve.

Reader beware - micro-benchmarks are never a good idea, and not usually indicative of real-world performance. In this case, based on real-world results I have seen, my results appear to be a lower bound for the kind of performance one should expect since the test isn't concurrent and is running on a single machine - hardly the kind of environment a real world clustered app would exist in)

So, with that said, I wrote a simple load test against a ConcurrentHashMap, and put 100,000 objects into it.

My results show:
Avg TPS: ~3,000
Instantaneous TPS as high as: ~7,000

Here's the code:

import java.util.Date;
import java.util.Map;
import java.util.concurrent.*;

public class Main
static Map<Integer, Foo> map =
new ConcurrentHashMap<Integer, Foo>();

public static class Foo
public String name;
public String name2;
public String name3;

public Foo(String name)
{ = name;
this.name2 = name + " 2";
this.name3 = name + " 3";

public static void main(String[] args)
long start = System.currentTimeMillis();

for (int i = 0; i < 100000; i++) {
map.put(i, new Foo(new Date().toString()));
System.out.println("elapsed: " + (System.currentTimeMillis() - start));

And here's the tc-config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<tc:tc-config xmlns:tc=""

I took a screenshot of the dev console running during the test, to give you an idea of the instantaneous TPS achieved:


cool said...

租辦公室租店面買辦公室店面租賃店面出租店面出售花茶花草茶養生茶招牌led招牌招牌製作美國月子中心保養美國月子中心OBU投審會會計師事務所會計師工商登記公司登記包子肉粽宅配美食四神湯搬家公司訂房訂房網花東旅遊桃園土地桃園房屋仲介桃園房屋桃園房屋網桃園房屋買賣漆彈搬家公司會場設計展場設計會場設計展場設計展覽設計消防設備消防設備機電崴立機電消防公司地板施工超耐磨地板店面出租乳癌全身健康檢查肝癌健康檢查身體檢查飛梭雷射雷射溶脂直航機票自由行三久太陽能三久太陽能太陽能熱水器別墅外觀設計環保袋別墅外觀設計室內裝修電波拉皮hand dryer電波拉皮雷射溶脂肉毒桿菌系統家具台中漆彈場漆彈團體服美國月子中心團體服

cool said...


cool said...

月子餐食譜找工作統一發票7 8月求職1111求職人力銀行104求職人力銀行104人力銀行統一發票5 6月104人力銀行104求職人力銀行塑膠袋統一發票1 2月塑膠袋批發塑膠袋工廠金價黃金價格統一發票3 4月1111人力銀行1111人力銀行求職黃金價格查詢中古車買賣塑膠袋統一發票3 4月塑膠袋批發中古車中古車買賣台北人力銀行金價查詢sum中古車中古車貸款信用貸款房屋貸款剖腹生產 命理網 姓名學 姓名配對 星座 星座運勢 算命 開運印章 風水 外遇 徵信 徵信社 外遇 徵信 徵信社 外遇 徵信 徵信社 外遇 徵信 徵信社 外遇 徵信 徵信社 外遇 徵信 徵信社 搬家公司 搬家公司 台北搬家公司 新竹搬家公司

haha said...

Nice BLOG.................................................

pbsl said...

you have a nice site.thanks for sharing this site. various kinds of ebooks are available here

LAN said...

puma mens shoes
puma shoes
puma speed
nike shoes
nike air
nike air shoes
nike air max 90
nike air max 95
nike air max tn
nike air rift
nike shox r4
nike air max 360
nike shox nz
puma cat
air max trainers
mens nike air max
sports shoes
nike air rifts
nike air rift trainer
nike air
nike shoes air max
nike shoes shox
air shoes
nike shoe cart
puma future
cheap puma
nike rift
jeans shop
diesel jeans
levis jeans
nike rift shoes
cheap nike air rifts
bape shoes

smallawei said...





air shoes said...

I like your blog. Thank you. They are really great .
Some new style Puma Cat shoes is in fashion this year.
The Nike Air Shoes is a best Air Shoes .
Nike Air Rift is good and Cheap Nike Shoes.
If you are a fans of Puma basket,we would offer the good and Cheap Puma Shoes for you .the cheap ugg bootsis best christmas gift now.
The information age is really convenient .

Böcek ilaçlama said...

fare ilaçlama
fare ilaçlama
fare ilaçlama
fare ilaçlama
fare ilaçlama
fare ilaçlama
fare ilaçlama

haşere ilaçlama
haşere ilaçlama
haşere ilaçlama

pire ilaçlama
pire ilaçlama
pire ilaçlama
pire ilaçlama
pire ilaçlama
pire ilaçlama

fare ilaçlama

bit ilaçlama
bit ilaçlama
bit ilaçlama
bit ilaçlama
bit ilaçlama
bit ilaçlama

akrep ilaçlama
akrep ilaçlama
akrep ilaçlama
akrep ilaçlama
akrep ilaçlama

ömer said...

Yıldız ilaçlama kurulduğu andan beri profesyonel pire ilaçlama hizmeti sunmaktadır. Sizde sitenize seo yaptırmak istiyorsanız firmamızla iletişime geçiniz.

Nike shox shoes said...

As to which more appropriate oneself, water like the person, changes in temperature from cicada.

Nike shox shoes can surely not let you down,romance yourself with nike shox

aa said...

As I write this post—longhandOffice 2010in a spiral notebook—I’m 20,000 feet above eastern Washington, having Microsoft Office 2010just crossed above the Cascades on my return flight Microsoft wordto Chicago. I visited Seattle for the weekend to Office 2007and I have known each other for 20 years now. They Microsoft Officehad a lovely ceremony, and the trip in general was fantastic.Microsoft Office 2007In the 13 years since I left Seattle, I’ve Office 2007 keyvisited six or seven times, and I always return to wherever has Office 2007 downloadOffice 2007 Professionalbecome home with mixed feelings about the place. It Outlook 2010both alarms and pleases me to see howMicrosoft outlookthat once-familiar areas seem almost foreign. ForMicrosoft outlook 2010neighborhoods have changed, to the point Windows 7 as have cookie-cutter, here-today-and-gone-tomorrow nightclubs that cater to the shiny shirt crowd.

Sahin said...

thank you very much fırsat prada shoes prada sneakers