linux install memcached1.4.25

### Download memcached
wget http://memcached.org/files/memcached-1.4.25.tar.gz

### Install libevent
yum install libevent-devel.x86_64 -y

### Decompress Memcached
tar -zvxf memcached-1.4.25.tar.gz

### Enter the memcached directory
cd memcached-1.4.25

### Set the installation location
./configure --prefix=/opt/apps/memcached

### Install 
make & make install

### start up
cd /opt/apps/memcached/bin

./memcached -d -m 256 -u root -p 11211 -c 1024 –P /tmp/memcached.pid

### Parameter Description:
-p TCP port to listen on (default: 11211)  
-U UDP port to listen on (default: 11211, 0 means not listening)  
-s UNIX socket path to listen on (disables network support)  
-a UNIX socket access mask, octal number (default: 0700)  
-l The listening IP address. (default: INADDR_ANY, all addresses)  
-d Run as a daemon.  
-r Maximum core file limit.  
-u Sets the user the process belongs to. (Only root user can use this parameter)  
-m Maximum available memory for a single data item, in MB. (default: 64MB)  
-M Error when memory runs out. (no data will be deleted)  
-c Maximum number of concurrent connections. (default: 1024)  
-k Locks all memory pages. Pay attention to the upper limit of memory you can lock.  
              Attempts to allocate more memory will fail, so keep an eye on the user-allocable memory limit used when starting the daemon.  
              (Not the previous -u parameter; under sh, use the command "ulimit -S -l NUM_KB" to set.)  
-v prompt information (print error/warning information in the event loop.)  
-vv verbose (also prints client commands/responses)  
-vvv super verbose (also print internal state changes)  
-h Print this help message and exit.  
-i Print licenses for memcached and libevent.  
-P saves the process ID to the specified file, only meaningful when the -d option is used.  
-f Block size growth factor. (default: 1.25)  
-n Minimum space allocated to key+value+flags (default: 48)  
-L Attempt to use large pages if available. Increasing the memory page size can reduce the number of "page table buffer (TLB)" losses and improve operating efficiency.  
              To obtain huge pages from the operating system, memcached allocates all data items into one large block.  
-D Use as prefix and delimiter for IDs.  
              This is used to get status reports by prefix. The default is ":" (colon).  
              If this parameter is specified, the status collection will be automatically enabled; if not specified, the command "stats detail on" needs to be used to enable it.  
-t Number of threads to use (default: 4)  
-R The maximum number of requests each connection can handle.  
-C disables CAS.  
-b sets the length of the background log queue (default: 1024)  
-B bind protocol - possible values: ascii,binary,auto (default)  
-I Override each data page size. Adjust the maximum size of the data item.  


### View process
ps aux|grep memcached

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326880974&siteId=291194637