greektranslator

Well-Known Member
Jun 5, 2011
71
0
56
Greece
cPanel Access Level
Root Administrator
I have installed Memcache/Memcached on CentOS 7 following
Code:
yum install ea4-experimental
yum install ea-php72-php-memcache
yum install ea-php72-php-memcached

And also for php73.
And I wonder where I can find the config files and which settings would be appropriate and if there are different config files for each php version.
 
Last edited:

cPanelLauren

Technical Support Community Manager
Staff member
Nov 14, 2017
13,304
1,247
313
Houston
You shouldn't need to install the experimental repo for Memcache or Memcached anymore. It's available in the EA4 repo now. You should be able to find the .ini file for Memcached at /opt/cpanel/ea-php72/root/etc/php.d/memcached.ini and /opt/cpanel/ea-php72/root/etc/php.d/memcache.ini
 

greektranslator

Well-Known Member
Jun 5, 2011
71
0
56
Greece
cPanel Access Level
Root Administrator
I get this issue when I check its status:

service memcached status

Code:
service memcached status
 memcached.service - Memcached
   Loaded: loaded (/usr/lib/systemd/system/memcached.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2020-05-07 21:45:41 EEST; 29min ago
 Main PID: 7556 (code=exited, status=64)

May 07 21:45:41 host.translatum.gr systemd[1]: Started Memcached.
May 07 21:45:41 host.translatum.gr memcached[7556]: Cannot set item size limit higher than 1/2 of memory max.
May 07 21:45:41 host.translatum.gr systemd[1]: memcached.service: main process exited, code=exited, status=64/n/a
May 07 21:45:41 host.translatum.gr systemd[1]: Unit memcached.service entered failed state.
May 07 21:45:41 host.translatum.gr systemd[1]: memcached.service failed.
 

cPanelLauren

Technical Support Community Manager
Staff member
Nov 14, 2017
13,304
1,247
313
Houston
The item size limit by default is noted here 16.2.5Â memcached FAQ how much memory do you have or have you changed this setting?

Defaults are as follows (from my own server running Memcached:
Code:
[[email protected] public_html]# ps faux |grep memcache[d]
memcach+  3846  0.0  0.0 441152  1168 ?        Ssl  May07   0:18 /usr/bin/memcached -u memcached -p 11211 -m 64 -c 1024 -l 127.0.0.1,::1
cpanel-+  4570  0.0  0.0 451220  1204 ?        Sl   May07   0:44  \_ memcached -U 0 -s ./data/Logs/state/memcache.sock
Looks like those specific settings are at:
Code:
[[email protected] public_html]# cat /etc/sysconfig/memcached
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS="-l 127.0.0.1,::1"
 

greektranslator

Well-Known Member
Jun 5, 2011
71
0
56
Greece
cPanel Access Level
Root Administrator
So, nothing should be changed at memcached.ini?

In /etc/sysconfig/memcached I have

Code:
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="1GB"
OPTIONS="-l 127.0.0.1,::1"
I changed the "1GB" to 64 and now I get the below. I thought 1GB is a higher value, or not?

Code:
service memcached restart
Redirecting to /bin/systemctl restart memcached.service
[[email protected] ~]# service memcached status
Redirecting to /bin/systemctl status memcached.service
● memcached.service - Memcached
   Loaded: loaded (/usr/lib/systemd/system/memcached.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2020-05-09 08:24:58 EEST; 11s ago
 Main PID: 28116 (memcached)
   CGroup: /system.slice/memcached.service
           └─28116 /usr/bin/memcached -u memcached -p 11211 -m 64 -c 1024 -l ...