-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Copying big files is slow (compared to kubectl) #3889
Comments
Linking to #3856 - to remove that listener we'll need to expose the ability to directly write not through piped streams. This would directly expose the read. |
I'm not sure how the listener refactoring can help here. We can directly pass the necessary outputstream (File, Base64...) via the |
Sorry too many layers. I was thinking about the pipe handling down there, but yes passing the desired output directly in from the PodOperationImpl will work. The existing PodOperationImpl with pipes would allow for a non-blocking copy wrt the calling thread - but of course it is just blocking so that's not needed. Please open a pr. The only thing that may need a tweak is this future hypnoce@5d4cd2d#diff-a2903aa41f3a870d827a008517a92eda7a4abdb34d3c4660d48b08240145bcc7R537 - you can just do:
|
Is your task related to a problem? Please describe
On a local network,
kubectl cp
is network bounded when copying files :Using the java kube client, time is much higher. It is cpu bounded :
I'm running java11 but it does not seem to be the problem. After a first analysis, it comes from Piped(In/Out)putStream that makes heavy use of locks.
Removing use of pipes drops the download time from ~77s to ~11s (7x gain).
Describe the solution you'd like
Refactor the code to make the network receiving thread directly write in the file instead of using piped(in/out)putstreams.
Describe alternatives you've considered
I've considered forking the
kubectl
command but it becomes very complex to pass the correct kubeconfig from java to CLIAdditional context
No response
The text was updated successfully, but these errors were encountered: