[ANN] memcachedb 0.0.4 is released
Steve Chu
stvchu at gmail.com
Tue Oct 23 14:00:14 UTC 2007
This version has big performance improved and db file size reduced! (see below)
Project Homepage: http://memcachedb.googlecode.com
ChangLog:
2007-10-22 Steve Chu <zhuxin at staff.sina.com.cn>
* add a new struct db_settings for all db related configures.
* big code cleanup for performance.
* "-L" option now uses a unit of kbytes.
2007-10-19 Cao Kai <caokai at staff.sina.com.cn>
* add option "-C" and create a separate thread to do periodic checkpoint
* add option "-D" and create a separate thread to do periodic
deadlock detecting
2007-10-15 Novey Donar <xiaogang1 at staff.sina.com.cn>
* remove the item key in data.data, about 50% db file size
reduced, but not compatible
with previous versions, warning to use.
2007-10-08 Steve Chu <zhuxin at staff.sina.com.cn>
* add option "-L" to allow to set transaction log buffer
* add option "-N" to allow to set DB_TXN_NOSYNC flag, if someone
wanted lots of performance improved, but warning to use, because it
loses transaction's durability
We do a simple testing on a Dell PowerEdge 2850 box that sets
200,000,000 records into memcachedb with a 16 bytes key and 10 bytes
value.
Simply start memcachedb with: ./memcachedb -d -r -u root -N
And here is testing case:
=================================================================
#include <stdio.h>
#include <string.h>
#include "memcache.h"
int main(int argc, char **argv){
int ret = 0;
char key[32] = {0};
char val[32] = {0};
int n = 0;
time_t start;
time_t end;
struct memcache *mc = mc_new();
mc_server_add4(mc, "127.0.0.1:21211");
start = time(NULL);
for (n=0; n<200000000; n++){
sprintf(key, "%016d", n);
sprintf(val, "%010d", n);
ret = mc_set(mc, key, strlen(key), val, strlen(val), 0, 0);
}
end = time(NULL);
printf("time cost: %d second\n", end - start);
mc_free(mc);
return 0;
}
====================================================================
The total time cost is: 16572 second, the db file size is 7.7 GB.
It writes almost *12000* records per second and simultaneously does checkpoint
every 60 sec and deadlock detecting every 100 ms!!
When the *set* testing case is running, we start another testing
case(on same daemon):
======================================================================
#include <stdio.h>
#include <string.h>
#include "memcache.h"
int main(int argc, char **argv){
char *ret = 0;
char key[32] = {0};
int n = 0;
time_t start;
time_t end;
struct memcache *mc = mc_new();
mc_server_add4(mc, "127.0.0.1:21211");
start = time(NULL);
for (n=0; n<1000000; n++){
sprintf(key, "%016d", n);
ret = mc_aget(mc, key, strlen(key));
//printf("%s\n", ret);
free(ret);
}
end = time(NULL);
printf("time cost: %d second\n", end - start);
mc_free(mc);
return 0;
}
======================================================================
The total time cost is: 103 second.
It reads *10000* records per second simultaneously with a heavy load
of 12000 per second writing!!
You can download it here:
http://memcachedb.googlecode.com/files/memcachedb-0.0.4.tar.gz
For more info, please visit: http://memcachedb.googlecode.com
Regards,
Steve Chu
http://www.sina.com
More information about the memcached
mailing list