Reference: callback/
Refer:
Http://www.linuxidc.com/Linux/2010-08/28100.htm
Http://www.linuxidc.com/Linux/2010-04/25543.htm
This chapter focuses on installation. Click here for a test ticket
Test Memcached service http://www.linuxidc.com/Linux/2012-08/69316.htm on Ubuntu and Windows
Many large load sites around the world use Memcache as a cache service to share the pressure on database servers.
Memcache is the project name and memcached is the service name. It makes a lot of new contacts feel inexplicable. I personally think it is more correct to use the former.
Like database development, Memcache is divided into two parts: Memcache server and client. The Memcache server runs as a Service. The creation, storage, and deletion of all data caches are actually completed here. Client, here we refer to extensions that can be called by PHP, C, and Java applications.
Installation on Ubuntu:
Sudo apt-get installmemcached
After the installation, memcached will be automatically started. Listen on port 11211 and check the command ps-ef | grep memcached.
After installing the Memcache server, we need to specify the parameter to start the service:
Memcached-d-m 128-p 11111-u root
Here we need to describe the memcached service startup parameters:
-P listening port
-L connected IP address. The default value is local
-D start: start the memcached service.
-D restart: restart the memcached service.
-D stop | shutdown the running memcached Service
-D install the memcached Service
-D uninstall memcached Service
-U runs as the identity (only valid when running as root)
-MB maximum memory usage, in MB. The default value is 64 MB.
-An error is returned when M memory is used up, instead of deleting items.
-C: Maximum number of simultaneous connections. The default value is 1024.
-F block size growth factor. The default value is 1.25-n. The minimum allocation space is 48 for key + value + flags.
-H Show Help
Remember to modify the parameters:
/Etc/memcached. conf andsearch-L 127.0.0.1And replace it-L 0.0.0.0
Installation DetailsHttp://www.linuxidc.com/Linux/2012-04/58596.htm
If the system cannot find the memcache installation package
Update Software Source
You can use any source image in the following list to add a line to your/etc/apt/sources. list file as follows:
Deb http://security.ubuntu.com/ubuntu hard-security main universe
Reinstallation
- Sudo apt-get update ---- update source operation
- Sudo apt-get install memcache
Check whether the installation is successful.
-----
After the installation is successful, memcache starts itself. Check the process
Ps-aux
A record is found.
/Usr/bin/memcached-m 64-p 11211-u nobody-l 127.0.0.1
Memcached port 11211 user nobody address 127.0.0.1 is displayed to connect to the memcached server.
Telnet fig 11211
Enter
Stats
The parameters of the current memcached are displayed ..
- Sysadmin @ ubuntu:/etc/apt $ telnet fig 11211
- Trying 127.0.0.1...
- Connected to 127.0.0.1.
- Escape character is '^]'.
- Stats
- STAT pid 3065
- Statuptime 170
- STAT time 1334121278
- STAT version 1.4.7
- STAT libevent 2.0.12-stable
- STAT pointer_size 64
- STAT rusage_user 0.004000
- STAT rusage_system 0.000000
- STAT curr_connections 5
- STAT total_connections 7
- STAT connection_structures 6
- STAT performance_get 0
- STAT performance_set 0
- STAT 1__flush 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 auth_cmds 0
- STAT auth_errors 0
- STAT bytes_read 140
- STAT bytes_written 856
- STAT limit_maxbytes 67108864
- STAT accepting_conns 1
- STAT listen_disabled_num 0
- STAT threads 4
- STAT conn_yields 0
- STAT bytes 0
- STAT curr_items 0
- STAT total_items 0
- STAT evictions 0
- STAT reclaimed 0
- END
Manually start memcached
- Memcached-d-m 128-l 127.0.0.1-p 11211-u root
Start memcache with a root user allocated a maximum of 2 gm memory
- Memcached-d-m 128-l 127.0.0.1-p 11212-u root
Start another memcache instance on port 11212.
--------------------------------------------------------------------
Installation on Windwos:
1. Extract to the specified directory, such as: C: \ Memcached \ memcached-win32-1.4.4-14.
2. Open the command window with cmd, go to the decompressed directory, and enter unzip memcached.exe-d install ".
3. Open the control panel and open the service. You can see that memcached is already available. If it is not started, start it manually.
4. You can also modify the startup parameters in the registry.
"D: \ memcached-1.2.6-win32-bin \ memcached.exe"-d runservice-l 127.0.0.1-m 1024-c 2048
5. Perform the telnet 127.0.0.1 11211 test and start to display nothing. Press enter and enter the command stats to view the statistics, as shown in figure