Content
View differences
Updated by Oliver Günther over 6 years ago
(This might be better aimed at the docker project, but since that one looks dead, here it is for the moment…)
In the community docker container (https://hub.docker.com/r/openproject/community/), when the environment variable CACHE\_MEMCACHE\_SERVER is set pointing to a different location, it is expected that the memcached service in the container would not be launched at all. Instead, it is launched and even enters RUNNING state in the logs.
That wastes resources (negligible cpu and memory, I know), uses up a port (which is not a big deal inside a nat-ed container, but it’s a huge one in host-network mode as it will certainly conflict with a more “noble” instance of memcached the admin has running in the host on the default port) and, above all, causes a bit of trouble when we’re debugging random issues (how many memcached services do I have in this machine really? should be the one, but the app’s sessions are not turning up there, so I’m gonna have to check **all** containers, **all** services and **all** ports just to be sure..hmpf).
The above reasons are pretty weak, I know, but given that the solution is even simpler, this should not cause too much trouble:
if “cache\_memcache\_server option/env” is not set, then
- set it to point to localhost;
- start memcached service;
end
You probably already have that logic somewhere, but the service start is outside of the if-body. ;-)
Thanks
In the community docker container (https://hub.docker.com/r/openproject/community/), when the environment variable CACHE\_MEMCACHE\_SERVER is set pointing to a different location, it is expected that the memcached service in the container would not be launched at all. Instead, it is launched and even enters RUNNING state in the logs.
That wastes resources (negligible cpu and memory, I know), uses up a port (which is not a big deal inside a nat-ed container, but it’s a huge one in host-network mode as it will certainly conflict with a more “noble” instance of memcached the admin has running in the host on the default port) and, above all, causes a bit of trouble when we’re debugging random issues (how many memcached services do I have in this machine really? should be the one, but the app’s sessions are not turning up there, so I’m gonna have to check **all** containers, **all** services and **all** ports just to be sure..hmpf).
The above reasons are pretty weak, I know, but given that the solution is even simpler, this should not cause too much trouble:
if “cache\_memcache\_server option/env” is not set, then
- set it to point to localhost;
- start memcached service;
end
You probably already have that logic somewhere, but the service start is outside of the if-body. ;-)
Thanks