Skip to content

Conversation

@rasmunk
Copy link
Contributor

@rasmunk rasmunk commented Jul 3, 2025

Currently the OS default package manager installs paramiko version 2.12.0 with the following instruction when UPGRADE_PARAMIKO is set to False

&& [ "${UPGRADE_PARAMIKO}" = "True" ] || dnf install -y python3-paramiko \

However, this has shown to produce up to 6 times less SFTP based download bandwidth compared to uploading.
As indicated at https://www.paramiko.org/changelog.html, version 3.0.0 makes several improvements to the SFTP performance, that fixes this imbalance in our benchmarks.

To implement this version fix, it would be as simple as rebuilding the image the UPGRADE_PARAMIKO=True that ensure that the latest paramiko version available at pypi.org is installed via:

pip3 install --prefix=$(python3-config --prefix) paramiko; \

This however has shown the side-effect of producing the https://github.com/PyO3/pyo3/blob/main/guide/src/migration.md#each-pymodule-can-now-only-be-initialized-once-per-process import errors by the mod_wsgi process from time to time when importing the paramiko module. This is likely due to mod_wsgi usage of sub-interpreters and the failure to reinitialize the import in a different interpreter after the first initialization.

For the time being, the fix is to limit the bcrypt version to be less than 4.x which Rust implementation seems to introduce this error.

…ormance and bcrypt to avoid sub-interpreter import errors in mod_wsgi
@jonasbardino jonasbardino added the bug Something isn't working label Jul 3, 2025
@jonasbardino jonasbardino added this to the Rocky9 Deployments milestone Jul 3, 2025
Elaborate and polish comment about the choice of paramiko and bcrypt version in pip installation. Signed-off-by: Jonas Bardino <bardino@science.ku.dk>
Copy link
Contributor

@jonasbardino jonasbardino left a comment

Choose a reason for hiding this comment

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

Approved with minor polish of comments.

@jonasbardino jonasbardino merged commit 6039919 into master Jul 3, 2025
4 checks passed
@jonasbardino jonasbardino deleted the adjust_upgrade_paramiko branch July 3, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

3 participants