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

Connection timeout uploading multiple files #20

Open
dleadbetter opened this issue Oct 24, 2022 · 5 comments
Open

Connection timeout uploading multiple files #20

dleadbetter opened this issue Oct 24, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@dleadbetter
Copy link
Contributor

Occasionally when uploading multiple files from a client application, the IIIF Cloud server will timeout.

Error R14 (Memory quota exceeded)

We should up the size of the dyno used on Heroku to see if it resolves the issue, and do some load testing to find the upper limit of the number of requests that can be sent concurrently.

We should also consider moving any high-memory consumption processes to jobs (i.e. converting images to ptif).

@dleadbetter dleadbetter added the bug Something isn't working label Oct 24, 2022
@dleadbetter dleadbetter self-assigned this Oct 24, 2022
@dleadbetter
Copy link
Contributor Author

@NickLaiacona, @camdendotlol, @jamiefolsom - I've done some digging into this. I was able to resolve the memory consumption issue by off loading the image processing to an asynchronous job.

However the issue with the request taking longer than Heroku allows still persists. The bottle neck is really the Rails application uploading the image the S3. It's a blocking process, so the consuming application (UDCSL, NBU, etc) will always need to wait for this to finish. And the larger the file, the longer this will take.

Heroku recommends using something like direct uploads to avoid the timeout issue, which is something we could definitely implement, but will take some time.

Another solution could be to limit the number of files, or total size of the files that can be uploaded at once?

I'm not totally sure how much effort we want to sink into this right now or if we'll have clients that will want to upload hundreds of files at once, so open to suggestions on what you all think the appropriate solution would be for both the long term and short term.

@NickLaiacona
Copy link
Member

If we gave the client an account on the IIIF server and had them create a manifest there, would that be easier?

@dleadbetter
Copy link
Contributor Author

If we gave the client an account on the IIIF server and had them create a manifest there, would that be easier?

I think the timeout issue when uploading dozens of files would still exist. We're using a strategy where files are uploaded to the Rails application (IIIF Cloud), processed, then uploaded to S3. So the more files that are uploaded at once and the larger the files, the longer the request is going to take. Eventually it will hit the timeout limit imposed by Heroku.

Another option for getting around this may be updating NBU to not use the /upload end point, but instead make individual POST requests for resources to the client. So essentially if a user is uploading 50 images, we'd make 50 requests to NBU. I can test this out today with UDCSL to see if there is any performance drawbacks.

@camdendotlol
Copy link

I think the individual uploads would be a good solution. The loading spinner could also indicate how far along it is, e.g. "Uploading files: 12 out of 30"

@NickLaiacona
Copy link
Member

Sounds good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants