GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Optimize SSH file transfer by batching uploads by diegolovison · Pull Request #780 · Hyperfoil/Hyperfoil

Conversation

@diegolovison

@diegolovison diegolovison commented May 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

Optimize SSH file transfer by batching uploads

This can boost the copy by around 10x
Here is the raw data and ratio.

Files scp (Baseline) scp with array
1 336 ms (1.0x) 292 ms (1.15x faster)
10 3235 ms (1.0x) 533 ms (6.07x faster)
100 33482 ms (1.0x) 3243 ms (10.32x faster)
1000 319168 ms (1.0x) 32844 ms (9.72x faster)

Reproducer. You need to remove the files because there is a checksum in the code to prevent copying again.

rm -fR /home/dlovison/.m2/repository/io/hyperfoil/hyperfoil-clustering
rm -fR /tmp/hyperfoil/
mvn clean package -Pbenchmark

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@diegolovison diegolovison mentioned this pull request May 11, 2026
Add configurable file transfer client with SCP/SFTP support #778
Closed
@franz1981

franz1981 commented May 11, 2026

Copy link
Copy Markdown
Contributor

1000 files: 89%

1000 files is not just 89% faster than the existing approach 🙏

Use the ratio as a measure of improvement

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@diegolovison

diegolovison commented May 11, 2026

Copy link
Copy Markdown
Collaborator Author

Here is the raw data and ratio.

Files scp (Baseline) scp with array
1 336 ms (1.0x) 292 ms (1.15x faster)
10 3235 ms (1.0x) 533 ms (6.07x faster)
100 33482 ms (1.0x) 3243 ms (10.32x faster)
1000 319168 ms (1.0x) 32844 ms (9.72x faster)
franz1981 reacted with heart emoji franz1981 reacted with rocket emoji
All reactions
  • ❤️ 1 reaction
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@diegolovison
Optimize SSH file transfer by batching uploads
b9fbd57
@diegolovison
diegolovison force-pushed the sftp_3 branch from 65008e2 to b9fbd57 Compare May 11, 2026 17:53
diegolovison added 2 commits May 11, 2026 15:48
@diegolovison
Reduce delay
d2a49b3
@diegolovison
Improve fail message
9335f03
@diegolovison

diegolovison commented May 11, 2026

Copy link
Copy Markdown
Collaborator Author

@franz1981 CI was complaining. We were unlucky, and then I reduced the unservedDelay
This is ready to be merged.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

franz1981
franz1981 requested changes May 11, 2026
View reviewed changes
Comment thread clustering/src/main/java/io/hyperfoil/deploy/ssh/SshDeployedAgent.java
}
if (!fileToUpload.isEmpty()) {
try {
scpClient.upload(fileToUpload.toArray(String[]::new), dir + AGENTLIB + "/",

@franz1981 franz1981 May 11, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

maybe we want to have a configurable amount of connections?
The scp changes are now using a single connection instead of 1 per file, but maybe we can have 10 connections for 100 files etc etc no?

The default can still 1 but people can change it, with a max == total number of files (so you can have the default behaviour with -1 or 0 - what fit best)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@diegolovison diegolovison May 11, 2026

Copy link
Copy Markdown
Collaborator Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Can it be a percentage?
Because the total number of files is going to change from release to release.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@diegolovison

diegolovison commented May 11, 2026

Copy link
Copy Markdown
Collaborator Author

maybe we want to have a configurable amount of connections?

I think we can add if really needed. Otherwise, it is one more scenario to maintain.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@franz1981

franz1981 commented May 11, 2026

Copy link
Copy Markdown
Contributor

I don't want to assume 1 connection fit all yet: you tried on your machine only so far no?
If users complain we need a way to make them switch back to the original version without changing hyperfoil version

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@franz1981

franz1981 commented May 11, 2026

Copy link
Copy Markdown
Contributor

Usually you want to setup the number of physical resources required; a percentage is dangerous as it can grow a lot...while if you tell people to setup 1000 they probably think twice than 100% without knowing that hyperfoil jars can be 200..

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@diegolovison

diegolovison commented May 11, 2026

Copy link
Copy Markdown
Collaborator Author

Ok. Let's use the number of connections.

Example:

  • 1: All files copied once
  • 2: Divide the number of files by 2
  • 3: Divide the number of files by 3

Should 1 be the default?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@franz1981

franz1981 commented May 12, 2026

Copy link
Copy Markdown
Contributor

Should 1 be the default?

only if we can check on the CI how it behaves...

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@diegolovison

diegolovison commented May 12, 2026

Copy link
Copy Markdown
Collaborator Author

How about keeping by default a connection per file (no extra parameter), and if someone sets the parameter -Dio.hyperfoil.file.transfer.client.scp.connections=1, then:
1: All files copied once
2: Divide the number of files by 2
3: Divide the number of files by 3

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@franz1981

franz1981 commented May 12, 2026

Copy link
Copy Markdown
Contributor

How about keeping by default a connection per file

that's the current behavior you mean?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@diegolovison

diegolovison commented May 12, 2026

Copy link
Copy Markdown
Collaborator Author

The current behavior is that all files are in a single connection.


My proposal is to change the default behavior to keep it as it was before this PR

  • Iterate over each file and call upload

Then, introduce a new parameter.
If we set -Dio.hyperfoil.file.transfer.client.scp.connections=1 then, we have a call to upload with all files

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@franz1981

franz1981 commented May 12, 2026

Copy link
Copy Markdown
Contributor

The current behavior is that all files are in a single connection.

TBH I was thinking it was creating a new connection per each file - instead. Batching on the other side batch ALL files to a single scp connection

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@franz1981

franz1981 commented May 12, 2026

Copy link
Copy Markdown
Contributor

@diegolovison

The current code (before your PR) does not put all files in a single connection. It calls scpClient.upload(file, remote) inside a loop — and each call is blocking: it opens a new SCP channel, transfers the file, waits for the ACK, and closes the channel before the next iteration starts.

So with 1000 files, you get 1000 sequential channel-open/transfer/close cycles.

Your PR collects all files into a list and calls scpClient.upload(files[], remote) once — one channel, all files streamed through it back-to-back, no repeated handshake overhead. That's where the 10x is coming from, likely (to verify it!).

My suggestion at this point is NOT to make it configurable, as the old behavior was just wrong.
You can verify it was using blocking SCP calls yourself please 🙏

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@diegolovison

diegolovison commented May 12, 2026

Copy link
Copy Markdown
Collaborator Author

@franz1981, what you describe is accurate.

My suggestion at this point is NOT to make it configurable

That is good! Ready to merge?

franz1981 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

franz1981
franz1981 approved these changes May 12, 2026
View reviewed changes

@franz1981 franz1981 left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Well done!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@franz1981

franz1981 commented May 12, 2026

Copy link
Copy Markdown
Contributor

But check if there are hidden timeout on scp now that the single connection run for longer please 🙏

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@diegolovison

diegolovison commented May 12, 2026

Copy link
Copy Markdown
Collaborator Author

I don't see any timeout, and all tests are passing. If there are timeouts ( like before this change ), the test will fail ( like it was on my computer )

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@diegolovison
diegolovison merged commit b452869 into Hyperfoil:master May 12, 2026
2 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@franz1981

franz1981 commented May 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

I don't see any timeout

I mean; check the scp wrapper library default timeout as we need to make sure they want fall shortly based on the available bandwidth. We need them to be enlarged to accomodate to the larger quantity of files sent

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@franz1981 franz1981 mentioned this pull request Jun 4, 2026
Add configurable file transfer client with SCP/SFTP support #784
Draft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@franz1981 franz1981 franz1981 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@diegolovison @franz1981
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.