Go to
previous page /
next page of Tier3 site log
19. 12. 2012 Largest directories via Chimera
New version
Simply consult the daily rank
http://t3mon.psi.ch/ganglia/PSIT3-custom/v_pnfs_top_dirs.txt
Outdated since May 2014
Based on Fabio's monitoring function the following function & query can be used to extract the largest folders in a given PNFS directory similar to the previous space usage reporting.
CREATE OR REPLACE FUNCTION pnfs_subdirs_du_r(VARCHAR,VARCHAR,INTEGER) RETURNS SETOF v_pnfs AS $$
DECLARE
fileordir1 v_pnfs%rowtype;
fileordir2 v_pnfs%rowtype;
RESULT BIGINT;
BEGIN
FOR fileordir1 IN ( SELECT * FROM pnfs_dir($1) WHERE path LIKE '/'||$1||'/%' AND depth < $3 ) loop
fileordir2 = fileordir1;
SELECT INTO RESULT * FROM pnfs_dir_du( SUBSTRING ( fileordir1.path , 2 , LENGTH(fileordir1.path)) , $2) ;
fileordir2.isize = RESULT;
fileordir2.depth = fileordir2.depth + 1;
RETURN NEXT fileordir2;
END loop;
END;
$$ LANGUAGE plpgsql STABLE;
Then use the following query to get all folders below a given folder (up to depth D) ordered in decreasing order by size:
Don't use that query on very large folders with many subfolders!
SELECT * FROM pnfs_subdirs_du_r('pnfs/psi.ch/cms/trivcat/store/user/dmeister','MB',D) WHERE isize IS NOT NULL ORDER BY isize DESC LIMIT 100;
Of course there would be much more efficient methods to do this; but it works!
--
DanielMeister - 2012-12-19
Go to
previous page /
next page of Tier3 site log