Linux download libevent-devel because of dependencies
Yum Install Libevent-devel
memcached official website Download path
Https://memcached.org/downloads
Download memcached Client
Then unzip it, modify the folder name: memcached, the version number is removed, in order to facilitate the operation
Extract to:/usr/local/
Cd/usr/local/memcached
./configure && make && make test && sudo make install
memcached Basic settings for :
1. start the server side of the Memcache :
/usr/local/bin/memcached-d-M 10-u root-l 192.168.229.129-p 12000-c 256-p/tmp/memcached.pid
/usr/local/bin/memcached-d-M 100-u root-l 127.0.0.1-p 12000-c 300
/usr/local/bin/memcached -d-m 128-p 11111-u Root
- Doption is to start a daemon,
-Mis assigned toMemcacheThe amount of memory used, in units ofMB, I am here10MB,
-Uis runMemcacheThe user, I am hereRoot,
-LIs the server that listensIPAddress, if there are multiple addresses, I specify the server'sIPAddress192.168.229.129,
-Pis setMemcacheListen to the port, I set it up here12000, it is best1024x768Above the port,
-Coption is the maximum number of concurrent connections that are run, by default1024x768, I have set up here the, set according to the load on your server,
-Pis the settings saveMemcacheOfPIDfile that I'm here is saved in/tmp/memcached.pid,
2. If you want to end the Memcache process, execute:
# Kill ' Cat/tmp/memcached.pid '
You can also start multiple daemons, but the ports cannot be duplicated.
3. Restart Apache,service httpd restart
Get Run status
Ps-ef | grep memcached
Connect to memcached:
Telnet IP port, such as Telnet 192.168.100.11 11211
Stats View status, Flush_all: Clear Cache
To view the basic commands for the memcached status, this command allows you to see the following information:
STAT PID 22459 Process ID
STAT uptime 1027046 server running seconds
STAT time 1273043062 Server current UNIX timestamp
STAT version 1.4.4 Server version
STAT pointer_size 64 OS 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 Total connections that were opened
STAT connection_structures 13 Number of connection structures allocated by the server
STAT cmd_get 54 Execute Get Command Total
STAT Cmd_set 34 Execute SET command total
STAT Cmd_flush 3 points to the total number of FLUSH_ALL commands
STAT get_hits 9 Get hit count
STAT get_misses number of Get misses
STAT delete_misses 5 Delete misses
STAT delete_hits 1 Delete hit count
STAT incr_misses 0 incr number of misses
STAT incr_hits 0 incr hit count
STAT decr_misses 0 decr number of misses
STAT decr_hits 0 DECR hit count
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 number (bytes)
STAT Accepting_conns 1 Number of links currently accepted
STAT Listen_disabled_num 0
STAT Threads 4 Thread Count
STAT Conn_yields 0
STAT bytes 0 Stores the item byte number
STAT Curr_items 0 Item number
STAT total_items Total number of item
STAT evictions 0 To get the total amount of space deleted item
This article is from the "Green Years" blog, be sure to keep this source http://alex233.blog.51cto.com/8904951/1860255
memcached Linux Install and start memcached