echo "flush_all" | /bin/netcat -q 2 127.0.0.1 11211
Change 127.0.0.1 to your IP server and 11211 with your port.
echo "flush_all" | /bin/netcat -q 2 127.0.0.1 11211
| Operation | python-memcached | pylibmc (function) | pylibmc (operator []) |
| Insert 1.000.000 records | 107 sec | 65 sec | 69 sec |
| Insert/Query 1.000.000 records | 190 sec | 131 sec | 135 sec |
sudo apt-get install memcached
yum install memcached
$ telnet localhost 11211
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
get foo
VALUE foo 0 2
hi
END
stats
STAT pid 8861
(etc)
pip install python-memcached
pip-python install python-memcached
python
import memcache
mc = memcache.Client(['127.0.0.1:11211'], debug=0)
mc.set("some_key", "Some value")
mc.get("some_key")
mc.set("another_key", 3)
mc.delete("another_key")
sudo apt-get install -y libmemcached-dev zlib1g-dev libssl-dev python-dev build-essential
pip install pylibmc
yum install libmemcached
pip-python install pylibmc
python
>>> import pylibmc
>>> mc = pylibmc.Client(["127.0.0.1"], binary=True,
... behaviors={"tcp_nodelay": True,
... "ketama": True})
>>> mc["some_key"] = "Some value"
>>> mc["some_key"]
'Some value'
>>> del mc["some_key"]
>>> "some_key" in mc
False