ihsn / nada

National Data Archive (NADA) is an open source data cataloging system that serves as a portal for researchers to browse, search, compare, apply for access, and download relevant census or survey information. It was originally developed to support the establishment of national survey data archives.
http://nada.ihsn.org
MIT License
38 stars 10 forks source link

v5.4.1 - Sessions folder causing Inodes to reach 100% #112

Open t3chbg opened 3 weeks ago

t3chbg commented 3 weeks ago

We recently found an issue with Inodes reaching 100% on nada webserver even though there is sufficient free disk space on root but Inodes are full. The culprit is the Sessions folder - Detailed Inode usage for: /var/www/html/nada5.4.1/files/sessions Total: 7057174 and Folder size du -hs /var/www/html/nada5.4.1/files/sessions 553M.

Please advise what is the purpose of the sessions folder and if its possible to delete and create the it or prune files routinely via cronjob so that this issue doesn't reoccur in future?

mah0001 commented 3 weeks ago

NADA uses the folder to store the temporary session files. Looks like the old session files are not cleaned up automatically. You should remove all files from the session folder and then set up a corn job to delete any files older than a day.

With the number of files you have in the folder, running rm -rf might not work or take too long (hour or longer). You can try using this command below, it would still take time but it would be much faster:

# go to the NADA root and switch to the 'files' folder

# create a temporary folder
$ mkdir sessions-tmp

# run 
$ rsync -a --delete sessions-tmp/ sessions/