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.
2) Can the project ID be an arbitrary integer? I'd like to use the inode
number of the root of the quota tree as the project ID. Trying to use
1207959680 (as an example) seems to work, but then "xfs_quota -x -c df"
complaints that the ID from /etc/projects doesn't match --
xfs_quota: project ID 1207959680 (/etc/projects) doesn't match ID 128
(/users/html/t/te/test)
3) Does the ID get cleared if I rename a tree? Or the quota? I set a 15M
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.
4) How is /etc/projid supposed to be used? I set names for the projects
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?
cbs:~ > cat /etc/projects
1:/users/html/t/te/test
cbs:~ > cat /etc/projid
1:test
cbs:~ > sudo xfs_quota -x -c 'quota -p test'
xfs_quota: cannot find project test
5) Certain commands report incorrect data. How does xfs_dump calculate
the amount of spaced used that gets reported by df/free?
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/
6) Commands seem to work differently when run interactively vs. the
command line.
cbs:~ > sudo xfs_quota -x
xfs_quota> state
xfs_quota> quit
cbs:~ > sudo xfs_quota -x -c 'state'
User quota state on /users (/dev/md3)
Accounting: OFF
Enforcement: OFF
Inode: #133 (3 blocks, 3 extents)
Group quota state on /users (/dev/md3)
Accounting: OFF
Enforcement: OFF
Inode: #134 (3 blocks, 3 extents)
Project quota state on /users (/dev/md3)
Accounting: ON
Enforcement: ON
Inode: #134 (3 blocks, 3 extents)
Blocks grace time: [7 days]
Inodes grace time: [7 days]
Realtime Blocks grace time: [7 days]
7) The man page for xfs_quota states that "project -c" must be used to
create a managed tree using a tree defined in /etc/projects. Actual usage
seems to be "project -s".
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.
8) Can the output tools include the project "name" instead of ID? And the
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 [--------]
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)?
Thanks.
-Chris
|