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

Should we increment minted S3 download urls expiry to avoid avoidable interaction with AWS? #1901

Open
yarikoptic opened this issue Mar 21, 2024 · 0 comments
Labels
performance Improve performance of an existing feature

Comments

@yarikoptic
Copy link
Member

Instigated by

apparently we cache for up to 5 seconds and otherwise -- send a new one:

❯ pl=''; for i in {1..10}; do echo -n "$i $(date) "; l=$(curl --silent -I 'https://api.dandiarchive.org/api/dandisets/000891/versions/0.240215.0831/assets/d23e3ee7-8982-42dd-bd1d-fcbfd5290e04/download/' | grep Location); if [ "$l" != "$pl" ]; then echo -n "$l != $pl"; fi; pl=$l; echo; done
1 Thu Mar 21 11:58:37 AM EDT 2024 Location: https://dandiarchive.s3.amazonaws.com/blobs/775/0c1/7750c16b-025f-4f8c-be3e-e67bee819dc4?response-content-disposition=attachment%3B%20filename%3D%22sub-FB2355_ses-FB2355_image.nwb%22&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAUBRWC5GAEKH3223E%2F20240321%2Fus-east-2%2Fs3%2Faws4_request&X-Amz-Date=20240321T155837Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=d71546e7de8 != 538a8efdfc45f8af07094a13fac0bb299df36e395c36a8090
2 Thu Mar 21 11:58:37 AM EDT 2024 
3 Thu Mar 21 11:58:37 AM EDT 2024 
4 Thu Mar 21 11:58:37 AM EDT 2024 
5 Thu Mar 21 11:58:37 AM EDT 2024 Location: https://dandiarchive.s3.amazonaws.com/blobs/775/0c1/7750c16b-025f-4f8c-be3e-e67bee819dc4?response-content-disposition=attachment%3B%20filename%3D%22sub-FB2355_ses-FB2355_image.nwb%22&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAUBRWC5GAEKH3223E%2F20240321%2Fus-east-2%2Fs3%2Faws4_request&X-Amz-Date=20240321T155838Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=e5b513d7ab4 != Location: https://dandiarchive.s3.amazonaws.com/blobs/775/0c1/7750c16b-025f-4f8c-be3e-e67bee819dc4?response-content-disposition=attachment%3B%20filename%3D%22sub-FB2355_ses-FB2355_image.nwb%22&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAUBRWC5GAEKH3223E%2F20240321%2Fus-east-2%2Fs3%2Faws4_request&X-Amz-Date=20240321T155837Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=d71546e7de8d7d7538a8efdfc45f8af07094a13fac0bb299df36e395c36a8090
6 Thu Mar 21 11:58:38 AM EDT 2024 
7 Thu Mar 21 11:58:38 AM EDT 2024 
8 Thu Mar 21 11:58:38 AM EDT 2024 
9 Thu Mar 21 11:58:38 AM EDT 2024 
10 Thu Mar 21 11:58:38 AM EDT 2024 Location: https://dandiarchive.s3.amazonaws.com/blobs/775/0c1/7750c16b-025f-4f8c-be3e-e67bee819dc4?response-content-disposition=attachment%3B%20filename%3D%22sub-FB2355_ses-FB2355_image.nwb%22&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAUBRWC5GAEKH3223E%2F20240321%2Fus-east-2%2Fs3%2Faws4_request&X-Amz-Date=20240321T155839Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=63a77c1475 != Location: https://dandiarchive.s3.amazonaws.com/blobs/775/0c1/7750c16b-025f-4f8c-be3e-e67bee819dc4?response-content-disposition=attachment%3B%20filename%3D%22sub-FB2355_ses-FB2355_image.nwb%22&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAUBRWC5GAEKH3223E%2F20240321%2Fus-east-2%2Fs3%2Faws4_request&X-Amz-Date=20240321T155838Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=e5b513d7ab4e605e57f84288a0078c0128898d22336fe2674e21c178be570d83

so in case of that repepetive bombardment for the same asset /download/ for some reason - we would keep minting those urls quite often. Could/should we increase caching period given that they are to expire in 3600 seconds?

@yarikoptic yarikoptic added the performance Improve performance of an existing feature label Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Improve performance of an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant