Use memcache in windows and modify the maximum memory usage of memcache

Source: Internet
Author: User

Decompress the memcache Server installation package to the C: \ memcached folder and use the cmd command window to install the package.
 
1> Start> Run: CMD (OK)
 
2> cd C: \ memcached (Press ENTER)
 
3> memcached-d install (Press enter to execute the installation)
 
4> memcached-d start (Press enter to start the memcache server. The default memory is 64 MB and port 11211 is used)
 
 
Now the memcache server can be used normally.
 
 
 
Because the 32-bit system can only handle 4G memory addressing, 2-3 processes can be run on 32-bit servers with 4G memory and monitored on different ports.
 
Another example is memcached-d-m 10-u root-l 192.168.105.73-p 12000-c 256-P/tmp/memcached. pid.
 
 
Plain code
-D option is to start a daemon,
-M indicates the amount of memory allocated to Memcache. The unit is MB. Here I am 10 MB,
-U is the user who runs Memcache. Here I am root,
-L is the IP address of the listening server. If there are multiple IP addresses, I have specified the IP address 192.168.105.73,
-P is the port for Memcache listening. I have set port 12000 here, preferably port 1024 or above,
-The "c" option is the maximum number of concurrent connections. The default value is 1024. I have set 256 here, which is based on the load of your server,
-P is the pid file for saving Memcache. Here I am saving it in/tmp/memcached. pid
 
Memcache server security:
 
The Memcache server directly performs operations after being connected through the client without any verification process. In this way, it is dangerous to directly expose the server to the Internet, if data leaks are viewed by irrelevant persons, the server may be infiltrated. Besides, some unknown bugs or buffer overflow may exist, which are unknown to us, so the danger is foreseeable. To ensure security, we provide two suggestions to slightly prevent hacker intrusion or data leakage.
 
The following describes how to modify the configuration of the memcache Server:
 
1> web application server calls are provided using an intranet ip address. Direct calls through the Internet are not allowed, for example, placing the memcache server on the server 192.168.1.55.
 
2> modify the port, for example, to 11200.
 
3> allocate memory, for example, allocate 1024 MB (1 GB memory)
The method is as follows:
 
1> Start> Run: regedit (Press ENTER)
 
2> in the registry, find HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ memcached Server.
 
3> the default ImagePath key value is: "c: \ memcached \ memcached.exe"-d runservice, changed to: "c: \ memcached \ memcached.exe "-d runservice-m 512-p 11200-l 192.168.1.55 (OK, close the registry)
 
4> right-click my computer> Manage> Find the memcache service and restart it to take effect.
 
You can use MemAdmin written in php to monitor the running status of memcahce.

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.