Open pdaian opened 10 years ago
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(): ... return open(collection.get_collection_path() + path + file + '.meta').read() …
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 :+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.
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 Thanks :)
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 [notifications@github.com] Sent: Monday, November 03, 2014 7:18 PM To: kframework/kweb Subject: Re: [kweb] [critical] K or kweb or something opens up too many files on fslweb (#19)
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.
— Reply to this email directly or view it on GitHubhttps://github.com/kframework/kweb/issues/19#issuecomment-61579000.
@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: