Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check what duct is "busy with" #60

Closed
yarikoptic opened this issue Jun 9, 2024 · 2 comments
Closed

check what duct is "busy with" #60

yarikoptic opened this issue Jun 9, 2024 · 2 comments
Labels
semver-performance Improve performance of an existing feature

Comments

@yarikoptic
Copy link
Member

ATM running a singularity container through duct shows 2-3% CPU of duct. I wonder what it is doing. Would be worth checking with py-spy etc some of its runs to see what it spends time on -- even though just a little, given how little it needs to do I would expect it to be even lower

yoh      1622935  0.1  0.0 271356 39816 pts/13   Sl+  10:58   0:00       /usr/bin/python3 /usr/bin/datalad run -m Doing trial run with bleeding edge 0.0.5 duct singularity run -B /mnt/DATA/data/yoh/1076_spacetop:/mnt/DATA/data/yoh/1076_spacetop:ro -B /mnt/DATA/data/yoh/1076_spacetop/derivatives:/mnt/DATA/data/yoh/1076_spacetop/derivatives:rw -B /mnt/DATA/data/yoh/1076_spacetop/scratch:/mnt/DATA/data/yoh/1076_spacetop/scratch:rw -B /mnt/DATA/data/yoh/1076_spacetop/../dsst-defacing-pipeline/src:/opt/dsst-defacing-pipeline:ro --scratch /mnt/DATA/data/yoh/1076_spacetop/scratch --pwd /mnt/DATA/data/yoh/1076_spacetop --net --network none ../dsst-defacing-pipeline/dsst-defacing-pipeline-0.0.5.sif -p 0001 -s 01 -- . derivatives/dss-defacing-0.0.5-1
yoh      1623044  0.0  0.0   2580   904 pts/13   S+   10:58   0:00         /bin/sh -c duct singularity run -B /mnt/DATA/data/yoh/1076_spacetop:/mnt/DATA/data/yoh/1076_spacetop:ro -B /mnt/DATA/data/yoh/1076_spacetop/derivatives:/mnt/DATA/data/yoh/1076_spacetop/derivatives:rw -B /mnt/DATA/data/yoh/1076_spacetop/scratch:/mnt/DATA/data/yoh/1076_spacetop/scratch:rw -B /mnt/DATA/data/yoh/1076_spacetop/../dsst-defacing-pipeline/src:/opt/dsst-defacing-pipeline:ro --scratch /mnt/DATA/data/yoh/1076_spacetop/scratch --pwd /mnt/DATA/data/yoh/1076_spacetop --net --network none ../dsst-defacing-pipeline/dsst-defacing-pipeline-0.0.5.sif -p 0001 -s 01 -- . derivatives/dss-defacing-0.0.5-1
yoh      1623046  2.3  0.0 241476 14000 pts/13   Sl+  10:58   0:15           /mnt/DATA/data/yoh/dsst-defacing-pipeline/venvs/dev3/bin/python3 /mnt/DATA/data/yoh/dsst-defacing-pipeline/venvs/dev3/bin/duct singularity run -B /mnt/DATA/data/yoh/1076_spacetop:/mnt/DATA/data/yoh/1076_spacetop:ro -B /mnt/DATA/data/yoh/1076_spacetop/derivatives:/mnt/DATA/data/yoh/1076_spacetop/derivatives:rw -B /mnt/DATA/data/yoh/1076_spacetop/scratch:/mnt/DATA/data/yoh/1076_spacetop/scratch:rw -B /mnt/DATA/data/yoh/1076_spacetop/../dsst-defacing-pipeline/src:/opt/dsst-defacing-pipeline:ro --scratch /mnt/DATA/data/yoh/1076_spacetop/scratch --pwd /mnt/DATA/data/yoh/1076_spacetop --net --network none ../dsst-defacing-pipeline/dsst-defacing-pipeline-0.0.5.sif -p 0001 -s 01 -- . derivatives/dss-defacing-0.0.5-1
yoh      1623049  0.0  0.0 1247012 16620 ?       Ssl  10:58   0:00             Singularity runtime parent
yoh      1623076  0.0  0.0  19740 16584 ?        S    10:58   0:00               python /opt/dsst-defacing-pipeline/run.py -p 0001 -s 01 -- . derivatives/dss-defacing-0.0.5-1
yoh      1623098  0.0  0.0   4040  3056 ?        S    10:58   0:00                 /bin/tcsh /usr/bin/@afni_refacer_run -input /mnt/DATA/data/yoh/1076_spacetop/sub-0001/ses-01/anat/sub-0001_ses-01_acq-MPRAGEXp3X08mm_T1w.nii.gz -mode_deface -no_clean -prefix /mnt/DATA/data/yoh/1076_spacetop/derivatives/dss-defacing-0.0.5-1/bids_defaced/sub-0001/ses-01/anat/sub-0001_ses-01_acq-MPRAGEXp3X08mm_T1w
yoh      1674377  100  0.0 326992 320464 ?       R    11:10   0:01                   3dcalc -a tmp.00.INPUT.nii -c tmp.05.sh_t2a_thr.nii[1] -expr a*not(bool(c)) -prefix tmp.99.result.deface.nii -datum float -ISOLA

