0

I just installed CentOS 7, with Apache 2, PHP 5.6. I also installed memcached, but it keeps failing after a few hours of usage, so I have to restart it at least 3 times a day.

[root@myserver log]# systemctl status memcached
● memcached.service - Memcached
   Loaded: loaded (/usr/lib/systemd/system/memcached.service; enabled; vendor preset: disabled)
   Active: failed (Result: signal) since Sun 2017-07-30 22:23:06 -05; 2h 25min ago
  Process: 26572 ExecStart=/usr/bin/memcached -u $USER -p $PORT -m $CACHESIZE -c $MAXCONN $OPTIONS (code=killed, signal=KILL)
 Main PID: 26572 (code=killed, signal=KILL)

Jul 30 22:23:06 myserver memcached[26572]: <146 get 404c6f93ca60c76ebb7726a13...f
Jul 30 22:23:06 myserver memcached[26572]: >146 END
Jul 30 22:23:06 myserver memcached[26572]: <51 connection closed.
Jul 30 22:23:06 myserver memcached[26572]: <74 get a7f18fd516cd715c85e2c1e049...9
Jul 30 22:23:06 myserver memcached[26572]: >74 sending key a7f18fd516cd715c85...9
Jul 30 22:23:06 myserver memcached[26572]: >74 END
Jul 30 22:23:06 myserver memcached[26572]: <111 get 85f6b002ccbc678d0d0039d04...9
Jul 30 22:23:06 myserver memcached[26572]: >111 END
Jul 30 22:23:06 myserver systemd[1]: Unit memcached.service entered failed state.
Jul 30 22:23:06 myserver systemd[1]: memcached.service failed.

This is the content of /etc/sysconfig/memcached (it is not logging anything in the defined file):

PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS="-vv >> /var/log/memcached.log 2>&1"

The main issue is how to avoid the constant failing of the service. Any ideas? Thanks.

Andres SK
  • 228
  • 3
  • 7
  • 21

1 Answers1

0

Does "journalctl -u memcached" returns something? Looks like its process getting killed rather than crashes by itself {Main PID: 26572 (code=killed, signal=KILL)} Do you see any messages from OOM killer in /var/log/messages?

curious
  • 11
  • 3
  • Yes, these are the last 2 lines logged in the journal before the process gets killed: `Jul 30 22:23:06 myserver systemd[1]: Unit memcached.service entered failed state.`, `Jul 30 22:23:06 myserver systemd[1]: memcached.service failed.` -- but I have no idea why this is happening. – Andres SK Jul 31 '17 at 14:59
  • it seems that the google crawler, while trying to index our site, is accessing lots of pages that actually use memcached, so it ends up entering a failed state. Do you think it could be memory related? – Andres SK Jul 31 '17 at 18:05
  • Yes, probably it is memory related. Thats why I advised to check messages from OOM Killer. OutOfMemory Killer is system process designed to watch after free memory and kill most memory consuming process on free memory shortage – curious Aug 01 '17 at 07:40
  • hi again, could it be possible that this issue gets fixed by configuring a swap disk? – Andres SK Aug 29 '17 at 15:12