In the current project, the start/end mode of memcached in linux is installed in/usr/local/bin by default. Go to the installation directory and start memcached:/usr/local/memcached/bin/memcached-d-c10240-m1024-uroot to get the running status...
How to start/end memcached in linux in the current project
By default, memcached is installed in/usr/local/bin.
Go to the installation directory and start memcached:/usr/local/memcached/bin/memcached-d-c 10240-m 1024-u root to get the running Status: echo stats | nc localhost 11211 (you can check the pid) or use ps-ef | grep memcached to stop memcached: kill-9 pid (-9 indicates force killing, pid is the process identifier)-d option is to start a daemon process,-m is the amount of memory allocated to Memcache, the unit is MB, where is 1024 MB, the default value is 64MB-u, which is the user who runs Memcache. here root-l is the IP address of the listening server. the default value is local-p, which is the port for setting Memcache listening. the default value is 11211, it is best to set port-c above 1024 to the maximum number of concurrent connections. the default value is 1024. here, 10240 is set to set according to the load of your server. -P is the location of the pid file for saving Memcache-h print help information-v output warning and error information-vv print client request and return information ps-ef | grep memcached (Command description) grep: function description: Searches for matching strings in the file. |: MPs queue command operator ps (process status): function description: Reports program status. Connect to memcached: telnet ip port, for example, telnet 192.168.100.11 11211stats to check the status. flush_all: Clear the basic command for viewing the memcached status in the cache. you can see the following information through this command: STAT pid 22459 process IDSTAT uptime 1027046 server run seconds STAT time 1273043062 server current unix timestamp STAT version 1.4.4 server version STAT pointer_size 64 operating system Word size (this server is 64-bit) STAT rusage_user 0.040000 process cumulative user time STAT rusage_system 0.260000 process cumulative system time STAT curr_connections 10 number of currently open connections STAT total_connections 82 number of previously opened connections STAT connection_structures 13 Number of connection structures allocated by the server STAT cmd_get 54 total number of get commands executed STAT cmd_set 34 total number of set commands executed STAT cmd_flush 3 total number of times flush_all commands STAT get_hits 9 get hits STAT get_misses 45 get misses STAT delete_misses 5 delete misses STAT delete_hits 1 delete hits STAT incr_misses 0 incr misses STAT incr_hits 0 incr hits STAT decr_misses 0 decr misses STAT decr_hits 0 decr hits STAT cas_misses 0 cas misses STAT cas_hits 0 cas hit count STAT cas_badval 0 use Wipe Count STAT auth_cmds 0 STAT auth_errors 0 STAT bytes_read 15785 read bytes total STAT bytes_written 15222 write bytes total STAT limit_maxbytes 1048576 allocated memory (bytes) STAT accepting_conns 1 currently accepts connections STAT listen_disabled_num 0 STAT threads 4 threads STAT conn_yields 0 STAT bytes 0 storage item byte count STAT curr_items 0 item count STAT total_items 34 total item count STAT evictions 0 is another example is to get the total number of items deleted from a space: start/End memcached-d-m 10-u root-l 192.168.0.122-p 11200-c 256-P/tmp/memcached. the pid-d option is to start a daemon.-m is the amount of memory allocated to Memcache. the unit is MB. Here 10 mb-u is the user who runs Memcache, here, root-l is the IP address of the listening server. if there are multiple IP addresses, the IP address 192.168.0.122-p is specified here to set the port for Memcache listening. here, 12000 is set, it is best to set port-c above 1024 to the maximum number of concurrent connections. the default value is 1024. here, 256 is set, set-P based on the load of your server to set the pid file kill 'cat/tmp/memcached to save Memcache. pid 'get running status echo stats | nc 192.168.1.123 11200 watch "echo stats | nc 192.168.1.123 11200" (real-time status)
Linux _modify_.rar http://up.2cto.com/2012/0328/20120328114011242.rar
Author 576017120
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.