Hi Chris,
(lotsa questions, so some of my answers are terse).
On Fri, Feb 17, 2006 at 12:56:07PM -0800, Chris Stromsoe wrote:
> I'm looking to roll out a black-box web hosting system. All user
> management is done off box. Users will not have direct access and will
> not have traditional Unix UID/GID available. I'm testing XFS with project
> quotas to enforce resource limits. I have several observations and some
> questions.
>
> 1) How many projects can I have? I need to maintain between 30k (to
> start) and 70k (not likely to ever go over) trees.
The project ID is a 16 bit value in the xfs inode. So, 65536.
There is the possibility of expanding this to 32, and I'd wondered
how long it would take before someone got bitten by this.
"Not very" was the answer there I guess. :)
All the quota/XFS interfaces allow for a 32 bit value, its just
internally its chopped in half. Theres padding available ondisk,
its just a Simple Matter Of Programming (i.e. send a patch).
> 2) Can the project ID be an arbitrary integer? I'd like to use the inode
Arbitrary within its limited range, yes.
> number of the root of the quota tree as the project ID. Trying to use
So, no that wouldn't work. ;)
> 3) Does the ID get cleared if I rename a tree? Or the quota? I set a 15M
It shouldn't. rename(2) is a directory (naming) operation, and the
underlying inodes are unchanged (where the project ID lives), so the
project ID should be preserved (unless mv(1) is copying or something?).
> bhard pquota on an ID, then renamed the tree. After rename, the quota
> seemed to be cleared. When I renamed the tree back, the quota did not
> reapply. When I re-assigned the project ID to the project, it started
> showing up with double the amount of storage actually used. When I
> assigned the same ID to a different path, the usage as reported with
> df/free when with the ID even though the path was an empty directory.
Er, hmm, that doesn't sound right.
> 4) How is /etc/projid supposed to be used? I set names for the projects
As described in the man page.
> cbs:~ > cat /etc/projid
> 1:test
I think that should read "test:1"?
> I'm using, but I can't see how the names are actually used. Do the
> project names only apply to the -d flag to xfs_quota?
Can't remember off the top of my head.
> 5) Certain commands report incorrect data. How does xfs_dump calculate
> the amount of spaced used that gets reported by df/free?
Not sure what you mean there.
> cbs:~ > sudo xfs_quota -x -c 'free'
> Filesystem 1K-blocks Used Available Use% Pathname
> /dev/md3 355466304 15996 355450308 1% /users
> /dev/md3 355466304 30896 355450308 1%
> /users/html/t/te/test
>
> cbs:~ > du -sk /users/html/t/te/test/
> 0 /users/html/t/te/test/
Not setup properly? (guessing).
> 6) Commands seem to work differently when run interactively vs. the
> command line.
IIRC, in interactive mode theres a concept of a "current mount/path",
and from the command line things tend to apply to all mounts/path.
> Is it possible to use the name as referenced from /etc/projid instead of
> the ID number? Or the full directory tree path (ie, /users/t/te/test)?
> With 30K+ trees, referring to everything by number is going to get
> complicated.
Pretty sure you can refer by name (not path, unless you use path
as name). Been awhile since I looked. Maybe your setup issue again
preventing that?
> 8) Can the output tools include the project "name" instead of ID? And the
Yeah, I think they do.
> path to the tree being reported on? (Note that this is the same project
> above that "free" reports as using 30896K)
>
> cbs@adzuki:~ > sudo xfs_quota -x -c 'report -p'
> Project quota on /users (/dev/md3)
> Blocks
> Project ID Used Soft Hard Warn/Grace
> ---------- --------------------------------------------------
> 1 12 0 0 00 [--------]
Sounds like theres some mismatch between your config files.
> 9) Any chance that /etc/project and /etc/projid will ever be stored in
> format more easily in-place editable with scripts than flat-file (bdb,
> gdbm, xyz)?
xfs_quota is all trivial userspace code - so, you can do what you
like in terms of implementing a different data store. The kernel
only cares about the numeric identifiers.
cheers.
--
Nathan
|