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

[dashboard][perf] Move Job package uploading to another thread. #45282

Merged
merged 2 commits into from May 20, 2024

Conversation

rynewang
Copy link
Contributor

Package uploading is a CPU intensive work in Dashboard, where it collects the whole 500 MiB working_dir and uploads it to the GCS. It can take 30s to do so - during which the Dashboard event loop is blocking.

This PR moves the uploading to another thread. This avoids event loop blocking.

This PR also removes a dead reference to gcs_client in http_server_head.py.

Copy link
Contributor

@jjyao jjyao left a comment

Choose a reason for hiding this comment

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

How did you find it?

upload_package_to_gcs(package_uri, await req.read())
data = await req.read()
await self._upload_package_thread_pool_executor.submit(
upload_package_to_gcs, package_uri, data
Copy link
Contributor

Choose a reason for hiding this comment

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

I saw it's just gcs kv put. Is it easy to just implement an async version of it using gcs_aio_client?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried that, but upload_package_to_gcs is also used by CLI (Job SDK) code in sync form so it's non trivial to change.

@rynewang
Copy link
Contributor Author

How did you find it?

I find that job submission APIs can take 30s, and it's only possible because of the large uploads, so I audited the code and found it

@rynewang rynewang assigned rynewang and unassigned jjyao May 13, 2024
Signed-off-by: Ruiyang Wang <[email protected]>
@jjyao jjyao merged commit 61d9049 into ray-project:master May 20, 2024
6 checks passed
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

2 participants