but I could be wrong.

@yarikoptic yarikoptic added the semver-performance Improve performance of an existing feature label Jun 9, 2024
@asmacdo
Copy link
Member

asmacdo commented Jun 21, 2024

This bugfix helps b6c9219

Here's some fun dogfooding :)

$ duct duct sleep 100
duct is executing duct sleep 100...
Log files will be written to .duct/logs/2024.06.21T13.06.49-1223368_
duct is executing sleep 100...
Log files will be written to .duct/logs/2024.06.21T13.06.49-1223371_
Exit Code: 0
Command: sleep 100
Log files location: .duct/logs/2024.06.21T13.06.49-1223371_
Wall Clock Time: 100.003 sec sec
Memory Peak Usage (RSS): 1920 KiB
Memory Average Usage (RSS): 1920.000 KiB
Virtual Memory Peak Usage (VSZ): 221584 KiB
Virtual Memory Average Usage (VSZ): 221584.000 KiB
Memory Peak Percentage: 0.0%
Memory Average Percentage: 0.000%
CPU Peak Usage: 0.0%
Average CPU Usage: 0.000%
Samples Collected: 98
Reports Written: 2

Exit Code: 0
Command: duct sleep 100
Log files location: .duct/logs/2024.06.21T13.06.49-1223368_
Wall Clock Time: 100.073 sec sec
Memory Peak Usage (RSS): 17920 KiB
Memory Average Usage (RSS): 17196.735 KiB
Virtual Memory Peak Usage (VSZ): 682564 KiB
Virtual Memory Average Usage (VSZ): 627538.367 KiB
Memory Peak Percentage: 0.0%
Memory Average Percentage: 0.000%
CPU Peak Usage: 4.0%
Average CPU Usage: 1.658%
Samples Collected: 98
Reports Written: 2

Average CPU Usage: 1.658% is an improvement, but still using a lot more power than we probably need.

@yarikoptic
Copy link
Member Author

that was a very cute use of duct -- to monitor duct ;-)

on my attempt -- we sit at 3.5%
❯ duct duct sleep 100
2024-08-20T09:40:21-0400 [INFO    ] con-duct: duct is executing 'duct sleep 100'...
2024-08-20T09:40:21-0400 [INFO    ] con-duct: Log files will be written to .duct/logs/2024.08.20T09.40.21-3232070_
2024-08-20T09:40:21-0400 [INFO    ] con-duct: duct is executing 'sleep 100'...
2024-08-20T09:40:21-0400 [INFO    ] con-duct: Log files will be written to .duct/logs/2024.08.20T09.40.21-3232074_
2024-08-20T09:42:03-0400 [INFO    ] con-duct: Summary:
Exit Code: 0
Command: sleep 100
Log files location: .duct/logs/2024.08.20T09.40.21-3232074_
Wall Clock Time: 100.003 sec
Memory Peak Usage (RSS): 1966080 bytes
Memory Average Usage (RSS): 1966080.0 bytes
Virtual Memory Peak Usage (VSZ): 5652480 bytes
Virtual Memory Average Usage (VSZ): 5652480.0 bytes
Memory Peak Percentage: 5652480
Memory Average Percentage: 5652480.0
CPU Peak Usage: 0
Average CPU Usage: 0.0
Samples Collected: 98
Reports Written: 2

2024-08-20T09:42:03-0400 [INFO    ] con-duct: Summary:
Exit Code: 0
Command: duct sleep 100
Log files location: .duct/logs/2024.08.20T09.40.21-3232070_
Wall Clock Time: 101.877 sec
Memory Peak Usage (RSS): 14909440 bytes
Memory Average Usage (RSS): 14888140.799999997 bytes
Virtual Memory Peak Usage (VSZ): 250023936 bytes
Virtual Memory Average Usage (VSZ): 247739432.95999998 bytes
Memory Peak Percentage: 250023936
Memory Average Percentage: 247739432.95999998
CPU Peak Usage: 200.0
Average CPU Usage: 3.5020000000000002
Samples Collected: 100
Reports Written: 2

duct duct sleep 100  3.65s user 4.92s system 8% cpu 1:42.05 total

that is not great but not too bad either, let's just consider it ok for now, although might reconsider if we see it up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-performance Improve performance of an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants