- Posts: 409
- Thank you received: 34
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Session Files
- blocka
- Topic Author
- Offline
- Platinum Member
Less
More
3 months 2 weeks ago #254311
by blocka
Session Files was created by blocka
I'm running the latest version of LS 5.x and I'm storing session files on the file system. I'm seeing I have about 12 gigs of session files, dating back over 4 months.
Is there any good reason not to purge these session files after some period of time (eg: if they are more than a month old)? Why are session files sticking around for months? What is their purpose?
Is there any good reason not to purge these session files after some period of time (eg: if they are more than a month old)? Why are session files sticking around for months? What is their purpose?
Please Log in to join the conversation.
- blocka
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 409
- Thank you received: 34
3 months 4 days ago #254889
by blocka
Replied by blocka on topic Session Files
Bumping this ... wondering if anyone has any insight?
Please Log in to join the conversation.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
3 months 4 days ago #254891
by jelo
Depending on your webstack setup the php session settings could be something between global and appwise.
Check the session path and check the settings when the garbage collector marks the session files for deleting in one of the next runs.
www.php.net/manual/en/session.configurat...ssion.gc-maxlifetime
Perhaps the session folder you're looking at is no longer used and the old sessions files aren't removed anymore.
If the folder is correct and you are sure that the session files are from LimeSurvey, you can remove older session files. The files older than the max lifetime of the session are no longer used. Monitor if the files pile up again.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Session Files
How do you know that these are session files of LimeSurvey?I'm running the latest version of LS 5.x and I'm storing session files on the file system. I'm seeing I have about 12 gigs of session files, dating back over 4 months.
Depending on your webstack setup the php session settings could be something between global and appwise.
Check the session path and check the settings when the garbage collector marks the session files for deleting in one of the next runs.
www.php.net/manual/en/session.configurat...ssion.gc-maxlifetime
Perhaps the session folder you're looking at is no longer used and the old sessions files aren't removed anymore.
If the folder is correct and you are sure that the session files are from LimeSurvey, you can remove older session files. The files older than the max lifetime of the session are no longer used. Monitor if the files pile up again.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Please Log in to join the conversation.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
3 months 3 days ago - 3 months 3 days ago #254908
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Session Files
Sometimes it can be interesting to have some cron job to delete php session files
stackoverflow.com/questions/654310/cleanup-php-session-files
on debian
stackoverflow.com/questions/654310/cleanup-php-session-files
on debian
Code:
09,39 * * * * root [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 3 months 3 days ago by DenisChenu. Reason: on debian
Please Log in to join the conversation.
- blocka
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 409
- Thank you received: 34
3 months 2 days ago #254959
by blocka
Replied by blocka on topic Session Files
Thanks for the guidance. The session files are definitely for LS, as they are in a custom path local to the hosting account:
/home/account/sessions/
Instead of the default server PHP session file path, which was on a small partition.
Based on your guidance, I'll run a script that purges session files that are older than 4 days (which is well past the garbage collector window). Not sure why the collector isn't clearing out the files, but that's for another day.
/home/account/sessions/
Instead of the default server PHP session file path, which was on a small partition.
Based on your guidance, I'll run a script that purges session files that are older than 4 days (which is well past the garbage collector window). Not sure why the collector isn't clearing out the files, but that's for another day.
Please Log in to join the conversation.
- JiyaHana
- Offline
- New Member
Less
More
- Posts: 13
- Thank you received: 2
3 months 1 day ago #254973
by JiyaHana
Replied by JiyaHana on topic Session Files
Sessions files typically store temporary data and keeping them for extended period might not be necessary. You can safely set up a crone job or scheduled task to delete session files older than a month.
Ex.
Ex.
Code:
find /path/to/session/files -type f -name "sess_*" -mtime +30 -exec rm {} \;
Please Log in to join the conversation.