Skip to content

Conversation

@josvandervelde
Copy link
Member

Updated the php settings to similar values as production.

The main time-drain was garbage collection. On production, /usr/lib/php/sessionclean is ran from crontab but.. it does not clean the code igniter sessions! Those sessions are only cleaned after a reboot:

[user]@openml2:~$ find /tmp -name "ci_session*" -type f -printf '%T+ %p\n' | sort | head -n 5 2>/dev/null
2025-04-14+13:01:16.5844657760 /tmp/ci_sessionib0csl6lo5l776dd19ee0vcbv41jff9t
2025-04-14+13:01:19.2861908390 /tmp/ci_sessionh5cvaku1esmps8o0pv0nsl7gh43rccnd
2025-04-14+13:01:19.7101894730 /tmp/ci_session51jqq0h2gnh0bq4f4vse6239efjhrrac
2025-04-14+13:01:19.7861892280 /tmp/ci_sessionv2ebsskm2lveutqcfg0eh9o9c15bhr07
2025-04-14+13:01:19.8541890090 /tmp/ci_sessioniqadqra76osd3vvcp9d1fh7b5i97o9vu

[user]@openml2:~$ uptime
 up 97 days

I did not fix this on current production. It is now fixed for the new deployment, as far as I can see. I tested it by setting session.gc_maxlifetime=10 (seconds) and using openml-services (docker compose).

It would be great if anyone with some knowledge of PHP and Code Igniter garbage collection / session handling could take a look at this!

@josvandervelde
Copy link
Member Author

Hi @janvanrijn @joaquinvanschoren , it would be great if you could review this! These settings should be production-ready.

@joaquinvanschoren
Copy link
Contributor

Looks good. This is only for docker, right? It doesn't affect the currently running production server?

Copy link
Contributor

@joaquinvanschoren joaquinvanschoren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This looks fine as far as I can tell. Just left one note to make sure we can merge or not.

; Production Value: 1
; https://php.net/session.gc-probability
session.gc_probability = 1
; 2025-06-20 (Jos) - As in current production, we will run garbage collection manually, to avoid 1/1000th chance of 2sec delay (TODO, DONT MERGE LIKE THIS!!)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still a TODO or do you think we can merge it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants