Session GC has always been a problem as it's slow in PHP (due to the lack of keys only queries and good multi functions), so this seeks to address the problem.
Included is a Cloud Functions that if deployed in the same project will clear sessions older than "SESSION_DURATION" (environment variable needed when deploying the function).
It is designed to be triggered by Cloud Scheduler.
From our testing, it can clear roughly 100 sessions per second.
It is recommended to increase the function execution timeout to the max (540 seconds) and set the maximum execution limit to 1.
Session GC has always been a problem as it's slow in PHP (due to the lack of keys only queries and good multi functions), so this seeks to address the problem.
Included is a Cloud Functions that if deployed in the same project will clear sessions older than "SESSION_DURATION" (environment variable needed when deploying the function).
It is designed to be triggered by Cloud Scheduler.
From our testing, it can clear roughly 100 sessions per second.
It is recommended to increase the function execution timeout to the max (540 seconds) and set the maximum execution limit to 1.