# Fileuploads blocking Workers

**URL:** <https://forum.djangoproject.com/t/fileuploads-blocking-workers/34327>\
**Category:** Mystery Errors\
**Created:** [August 30, 2024, 6:58am UTC](https://forum.djangoproject.com/t/fileuploads-blocking-workers/34327 "2024-08-30T06:58:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SimonVitt](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/simonvitt/32/20598_2.png) [@SimonVitt](https://forum.djangoproject.com/u/SimonVitt)\
**Post date:** [August 30, 2024, 6:58am UTC](https://forum.djangoproject.com/t/fileuploads-blocking-workers/34327/1 "2024-08-30T06:58:54Z")

</div>

Hello everybody,

I encountered a problem which got pretty big for my app now. Sometimes the app becomes unresponsive for a longer time and will answer the requests after like 50 seconds.

I think it is because a lot of users are uploading images and this blocks my gunicorn workers. Users might have a bad internet connection for example. Like this when 12 images are uploaded with bad connection and I only have 10 workers, this will cause a problem. (I also use Azure Blob Storage as my file storage). My Timeout Gunicorn setting is at 20 seconds.

I thought about making the Upload View async and changing to ASGI and Uvicorn. Or to bypass django and let user upload images directly to azure blob. I dont think that this will scale well though in terms of development work. If I have to write the bypass logic for every DRF View where I want to upload a file field.

How would you handle that?

Thank you in advance for your advice 🙂

---

<div class="post-metadata">

**Author:** ![SimonVitt](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/simonvitt/32/20598_2.png) [@SimonVitt](https://forum.djangoproject.com/u/SimonVitt)\
**Post date:** [August 30, 2024, 10:11am UTC](https://forum.djangoproject.com/t/fileuploads-blocking-workers/34327/2 "2024-08-30T10:11:07Z")

</div>

Actually something like this sounds promising:

> **[Direct to S3 file upload with Django](https://www.hacksoft.io/blog/direct-to-s3-file-upload-with-django)**
>
> File upload tend to show up as a feature in most web apps.
> 
> In this article, we explore how to handle direct to S3 uploads with Django, where the actual file upload bypasses the Django backend.

But how would I make this scalable development time wise for all the models and views in my app?  
Have one general FileImageModel and view for uploading?
