|
| 1 | +<!-- |
| 2 | +Copyright (c) 2015 YCSB contributors. All rights reserved. |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); you |
| 5 | +may not use this file except in compliance with the License. You |
| 6 | +may obtain a copy of the License at |
| 7 | +
|
| 8 | +http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| 13 | +implied. See the License for the specific language governing |
| 14 | +permissions and limitations under the License. See accompanying |
| 15 | +LICENSE file. |
| 16 | +--> |
| 17 | + |
| 18 | +# YCSB Memcached binding |
| 19 | + |
| 20 | +This section describes how to run YCSB on memcached. |
| 21 | + |
| 22 | +## 1. Install and start memcached service on the host(s) |
| 23 | + |
| 24 | +Debian / Ubuntu: |
| 25 | + |
| 26 | + sudo apt-get install memcached |
| 27 | + |
| 28 | +RedHat / CentOS: |
| 29 | + |
| 30 | + sudo yum install memcached |
| 31 | + |
| 32 | +## 2. Install Java and Maven |
| 33 | + |
| 34 | +See step 2 in [`../mongodb/README.md`](../mongodb/README.md). |
| 35 | + |
| 36 | +## 3. Set up YCSB |
| 37 | + |
| 38 | +Git clone YCSB and compile: |
| 39 | + |
| 40 | + git clone http://github.com/brianfrankcooper/YCSB.git |
| 41 | + cd YCSB |
| 42 | + mvn -pl com.yahoo.ycsb:memcached-binding -am clean package |
| 43 | + |
| 44 | +## 4. Load data and run tests |
| 45 | + |
| 46 | +Load the data: |
| 47 | + |
| 48 | + ./bin/ycsb load memcached -s -P workloads/workloada > outputLoad.txt |
| 49 | + |
| 50 | +Run the workload test: |
| 51 | + |
| 52 | + ./bin/ycsb run memcached -s -P workloads/workloada > outputRun.txt |
| 53 | + |
| 54 | +## 5. memcached Connection Parameters |
| 55 | + |
| 56 | +A sample configuration is provided in |
| 57 | +[`conf/memcached.properties`](conf/memcached.properties). |
| 58 | + |
| 59 | +### Required params |
| 60 | + |
| 61 | +- `memcached.hosts` |
| 62 | + |
| 63 | + This is a comma-separated list of hosts providing the memcached interface. |
| 64 | + You can use IPs or hostnames. The port is optional and defaults to the |
| 65 | + memcached standard port of `11211` if not specified. |
| 66 | + |
| 67 | +### Optional params |
| 68 | + |
| 69 | +- `memcached.shutdownTimeoutMillis` |
| 70 | + |
| 71 | + Shutdown timeout in milliseconds. |
| 72 | + |
| 73 | +- `memcached.objectExpirationTime` |
| 74 | + |
| 75 | + Object expiration time for memcached; defaults to `Integer.MAX_VALUE`. |
| 76 | + |
| 77 | +- `memcached.checkOperationStatus` |
| 78 | + |
| 79 | + Whether to verify the success of each operation; defaults to true. |
| 80 | + |
| 81 | +- `memcached.readBufferSize` |
| 82 | + |
| 83 | + Read buffer size, in bytes. |
| 84 | + |
| 85 | +- `memcached.opTimeoutMillis` |
| 86 | + |
| 87 | + Operation timeout, in milliseconds. |
| 88 | + |
| 89 | +- `memcached.failureMode` |
| 90 | + |
| 91 | + What to do with failures; this is one of `net.spy.memcached.FailureMode` enum |
| 92 | + values, which are currently: `Redistribute`, `Retry`, or `Cancel`. |
| 93 | + |
| 94 | +You can set properties on the command line via `-p`, e.g.: |
| 95 | + |
| 96 | + ./bin/ycsb load memcached -s -P workloads/workloada \ |
| 97 | + -p "memcached.hosts=127.0.0.1" > outputLoad.txt |
0 commit comments