A
A
Arthur2018-04-29 13:31:44
Network administration
Arthur, 2018-04-29 13:31:44

Optimal memcache settings on VPS?

Good afternoon.
1) Installed Memcache and then Memcached PHP Extension.
What are the optimal parameters to set in the etc/sysconfig/memcached file:

PORT="11211"
USER="memcached"
MAXCONN=""
CACHESIZE=""
OPTIONS=""

If the memory is on the VPS:
55062b7ce764.jpg
The site whose instructions I used had the following data:
MAXCONN="2048" Maximum number of connections
CACHESIZE="4096" The amount of actual RAM on the server
And by analogy, I set MAXCONN = 25000, CACHESIZE = 50000. Right?
2) How can you make sure that memcache and memcached PHP are caching everything normally? Maybe there is a command for ssh or a specific directory where you can look...
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
stepgr, 2018-05-29
@stepgr

one.

The MAXCONN, CACHESIZE and OPTIONS parameters are selected experimentally depending on the nature of the load and on the available resources.
You can estimate the amount of memory required for caching (the CACHESIZE parameter) by the size of your file cache. If your project has a file cache of 3 GB, then using memcached with 256 MB of memory will not be effective due to frequent ousting.

Taken from here: https://dev.1c-bitrix.ru/learning/course/?COURSE_I...
If you give all the memory to memcached, then there will be nothing left for the rest.
2. For "to make sure it works" use https://github.com/lagged/memcache.php
This script shows the usage of allocated cache memory. Those. periodically monitoring the status, you can estimate, add, or vice versa, remove the amount of memory allocated for memcached

I
ivankomolin, 2018-05-17
@ivankomolin

There is no universal setting rule.
You just need to understand what these numbers are:
MAXCONN is approximately the number of simultaneous connections that the server will work out in pcs.
CACHESIZE - size of space in RAM in MB.
Therefore, find out how much free RAM you have, estimate how much you can allocate for memcached and write.
For some reason, I doubt that you have 50GB of RAM on your VPS, so find out this point before writing 50000.
Just an installed and configured memcached server does not cache anything by itself.
Caching is done within the application.
Look there (installed the cache, read the cache) if it works, then it works "normally")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question