Mounting of few tens of thousands of FS

niXman asked:

I need to provide the ability to create/read/write/delete files and set quotas for a large number of users of a web-service. These users do not exist as Linux users so I can’t apply quotas. The creation of real users just to perform quotas seems like a bad idea. Therefore, I decided to create a per-user file and mount it as a filesystem.

  1. What is the consequence of mounting of several tens of thousands of FS?
  2. Is there a limit on the total number of mounted FS?

My answer:

There’s no need to create a zillion filesystems for this.

The easy way to do this is to create a directory for each user (which you already would have to do) and then check how much space the files in the directory use up each time a user tries to upload something. If the upload would cause them to exceed their limit, reject the upload. This is the way every other web application in the known universe does it.

P.S. You’ve scattered the details of what you’re doing throughout several comments; you should add them to the question instead so that people can find them (and perhaps reverse your downvotes).

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.