memcached
最后更新于
# rcctl enable memcached
# rcctl start memcached$ telnet localhost 11211
Trying 127.0.0.1...
Connected to localhost.
set testkey 0 300 5
hello
STORED
get testkey
VALUE testkey 0 5
hello
ENDquitimport memcache
mc = memcache.Client(['127.0.0.1:11211'])
mc.set('greeting', 'hello', time=300)
print(mc.get('greeting'))# rcctl set memcached flags "-m 128 -l 192.0.2.1 -p 11211"pass in on $int_if proto tcp from 192.0.2.0/24 to port 11211
block in on $int_if proto tcp from any to port 11211# pfctl -f /etc/pf.conf
# rcctl restart memcached# rcctl enable memcached
# rcctl start memcached# rcctl stop memcached
# rcctl restart memcached# rcctl check memcached# tail -f /var/log/daemon# rcctl set memcached flags "-m 64 -v"
# rcctl restart memcached