diff --git a/ChangeLog b/ChangeLog index a53e2f3..06d1b36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +version 1.1.0 + + * update documents. + version 1.1.0-rc2 * semaphores are renamed to (resource) counters. diff --git a/README.md b/README.md index 955b85b..0f6e129 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,23 @@ yrmcds ====== -yrmcds is a memory object caching system with master/slave replication. -Since its protocol is perfectly compatible with that of [memcached][], -yrmcds can be used as a drop-in replacement for [memcached][]. In fact, -yrmcds is [faster][bench] than memcached! +yrmcds is a memory object caching system with master/slave replication +and [server-side locking](docs/locking.md). -The biggest benefit of yrmcds is its amazingly low cost replication system. -The master server is elected dynamically from a group of servers, which -eliminates static master/slave configurations. By adopting virtual-IP -based replication, no modifications to applications are required. +Currently, yrmcds supports two protocols: the first is an enhanced +[memcached][], and another is a protocol to implement +[distributed resource counters](docs/counter.md). -Unlike [repcached][], yrmcds is not a patch for memcached. No code is -shared between yrmcds and memcached. yrmcds is developed for -[cybozu.com][cybozu], a B2B cloud service widely adopted by companies in -Japan. +Since the memcached protocol is perfectly compatible with the +[original implementation][memcached], yrmcds can be used as a drop-in +replacement for memcached. Thanks to its virtual-IP based replication +system, existing applications can obtain high-available +memcached-compatible service without any modifications. + +A companion client library [libyrmcds][] and a [PHP extension][php-yrmcds] +are also available. + +yrmcds was developed originally for [kintone.com][kintone]. License ------- @@ -28,14 +31,14 @@ Features -------- * Memcached text and binary protocols. -* [Server-side locking](docs/locking.md). -* [Server-side semaphore](docs/semaphore.md). +* [Server-side locking](docs/locking.md) extension to memcached protocol. +* [Distributed resource counter](docs/counter.md) protocol. * Large objects can be stored in temporary files, not in memory. * Global LRU eviction / no slab distribution problem. * Unlike memcached, yrmcds is not involved with slabs problems. ([1][slab1], [2][slab2]) * Virtual-IP based master-slave replication. - * Automatic fail-over. + * Automatic fail-over * Automatic recovery of redundancy. A [companion client library][libyrmcds] and a [PHP extension][php-yrmcds] @@ -48,31 +51,15 @@ and some [benchmark results](docs/bench.md). Prerequisites ------------- -* Fairly recent Linux kernel. * C++11 compiler (gcc 4.8.1+ or clang 3.3+). * [TCMalloc][tcmalloc] from Google. * GNU make. -The following may help Ubuntu users to compile gcc 4.8.1: -```shell -sudo apt-get install libgmp-dev libmpfr-dev libmpc-dev build-essential -tar xjf gcc-4.8.1.tar.bz2 -mkdir gcc-4.8.1/build -cd gcc-4.8.1/build -../configure --prefix=/usr/local/gcc --disable-shared --disable-multilib \ - --enable-threads --enable-__cxa_atexit --enable-languages=c,c++ \ - --disable-nls -make -j 4 BOOT_CFLAGS=-O2 bootstrap -sudo make install -make clean -export PATH=/usr/local/gcc/bin:$PATH -``` - Build ----- 1. Prepare TCMalloc. - On Ubuntu, run `apt-get install libgoogle-perftools-dev`. + On Ubuntu, run `apt-get install libgoogle-perftools-dev`. 2. Run `make`. You can build yrmcds without TCMalloc by editing Makefile. @@ -93,16 +80,13 @@ The correct pronunciation sounds like: "Yo-Ru-Mac-Do" (夜マクド in Japanese) [memcached]: http://memcached.org/ -[bench]: https://github.com/cybozu/yrmcds/blob/master/docs/bench.md#results -[repcached]: http://repcached.lab.klab.org/ [bsd2]: http://opensource.org/licenses/BSD-2-Clause [SipHash]: https://131002.net/siphash/ [csiphash]: https://github.com/majek/csiphash [mit]: http://opensource.org/licenses/MIT [libyrmcds]: http://cybozu.github.io/libyrmcds/ -[libyrmcds-semaphore]: https://github.com/cybozu/libyrmcds-semaphore/ [php-yrmcds]: http://cybozu.github.io/php-yrmcds/ [slab1]: http://nosql.mypopescu.com/post/13506116892/memcached-internals-memory-allocation-eviction [slab2]: https://groups.google.com/forum/#!topic/memcached/DuJNy5gbQ0o -[cybozu]: https://www.cybozu.com/us/ +[kintone]: https://www.kintone.com/ [tcmalloc]: http://goog-perftools.sourceforge.net/doc/tcmalloc.html diff --git a/docs/usage.md b/docs/usage.md index 2a35a81..1b64e93 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -17,11 +17,10 @@ Usually, yrmcds is installed under `/usr/local`. * /usr/local/sbin/yrmcdsd The program. -Configuration -------------- +Configuration (memcache) +------------------------ -You can change any of these configuration options through the -configuration file: +These options are to configure memcache protocol: * `user` (Default: none) If set, the program will try to `setuid` to the given user. @@ -55,6 +54,28 @@ configuration file: * `gc_interval` (Default: 10) The interval between garbage collections in seconds. +Configuration (counter) +------------------------ + +yrmcds has an extra protocol called **counter** in addition to memcache +protocol. The counter protocol can be used to manage resource usage +dynamically just like (distributed) semaphores. + +The counter protocol has these configuration options: + +* `counter.enable` (Default: `false`) + If `true`, the counter extension is enabled. +* `counter.port` (Default: 11215) + TCP port number used for the counter protocol. +* `counter.max_connections` (Default: 0) + The maximum number of connections for the counter protocol. + 0 means unlimited. +* `counter.buckets` (Default: 1000000) + The size of the counter hash table. +* `counter.stat_interval` (Default: 86400) + The interval of measuring the maximum resource consumption. + The default is 86400 seconds = 1 day. + Running yrmcdsd --------------- @@ -104,6 +125,9 @@ not, the slave drops all objects then try to connect to the new master. Since the master node is elected dynamically by [keepalived][], each `yrmcdsd` should have the same configuration parameters. +### counter protocol + +Resource counters are not replicated. [keepalived]: http://www.keepalived.org/ [pacemaker]: http://clusterlabs.org/wiki/Main_Page diff --git a/src/constants.hpp b/src/constants.hpp index 032d01b..b440412 100644 --- a/src/constants.hpp +++ b/src/constants.hpp @@ -31,7 +31,7 @@ const std::size_t MAX_REQUEST_LENGTH = 30 << 20; // 30 MiB const int MAX_SLAVES = 5; const int MAX_CONSECUTIVE_GCS = 3; -const char VERSION[] = "yrmcds version 1.1.0-rc2"; +const char VERSION[] = "yrmcds version 1.1.0"; } // namespace yrmcds