Modifying Memcached Configuration
Modify Memcached parameters to ensure sufficient resources for processing a large number of concurrent requests.
The parameters include the number of threads, concurrent requests, and memory usage. The number of threads must be the same as the number of cores. The default number of concurrent requests is 1024. Change the value to 102400 for higher concurrency.
1 | memcached -t 48 -p 11211 -u root -m 196608 -c 102400 -d |
Parameter |
Description |
|---|---|
-t <num> |
Specifies the number of used threads. (48 indicates that 48 threads are used.) |
-p <num> |
Specifies the TCP listening port. |
-u <username> |
Specifies the user to which the process belongs. Only the root user can use this parameter. |
-m <num> |
Specifies the size (in MB) of the memory allocated to the Memcached instance. |
-c <num> |
Specifies the maximum number of concurrent connections. |
-d |
Runs as a daemon process. |