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

collectstatic is extremely slow with S3 Manifest #1255

Open
catgirlinspace opened this issue Jun 2, 2023 · 6 comments
Open

collectstatic is extremely slow with S3 Manifest #1255

catgirlinspace opened this issue Jun 2, 2023 · 6 comments

Comments

@catgirlinspace
Copy link

hiya! I'm deploying my app on DigitalOcean App Platform. As part of the build step there, I run python manage.py collectstatic --noinput. Before switching to storing my static assets in a S3-compatible bucket this was instant, but now takes over 10 minutes when using the S3 manifest. The S3-compatible service I am using is Backblaze B2, although I wouldn't expect this to matter.

Configuration for my static files

storages.py

class StaticStorage(S3ManifestStaticStorage):
    bucket_name = 'splashcat-static'
    custom_domain = 'static.splashcat.ink'

settings.py

if not DEBUG:
    STORAGES = global_settings.STORAGES | {
        "default": {"BACKEND": "storages.backends.s3boto3.S3Boto3Storage"},
        "staticfiles": {"BACKEND": "splashcat.storages.StaticStorage"}
    }
@DuncanTormey
Copy link

@catgirlinspace I am experiencing this too, did you find a solution?

@DuncanTormey
Copy link

I ended up doing this.

python -m cosmos.manage collectstatic --no-input & # background the static collection
gunicorn cosmos.cosmos_site.wsgi --config cosmos/gunicorn_conf.py

@catgirlinspace
Copy link
Author

@DuncanTormey hi, sorry for the late reply. my workaround for this was to just use collectstatic and serve it without S3 and then stick a CDN in front.

@robd003
Copy link

robd003 commented Mar 8, 2024

I'm also experiencing a 10 minute duration when trying to upload ~2,700 files

@davidmir
Copy link

+1

@pablodiegoss
Copy link

+1

Any new info for this thread?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants