A very fast kyoto cabinet powered memcache interface http proxy caching server.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Brett Langdon cf51b267fc Merge remote-tracking branch 'origin/multi_threading' 13 years ago
benchmark add simple testing scripts 13 years ago
src some major refactoring 13 years ago
.gitignore ignore out/ directory 13 years ago
LICENSE Initial commit 13 years ago
Makefile cleanup Makefile 13 years ago
README.md Update README.md 13 years ago

README.md

fast-cache

A very fast kyoto cabinet powered memcache interface http proxy caching server.

Very rough done benchmark so far, just running against a local wsgi app with 5 gunicorn workers returning {} only.

import random
import time

import memcache

mc = memcache.Client(["127.0.0.1:7000"])
# hack to make sure we force the connection before the first call
for server in mc.servers:
    server.connect()

elapsed = 0
total = 0
numbers = range(5000)
for _ in range(100000):
    start = time.time()
    result = mc.get("test:%s" % random.choice(numbers))
    end = time.time()
    if result is None:
        break
    elapsed += end - start
    total += 1

print "Total: %s" % total
print "Total Elapsed: %s" % elapsed
print "Average: %s" % (elapsed / total)
print "Req/sec: %s" % (total / elapsed)

Fresh cache:

╭─brett@Voltaire  ~/Desktop/fast-cache  ‹master›
╰─$ python bench.py                                                                                          
Total: 100000
Total Elapsed: 21.179005146
Average: 0.00021179005146
Req/sec: 4721.65709912

Second Run:

╭─brett@Voltaire  ~/Desktop/fast-cache  ‹master›
╰─$ python bench.py
Total: 100000
Total Elapsed: 14.9816277027
Average: 0.000149816277027
Req/sec: 6674.84214562

STATS

╭─brett@Voltaire  ~/Desktop/fast-cache  ‹master›
╰─$ telnet 127.0.0.1 7000
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
STATS
STAT cache_miss 5000
STAT hits 195000
STAT hit_ratio 0.98
STAT records 5000
END