Skip to content
vladzcloudius edited this page Mar 31, 2014 · 3 revisions

Abstract

osv-memcached application is a pilot that demonstrates the power of OSv in regard of bypassing the OS layers. It partially implements the memcache protocol by connecting to the FreeBSD PF hook and handling the memcache requests.

Currently supported

  • UDP protocol only.
  • GET and SET verbs only.
  • Supports a single request per-packet only.
  • User may limit the maximum size of totally cached data.
  • IP fragmentation IS NOT supported.

How to build

  1. Get OSv:

make image=osv-memcached

How to run the memcached server

osv-memcached server will use all available memory in the Guest. It will shrink the cache if Guest runs out of memory (for any reason).

It will free the least recently used entries first.

The shrinking will be triggered by the OSv's memory::shrinker framework, which invokes shrinking of all registered agents (osv-memcached is one of them) when the amount of free memory in the system falls below some threshold.

For example, to run a single vCPU OSv instance with 4GB memory one may run the following command:

sudo ./scripts/run.py -n -v -V -c1 -m4G -e "/tools/osv-memcached.so"

After that one may run any memcache client he/she wants. For example one may use memaslap benchmark:

memaslap -s <server IP> -T 3 --concurrency 120 -t 5s --udp

Clone this wiki locally