<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=GB2312" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
I don't think that's a fair test since the server-side application code
is not the same. spcached might be significantly less optimized than
memcached which will reduce your throughput for reasons that have
nothing to do with multithreading.<br>
<br>
Please try memcached 1.2.2 compiled in both
single-threaded and multi-threaded modes; the code paths there are not
100% identical but they're a lot closer to identical than in this test.
To compile 1.2.2 in MT mode, run "./configure --enable-threads" when
you build it. You can control the number of threads with the "-t"
option. Note that each client connection is bound to a thread, so make
sure your benchmark opens lots of connections if you want to do a fair
test of thread performance.<br>
<br>
In addition, you might want to compare the single-threaded
memcached 1.2.2 with the same version compiled as a multi-threaded app,
but run with "-t 1" so that it only uses one thread. That will tell you
how much overhead is introduced by the threading infrastructure itself
(acquiring locks, etc.) without any possibility of resource contention
affecting the results.<br>
<br>
-Steve<br>
<br>
<br>
liusifan wrote:
<blockquote cite="mid:200705181219525625173@gmail.com" type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<meta content="MSHTML 6.00.2900.3086" name="GENERATOR">
<div><font face="Verdana"><font size="2">Hi, all</font></font></div>
<div> </div>
<div><font face="Verdana"><font size="2">I've make a benchmark for
single-threaded vs. multi-threaded <br>
memcached. The single-threaded program is memcached 1.2.0.<br>
The multi-threaded program is spcached.</font></font></div>
<div> </div>
<div><font face="Verdana"><font size="2">spcached is a server which
implements memcached protocol.<br>
More detail about spcached, please refer its home page:<br>
<a moz-do-not-send="true" href="http://code.google.com/p/spcached/">http://code.google.com/p/spcached/</a></font></font></div>
<div> </div>
<div><font face="Verdana"><font size="2">Using memcached java client
as benchmark tool:<br>
<a moz-do-not-send="true"
href="http://code.google.com/p/spcached/wiki/benchmarktool">http://code.google.com/p/spcached/wiki/benchmarktool</a></font></font></div>
<div><font face="Verdana" size="2">bash$ java
com/danga/MemCached/test/MemCachedThreadBench </font></div>
<div><font face="Verdana" size="2"> <runs>
<start> <port> <threads></font></div>
<div> </div>
<div><font face="Verdana"><font size="2">memcached 1.2.0 is a
single-threaded event-driven program.<br>
spcached uses a half-sync/half-async thread pool, it has a main<br>
thread to process I/O event, and a worker thread to process<br>
the real request.</font></font></div>
<div> </div>
<div><font face="Verdana"><font size="2">The test enviroment is :<br>
Hardware: DELL 640M ( CPU Intel T2300, RAM 1G )<br>
Software: windows xp <br>
vmware 5.5.1 ( allocate 128M RAM )<br>
RedHat 7.2(Kernel 2.4.18-3)</font></font></div>
<div><font face="Verdana" size="2"> memcached 1.2.0</font></div>
<div><font face="Verdana" size="2"> <a
moz-do-not-send="true" href="http://code.google.com/p/spcached/source"
target="blank"><font size="3">spcached svn revision 5</font></a><font
size="3"> + </font><a moz-do-not-send="true"
href="http://freshmeat.net/projects/spserver/?branch_id=68862&release_id=253604"
target="blank"><font size="3">spserver 0.3</font></a><font size="3"> +
</font><a moz-do-not-send="true"
href="http://freshmeat.net/projects/spdict/?branch_id=69457&release_id=253599"
target="blank"><font size="3">spdict 0.2</font></a></font></div>
<div> </div>
<div><font face="Verdana"><font size="2">The test steps are:<br>
1.restart windows xp and vmware<br>
2.limit memcached and spcached both can only keep 185808 objects<br>
3.start memcached and MemCachedThreadBench <br>
( the memcached and benchmark tool run on the same vmware )<br>
bash$ memcached -m 96<br>
4.stop memcached, start spcached and MemCachedThreadBench<br>
bash$ spcached -c 185808 </font></font></div>
<div> </div>
<div><font face="Verdana"><font size="2">The test result is:</font></font></div>
<div> </div>
<div><font face="Verdana"><font size="2">For set operation:<br>
memcached : spcached -- 4000 : 2600 ( > 4 threads )</font></font></div>
<div> </div>
<div><font face="Verdana"><font size="2">For get operation:<br>
memcached : spcached -- 3500 : 2480 ( > 4 threads )</font></font></div>
<div> </div>
<div><font face="Verdana"><font size="2">Detail test result:</font></font></div>
<div> </div>
<div><font face="Verdana"><font size="2">memcached<br>
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND<br>
22642 xxxxx 15 0 100M 60M 5488 S 0.0 49.2 19:27 memcached</font></font></div>
<div> </div>
<div><font face="Verdana"><font size="2">bash$ java
com/danga/MemCached/test/MemCachedThreadBench 500000 0 11211 1<br>
Thread start runs set time(ms) get time(ms)<br>
Main 500000 168924 149234<br>
ReqPerSecond set - 2959 get - 3350<br>
--<br>
bash$ java com/danga/MemCached/test/MemCachedThreadBench 250000 0 11211
2<br>
Thread start runs set time(ms) get time(ms)<br>
Main 500000 135051 153600<br>
ReqPerSecond set - 3702 get - 3255<br>
--<br>
bash$ java com/danga/MemCached/test/MemCachedThreadBench 166666 0 11211
3<br>
Thread start runs set time(ms) get time(ms)<br>
Main 499998 141120 156591<br>
ReqPerSecond set - 3543 get - 3193<br>
--<br>
bash$ java com/danga/MemCached/test/MemCachedThreadBench 125000 0 11211
4<br>
Thread start runs set time(ms) get time(ms)<br>
Main 500000 123370 142169<br>
ReqPerSecond set - 4052 get - 3516<br>
--<br>
bash$ java com/danga/MemCached/test/MemCachedThreadBench 100000 0 11211
5<br>
Thread start runs set time(ms) get time(ms)<br>
Main 500000 124111 142147<br>
ReqPerSecond set - 4028 get - 3517<br>
--<br>
bash$ java com/danga/MemCached/test/MemCachedThreadBench 83333 0 11211 6<br>
Thread start runs set time(ms) get time(ms)<br>
Main 499998 123504 141857<br>
ReqPerSecond set - 4048 get - 3524<br>
--<br>
bash$ java com/danga/MemCached/test/MemCachedThreadBench 71428 0 11211 7<br>
Thread start runs set time(ms) get time(ms)<br>
Main 499996 124767 142939<br>
ReqPerSecond set - 4007 get - 3497<br>
--<br>
bash$ java com/danga/MemCached/test/MemCachedThreadBench 62500 0 11211 8<br>
Thread start runs set time(ms) get time(ms)<br>
Main 500000 124746 142887<br>
ReqPerSecond set - 4008 get - 3499<br>
--<br>
bash$ java com/danga/MemCached/test/MemCachedThreadBench 55555 0 11211 9<br>
Thread start runs set time(ms) get time(ms)<br>
Main 499995 124821 143278<br>
ReqPerSecond set - 4005 get - 3489<br>
--<br>
bash$ java com/danga/MemCached/test/MemCachedThreadBench 50000 0 11211
10<br>
Thread start runs set time(ms) get time(ms)<br>
Main 500000 124865 143082<br>
ReqPerSecond set - 4004 get - 3494<br>
<br>
=============================================================================</font></font></div>
<div> </div>
<div><font face="Verdana"><font size="2">spcached<br>
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND<br>
24536 xxx 15 0 74948 73M 608 S 0.0 59.2 25:31 spcached</font></font></div>
<div> </div>
<div><font face="Verdana"><font size="2">bash$ java
com/danga/MemCached/test/MemCachedThreadBench 500000 0 11216 1<br>
Thread start runs set time(ms) get time(ms)<br>
Main 500000 195136 209098<br>
ReqPerSecond set - 2562 get - 2391<br>
--<br>
bash$ java com/danga/MemCached/test/MemCachedThreadBench 250000 0 11216
2<br>
Thread start runs set time(ms) get time(ms)<br>
Main 500000 199820 213581<br>
ReqPerSecond set - 2502 get - 2341<br>
--<br>
bash$ java com/danga/MemCached/test/MemCachedThreadBench 166666 0 11216
3<br>
Thread start runs set time(ms) get time(ms)<br>
Main 499998 190134 203171<br>
ReqPerSecond set - 2629 get - 2460<br>
--<br>
bash$ java com/danga/MemCached/test/MemCachedThreadBench 125000 0 11216
4<br>
Thread start runs set time(ms) get time(ms)<br>
Main 500000 189092 202166<br>
ReqPerSecond set - 2644 get - 2473<br>
--<br>
bash$ java com/danga/MemCached/test/MemCachedThreadBench 100000 0 11216
5<br>
Thread start runs set time(ms) get time(ms)<br>
Main 500000 189452 200893<br>
ReqPerSecond set - 2639 get - 2488<br>
--<br>
bash$ java com/danga/MemCached/test/MemCachedThreadBench 83333 0 11216 6<br>
Thread start runs set time(ms) get time(ms)<br>
Main 499998 188704 201101<br>
ReqPerSecond set - 2649 get - 2486<br>
--<br>
bash$ java com/danga/MemCached/test/MemCachedThreadBench 71428 0 11216 7<br>
Thread start runs set time(ms) get time(ms)<br>
Main 499996 189220 201354<br>
ReqPerSecond set - 2642 get - 2483<br>
--<br>
bash$ java com/danga/MemCached/test/MemCachedThreadBench 62500 0 11216 8<br>
Thread start runs set time(ms) get time(ms)<br>
Main 500000 190293 201664<br>
ReqPerSecond set - 2627 get - 2479<br>
--<br>
bash$ java com/danga/MemCached/test/MemCachedThreadBench 55555 0 11216 9<br>
Thread start runs set time(ms) get time(ms)<br>
Main 499995 191152 202004<br>
ReqPerSecond set - 2615 get - 2475<br>
--<br>
bash$ java com/danga/MemCached/test/MemCachedThreadBench 50000 0 11216
10<br>
Thread start runs set time(ms) get time(ms)<br>
Main 500000 191352 202574<br>
ReqPerSecond set - 2612 get - 2468 <br>
</font></font></div>
<div><font face="Verdana"> </font></div>
<div align="left"><font face="Verdana"><font size="2">
<hr style="width: 122px; height: 2px;" size="2"></font></font></div>
<div><font face="Verdana"><font color="#c0c0c0"><font size="2">liusifan</font></font></font></div>
<div><font face="Verdana"><font color="#c0c0c0"><font size="2">2007-05-18</font></font></font></div>
</blockquote>
</body>
</html>