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

Bug Fix: A bug where images load slowly when accessing pages with many images. (in remote server. eg, aws) #2636

Merged
merged 22 commits into from Apr 6, 2023

Conversation

asynclee
Copy link
Contributor

About #2424 issue.

Bug summary

Bug where images load slowly when accessing pages with many images. Additionally, when the loading is slow, the backend does not receive any additional requests, which causes slow access as well.

Why the bug is not detected in the local environment ?

In the local environment, the speed of reading images was so fast that the issue did not cause any bottleneck. However, in a remote environment, such as an EC2+EBS environment, the disk response speed is not as fast as a local disk, so the logic related to loading images can cause a bottleneck. This results in the issue where the backend does not receive additional requests when the loading is slow, leading to slow access.

What part is the problem ?

In the existing logic, when receiving image uri arrays through the getbatch logic, the uri array is initialized after the loading is completed. In other words, for example,

Assume that 50 image uri arrays are being processed,
While processing the above images, if 20 uri array requests come in, a getbatch operation requesting 70 uri arrays including the 20 uri arrays additionally requested on the existing 50 uri array being processed is performed.
If this process is repeated, many duplicated images will be requested.

How was it changed?

Changed the logic to additionally manage the uri arrays that are being processed/processed, and to avoid processing duplicate image uris that are already being processed.

@CLAassistant
Copy link

CLAassistant commented Mar 31, 2023

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@roubkar roubkar self-requested a review March 31, 2023 09:16
@roubkar
Copy link
Contributor

roubkar commented Mar 31, 2023

Hey @asynclee, thanks for opening this PR 🙌
I will review it shortly

@roubkar
Copy link
Contributor

roubkar commented Mar 31, 2023

Hey @asynclee, could you please also update the CHANGELOG.md?

@asynclee
Copy link
Contributor Author

Hello @roubkar. Sure. I'll update that.

@asynclee
Copy link
Contributor Author

Hello, @roubkar. I wrote it based on what was written before, but I'm not sure if it's correct. Can you review it, please?

@roubkar
Copy link
Contributor

roubkar commented Mar 31, 2023

Hello, @roubkar. I wrote it based on what was written before, but I'm not sure if it's correct. Can you review it, please?

For now, I'm not sure whether this will be released with v3.17.3 or v3.18.0.
If you don't mind I will adjust that part later

Copy link
Contributor

@roubkar roubkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@roubkar roubkar merged commit 89e386c into aimhubio:main Apr 6, 2023
1 check passed
@roubkar
Copy link
Contributor

roubkar commented Apr 6, 2023

Hey @asynclee, I just merged this PR.
Thanks for fixing this issue and congrats on your contribution 🎉

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

Successfully merging this pull request may close these issues.

None yet

3 participants