mytonctrl icon indicating copy to clipboard operation
mytonctrl copied to clipboard

Feature/speed-up-archive-download 7x/8x

Open enchanted-elephant1 opened this issue 1 year ago • 0 comments

Pull Request Description

Changes Made

  1. Added aria2 for Downloading: The dump download method was switched from using curl to aria2c. This change allows for downloading the file using multiple connections (8 connections), which increases the download speed and reliability.
  2. Updated apt Install Command: The apt install command was modified to include the aria2 package, which is necessary for the new download mechanism. The command now installs plzip, pv, aria2, and curl.
  3. Corrected Typo: Fixed a typo in the log message from "fuction" to "function".

Reason for Changes

  1. Improved Download Performance: By switching to aria2c, the download process can now utilize multiple connections, improving the speed and reliability of fetching large files. This is especially beneficial for environments with limited bandwidth or unstable network connections.
  2. Increased Flexibility: Including aria2 in the installation process ensures that all required packages are available for the new download method, enhancing the robustness of the script.
  3. Code Readability and Accuracy: The typo fix improves the clarity of the debug logs, making them easier to understand for developers and maintainers.

Impact on Deployment

  • Sizing: File is now downloaded in /tmp, instead of streaming.

Impact on the Codebase

  • Performance: The download process will be faster and more efficient due to the parallel connections used by aria2c.
  • Dependency Management: The additional dependency on aria2 increases the need for ensuring that this package is available in environments where the script runs.
  • Log Clarity: The corrected log message contributes to better debugging and log tracking.

Testing should confirm that the new download method works as expected in different network conditions, and that aria2 is successfully installed and used during the process.

enchanted-elephant1 avatar Aug 26 '24 12:08 enchanted-elephant1