Skip to content

[πŸ› Bug]: Critically slow file transfer from Node to host for large filesΒ #16612

@ilya-corp

Description

@ilya-corp

Description

Downloading of large files (approx. 500 Mb) from Selenium Grid Node is critically slow.
To reproduce you need to open browser at node and try to download an large file from server. In my case downloading of 500Mb from server to node takes approx. 10 seconds and uploading file from node to host - 250 seconds.

Potentially problem placed in the following code:

public void downloadFile(String fileName, Path targetLocation) throws IOException {

Response response = execute(DriverCommand.DOWNLOAD_FILE, Map.of("name", fileName));
    String contents = ((Map<String, String>) response.getValue()).get("contents");
    Zip.unzip(contents, targetLocation.toFile());

Encoding of 500Mb to Base64 takes a lot of time and born approx. X1.5 volume size (750Mb). Additionally, processing os large GSON also requires many processor resources and memory. Reverse encoding from Base64 to bytes also requires time.
The idea is to use raw bytes transferring without encoding.

Selenium 4.38

Reproducible Code

WebElement webElement = ...;
webElement.download();

Debugging Logs

no

Metadata

Metadata

Assignees

Labels

B-gridEverything grid and server relatedC-javaJava BindingsI-defectSomething is not working as intendedI-performanceSomething could be faster

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions