Initial solution of memcached configuration parameters
First, the basic parameters
When we first installed memcached, this command was generally used:
| memcached-m 512-u root-d-l 127.0.0.1-p 11211 |
Let's take a look at the meanings of these parameters respectively:
- m Specifies the maximum amount of memory used by the cache in megabytes, which is 64MB by default
-u Specifies this parameter only when run as root
-D runs in daemon form
-l Specifies the address of the listener
-p Specifies the TCP port number to listen on, default is 11211
Second, the other commonly used parameters
-t specifies the number of threads, the default is 4
-H Printing Help information
-c Maximum number of simultaneous connections, default is 1024.
-u Specifies the UDP port number to listen on, default is 11211
-M displays an error when running out of memory instead of deleting an item
The first "-D" parameter needs further explanation.
-D Install installation memcached
-D Uninstall Uninstall memcached
-D Start memcached service
-D Restart Restart memcached service
-D Stop Stop memcached service
-D Shutdown Stop memcached service
Three, more parameters
Use "-H" to understand it ~
Iv. experience in using the service software
Write here, and finally say. In the use of any software, the first thing to pay attention to such points:
1. Printing Help information:
This is generally "-h", of course, there is a need for "-help" can be.
2. command to start, stop, restart/reload the configuration:
Note that the different parameters of the same command are identified, or different commands or scripts are used.
3. Configuration
First, start whether the configuration file is required.
Second, if it is relatively large software, usually need configuration file, then the default configuration file where to be clear.
Again, specify the format of the command to load the configuration file.
4. Specify the use of memory capacity, number of threads, hard disk capacity, etc.
Whether there are configuration parameters for this need to be specified, and how to set up.
5. log files
First, whether there are log files that need to be stored.
Second, if there is a log file, what is the default storage directory.
Finally, manually specify the command format for the log file.
6. Maximum number of connections
First, whether to provide a listening connection service.
Second, if provided, the default maximum number of connections.
Finally, specify the command format for the maximum number of connections manually.
Getting Started with memcached (ii)