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

Crash: Small Instance Unstable Thumbnailing #22025

Closed
josias-r opened this issue Mar 31, 2024 · 3 comments
Closed

Crash: Small Instance Unstable Thumbnailing #22025

josias-r opened this issue Mar 31, 2024 · 3 comments

Comments

@josias-r
Copy link

josias-r commented Mar 31, 2024

Describe the Bug

I have a small directus instanced hosted on DigitalOcean cloud platform (512mb, 1vCPU, shared)

Very few simple image request are able to completely crash the instance, causing DigitalOcean to restart it, without any logs other then was terminated

Screenshot 2024-03-31 at 15 58 08

While I understand that a small instance like that might not be very stable, I think just a few images by a single user should not be able to completely crash the system causing it to restart

To Reproduce

I think the simplest way to reproduce it is:

  • Create the 512mb, 1vCPU shared directus instance on DO
  • Using the directus API: Upload around 10 jpg images (around 4000x6000px, 3mb each)
  • Simply open the directus app and navigate to the folder you uploaded the files to

This should cause the app to generate thumbnails the first time you open it up. The directus instance will most likely crash (I have a 100% success rate with 10 fresh images 🙂)

Directus Version

v10.10.4

Hosting Strategy

Self-Hosted (Docker Image)

@br41nslug
Copy link
Member

Image transformation is a very CPU/Memory intensive process. The images you mention "around 4000x6000px, 3mb each" are almost the default MAX transform size of 6000x6000px and doing multiple of those may require more than the minimum specs.

Can you try lowering the ASSETS_TRANSFORM_MAX_CONCURRENT config to see if it results in a more stable experience? And perhaps increasing the ASSETS_TRANSFORM_TIMEOUT could help too.

@josias-r
Copy link
Author

josias-r commented Apr 3, 2024

Even having ASSETS_TRANSFORM_MAX_CONCURRENT at 2 crashes the server. It crashes immediately much earlier before any timeout comes into play, so I don't think it has got to do something with ASSETS_TRANSFORM_TIMEOUT .

Scaling the app to 1GB RAM instead of 512mb immediately solves the issue and it perfectly handles concurrent transformations (at least from the one user I am)

@br41nslug
Copy link
Member

I am closing this issue since I unfortunately can only conclude that this was a resource limitation somewhere when handling the images (be it not enough RAM or CPU). This is unfortunately something we cannot currently fix at the minimum required resources https://docs.directus.io/self-hosted/docker-guide.html#requirements

Definitely feel free to create a new issue if it turns out to related to the specific images used or something along those lines 😄

@br41nslug br41nslug closed this as not planned Won't fix, can't repro, duplicate, stale Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants