Tags:
dcache1Add my vote for this tag create new tag
view all tags

Arrow left Go to previous page / next page of Tier3 site log MOVED TO...

19. 12. 2012 Largest directories via Chimera

New version

Simply consult the daily report:

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


Arrow left Go to previous page / next page of Tier3 site log MOVED TO...

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2014-05-13 - FabioMartinelli
 
This site is powered by the TWiki collaboration platform Powered by Perl This site is powered by the TWiki collaboration platformCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback