Giter Club home page Giter Club logo

memcachedserver's Introduction

MemcachedServer

This is a toy memcached server inspired by memcached protocol doc.

This project currently supports only a subset of all memcached functionalities. For example, expiration is not supported right now.

The server runs on a single machine, and provides high-performant and high-concurrency in-memory caching solution.

Build and Run

Download the source code:

$ git clone https://github.com/wang103/MemcachedServer.git
$ cd MemcachedServer

Install Apache Ant for building the source code.

Build the source code:

$ ant

Start the server:

$ ant MemcachedServerApp
or
$ java -cp "bin:lib/*" memcachedserver.MemcachedServerApp -p 11211

The server accepts the following arguments:

-p <port>       TCP port the server listens on. Default is 11211.
-b <buckets>    The number of buckets in the backend data storage. More buckets, less lock contention. Default is 1000.
-c <capacity>   The capacity for each bucket in the backend data storage. More capacity, less eviction. Default is 10000.

Run all test cases:

$ ant test

Clean the build:

$ ant clean

Testing

To interact with the memcached server, open a terminal and connect to the server by using telnet:

$ telnet localhost 11211

Support Commands

Storage Commands

- set
- add
- replace
- append
- prepend

Retrieval Commands

- get

Other Commands

- delete

Future Works

1. Fully support all memcached functionalities
2. Support distributed setup
3. Benchmark its performance (latency & bandwidth)
4. Periodically flush in-memory cache to disk for recovery after potential crash

memcachedserver's People

Contributors

wang103 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.