Install Memcached on Ubuntu and Windows

Source: Internet
Author: User
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

  1. Sudo apt-get update ---- update source operation
  2. 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 ..

  1. Sysadmin @ ubuntu:/etc/apt $ telnet fig 11211
  2. Trying 127.0.0.1...
  3. Connected to 127.0.0.1.
  4. Escape character is '^]'.
  5. Stats
  6. STAT pid 3065
  7. Statuptime 170
  8. STAT time 1334121278
  9. STAT version 1.4.7
  10. STAT libevent 2.0.12-stable
  11. STAT pointer_size 64
  12. STAT rusage_user 0.004000
  13. STAT rusage_system 0.000000
  14. STAT curr_connections 5
  15. STAT total_connections 7
  16. STAT connection_structures 6
  17. STAT performance_get 0
  18. STAT performance_set 0
  19. STAT 1__flush 0
  20. STAT get_hits 0
  21. STAT get_misses 0
  22. STAT delete_misses 0
  23. STAT delete_hits 0
  24. STAT incr_misses 0
  25. STAT incr_hits 0
  26. STAT decr_misses 0
  27. STAT decr_hits 0
  28. STAT cas_misses 0
  29. STAT cas_hits 0
  30. STAT cas_badval 0
  31. STAT auth_cmds 0
  32. STAT auth_errors 0
  33. STAT bytes_read 140
  34. STAT bytes_written 856
  35. STAT limit_maxbytes 67108864
  36. STAT accepting_conns 1
  37. STAT listen_disabled_num 0
  38. STAT threads 4
  39. STAT conn_yields 0
  40. STAT bytes 0
  41. STAT curr_items 0
  42. STAT total_items 0
  43. STAT evictions 0
  44. STAT reclaimed 0
  45. END

Manually start memcached

  1. 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

  1. 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

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.