ckulka / baikal-docker

Provides a ready-to-go Baikal server, incl. docker-compose.yml & Systemd service file
https://hub.docker.com/r/ckulka/baikal
MIT License
367 stars 46 forks source link

PHP Sessions are not cleaned up #211

Closed inqode-lars closed 3 weeks ago

inqode-lars commented 4 months ago

Hi there,

we are noticing that /var/lib/php/sessions gets spammed with sessions over time. Every few months we have to kill our pod because it taking too much inodes because of too many session files (currently 3226291).

Executing the script from /etc/cron.d/php could clean up the session. Maybe it would be a good idea to add cron to the images and start it using /docker-entrypoint.d/ ?

ckulka commented 3 months ago

Hi @inqode-lars, can you share which PHP command you execute to clear the sessions without restarting the pod?

I would prefer not to add cron to the images, but instead add a schedule on the Docker host to execute the command in the container: https://docs.docker.com/reference/cli/docker/container/exec/

If you run Baikal in a Kubernetes cluster as a deployment (given you said "pod"), I would add a CronJob that executes that command in the pod. Alternatively, the CronJob can terminate the pod, since the deployment will immediately start a new pod to replace the old one. It may not be as fast as running the cleanup command inside the container, but I'd check if it's fast enough and easier to maintain.

github-actions[bot] commented 1 month ago

This issue looks inactive, I will close it in 7 days.

github-actions[bot] commented 3 weeks ago

Closing this issue due to inactivity.