The Short Answer:
is it possible to remove APCu and Memcached?
Yes
is it possible to do it safely without destroying the server?
Yes
is it such a stupid idea to remove them?
Well, it depends
The Longer one:
Memcached
is an extra daemon
Memcached is a flexible memory object caching daemon designed to alleviate database load in dynamic web applications by storing objects in memory.
It's based on libevent to scale to any size needed, and is specifically optimized to avoid swapping and always use non-blocking
I/O.
It will only Consume the Memory as defined down below (in my case 512mb)
You have multiple options, on how to use and even to remove it. Due to I use Debian, the following one is the usually one.
BUT Remind, you have to remove that also from your Application. Else it can either break or do wired things.
Debian
apt remove memcached
This does not remove the Configs, you may want to add --purge
to that above command to remove it completely.
CentOS
yum remove <package>
In case you don't find the correct name, use
yum list installed |grep <name>
memcached.conf
# memcached default config file
# 2003 - Jay Bonci <[email protected]>
# This configuration file is read by the start-memcached script provided as
# part of the Debian GNU/Linux distribution.
# Run memcached as a daemon. This command is implied, and is not needed for
the
# daemon to run. See the README.Debian that comes with this package for more
# information.
-d
# Log memcached's output to /var/log/memcached
logfile /var/log/memcached.log
# Be verbose
# -v
# Be even more verbose (print client commands as well)
# -vv
# Start with a cap of 64 megs of memory. It's reasonable, and the daemon
default
# Note that the daemon will grow to this size, but does not start out
holding this much
# memory
-m 64
# Default connection port is 11211
-p 11211
# Run the daemon as root. The start-memcached will default to running as
root if no
# -u command is present in this config file
-u memcache
# Specify which IP address to listen on. The default is to listen on all IP
addresses
# This parameter is one of the only security measures that memcached has, so
make sure
# it's listening on a firewalled interface.
-l 127.0.0.1
-l [::1]
# Limit the number of simultaneous incoming connections. The daemon default
is 1024
# -c 1024
# Lock down all paged memory. Consult with the README and homepage before
you do this
# -k
# Return error when memory is exhausted (rather than removing items)
# -M
# Maximize core file limit
# -r
Conclusion
Let's go again on your Point
- is this a bad idea to remove them?
It depends on the use case due to the fact it should improve the Performance. Even on my Smallest LXC Container (1CPU/128MB Ram), it is Possible, to run php-apc and memcached without problems. And Moreover, both “Caches” are limited by a Configuration item into the Maximum usage of RAM.
As Already stated, I still think that there might be a X-and-Y-Problem
Since you did not provide additional information at the moment, but 3 Questions. So far, I answered this at the moment of the current state.