[root@draft ~]# yum install -y memcached[root@draft ~]# systemctl start memcached[root@draft ~]# ps aux |grep memcached
memcach+ 64170 0.2 0.2 350620 2168 ? Ssl 21:41 0:00 /usr/bin/memcached -u memcached -p 11211 -m 64 -c 1024
[root@draft ~]# netstat -lntp |grep memcached
tcp 0 0 0.0.0.0:11211 0.0.0.0:* LISTEN 64170/memcached
tcp6 0 0 :::11211 :::* LISTEN 64170/memcached
[root@draft ~]# memcached -h #一些可能用到的参数;
-m <num> max memory to use for items in megabytes (default: 64 MB)
-l <addr> interface to listen on (default: INADDR_ANY, all addresses)<addr> may be specified as host:port. If you don't specify
a port number, the value you specified with -p or -U is
used. You may specify multiple addresses separated by comma
or by using -l multiple times
-d run as a daemon
-I Override the size of each slab page. Adjusts max item size
(default: 1mb, min: 1k, max: 128m)
-f <factor> chunk size growth factor (default: 1.25)
改变memcached运行参数,运行时加上相应参数;
另外一种方法是改配置文件;
[root@draft ~]# vim /etc/sysconfig/memcached
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS=""
[root@draft ~]# yum install nmap-ncat.x86_64
描述 : Ncat is a feature packed networking utility which will read and
:write data across a network from the command line. It uses both
: TCP and UDP for communication and is designed to be a reliable
: back-end tool to instantly provide network connectivity to other
: applications and users. Ncat will not only work with IPv4 and IPv6
: but provides the user with a virtually limitless number of potential
: uses.
[root@draft ~]# echo stats | nc 127.0.0.1 11211
STAT pid 66041
STAT uptime 387
STAT time 1575899942
STAT version 1.4.15
STAT libevent 2.0.21-stable
STAT pointer_size 64
STAT rusage_user 0.007740
STAT rusage_system 0.024282
STAT curr_connections 10
STAT total_connections 14
STAT connection_structures 11
STAT reserved_fds 20
STAT cmd_get 0
STAT cmd_set 0
STAT cmd_flush 0
STAT cmd_touch 0
STAT get_hits 0
STAT get_misses 0
STAT delete_misses 0
STAT delete_hits 0
STAT incr_misses 0
STAT incr_hits 0
STAT decr_misses 0
STAT decr_hits 0
STAT cas_misses 0
STAT cas_hits 0
STAT cas_badval 0
STAT touch_hits 0
STAT touch_misses 0
STAT auth_cmds 0
STAT auth_errors 0
STAT bytes_read 44
STAT bytes_written 1087
STAT limit_maxbytes 67108864
STAT accepting_conns 1
STAT listen_disabled_num 0
STAT threads 4
STAT conn_yields 0
STAT hash_power_level 16
STAT hash_bytes 524288
STAT hash_is_expanding 0
STAT bytes 0
STAT curr_items 0
STAT total_items 0
STAT expired_unfetched 0
STAT evicted_unfetched 0
STAT evictions 0
STAT reclaimed 0
END