[ANN] memcachedb 0.1.0 is released and replication is ready!

Steve Chu stvchu at gmail.com
Mon Nov 5 15:54:43 UTC 2007


Now replication is ready! You can achieve your HA and scale your
application by multi-reading, and also get profit from amazing
performance (high-frequency writing and reading) that memcachedb
provided.

Memcachedb is not that *blocked* you think, with a transaction log buffer!

We do a simple testing *AGAIN* on a Dell PowerEdge 2850 box that sets
20,000,000 records into memcachedb
with a 16 bytes key and 10 bytes value.

Simply start memcachedb with:
./memcachedb -p21211 -d -r -u root -H ./env1 -N -R 127.0.0.1:31211 -M
./memcachedb -p21212 -d -r -u root -H ./env2 -N -R 127.0.0.1:31212 -O
127.0.0.1:31211 -S

And here is a simple testing:

=================================================================
#include <stdio.h>
#include <string.h>
#include <time.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<20000000; 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: %ld second\n", end - start);

    mc_free(mc);
    return 0;
}
====================================================================

The total time cost is: 2506 second, the db file size is 1.6 GB.
It writes almost *8000* records per second to a master in a replicated group.

Another testing case for reading:
======================================================================
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <stdlib.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:21212");

    start = time(NULL);
    for (n=0; n<20000000; n++){
        sprintf(key, "%016d", n);
        ret = mc_aget(mc, key, strlen(key));
        if (strlen(ret) != 10){
	        printf("%s\n", ret);
        }
	    free(ret);
    }
    end =  time(NULL);
    printf("time cost: %ld second\n", end - start);

    mc_free(mc);
    return 0;
}

======================================================================
The total time cost is: 1204 second.
It reads *16000+* records per second from a replicas.

You can download it here:
http://memcachedb.googlecode.com/files/memcachedb-0.1.0.tar.gz

For more info, please visit: http://memcachedb.googlecode.com

-- 
Steve Chu
http://stvchu.org


More information about the memcached mailing list