We have a Flutter app with over 3,000 users, but we’re encountering connectivity timeout issues when approximately 500 users upload images to the server. Each image is between 1 to 1.5 MB after compression(on server end). During this time, other users are unable to log in or access any APIs.”
7
While the size of the each image is between 1 MB and 1.5 MB (between 500 MB and 750 MB for 500 users) after compression, the server will not use just that memory for the whole upload process. That is just a threshold (an unreasonable one in my opinion).
Most servers have an event loop which they use to handle request-response cycles between the application and different clients. This event loop is memory intensive and in some cases will need to run on multiple cores.
When a server receives a request (coupled with some headers), it performs some copy of the data during processing (HTTP 1.1 at least). These copies mean more memory used.
When the server will then communicate with your application, the handshake process and security checks between the line requires memory for processing.
Secure TLS (in the form of HTTPS) is also another security protocol that will definitely require memory to manage.
Need I go on? The images uploaded is just one of many other things that will consume memory. If your server is running on a machine with random access 32 GB memory, then we will take a different approach to debug the issue.