-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[critical] K or kweb or something opens up too many files on fslweb #19
Comments
I guess anon folder is for saving unregistered users' files. If this is the case, we should remove those files once anonymous user's session ends (or for example after 24 hours) Right now we have ~1M (925975) files in /srv/kweb/kfiles/anon folder. |
Also we have this function: def get_file_meta(): I'm not sure whether python automatically closes these files or not. |
Python's garbage collector is supposed to close file handles. I'm not sure why that isn't happening if it is a Python issue. The garbage collector is definitely working because our memory isn't infinitely growing. |
then that is most probably not the the problem :) |
It still may be the issue 👍 ... could be a bug in Python or maybe we're running a really old version. I agree with you that we need to do file cleanup though, it's been on my list for a while but right now it's just a manual thing. Worth noting the anon folder has reached over 10GB before (~1 year of use) with no problems. I did clean up all the files a few days before the crash so maybe this was somehow a consequence of that. Going to be hard to say without some more investigation. |
One thing that I've noticed in the file list that Joel sent is that all files in for example ./kweb/kfiles/anon/8a9dfe95-fe26-4883-b974-c239b2db4064/ were open on the server. The only command that I've find so far in your code that touces all those files is shutil.copytree but that does not help |
oh I just realized that Joel said that those files were 'created' not 'open'. Do you have access to list of currently open files on server ? I do not have. |
You can do sudo lsof if you have root access. Nothing out of the ordinary there right now, well under 7k files open. |
Hmmm |
So as far I investigated, no new files get opened over time. But just in case, I created a cronjob to look for new files that are open, everyday. |
Guys, if we should get a new fslweb machine/server, please let me know. Grigore From: Philip Daian [[email protected]] It still may be the issue [:+1:] ... could be a bug in Python or maybe we're running a really old version. I agree with you that we need to do file cleanup though, it's been on my list for a while but right now it's just a manual thing. Worth noting the anon folder has reached over 10GB before (~1 year of use) with no problems. I did clean up all the files a few days before the crash so maybe this was somehow a consequence of that. Going to be hard to say without some more investigation. — |
@grosu I don't think a new server is required. We will eventually definitely need to move kweb to the cloud though, because if we get several people using K at once it's already too much CPU for any single machine to handle well. |
From Joel in IT:
The text was updated successfully, but these errors were encountered: