Practical Configuration Notes for Low-Performance Cloud Servers
Server Configuration Overview
Recently, I purchased a cheap Alibaba Cloud ECS server with the following specs:
- CPU: 2 cores (vCPU)
- Memory: 2 GiB
- Storage: Cloud disk 40 GiB (2120 IOPS)
- Network: Fixed bandwidth 3M
The configuration is very basic. This post documents various issues encountered during use and their solutions.
Configuration Optimization
pnpm Optimization
Due to memory and CPU limitations, pnpm may freeze when installing dependencies. It’s necessary to limit concurrency and retry parameters:
# Limit concurrency to avoid running out of memory
pnpm config set concurrency 2
# Disable pnpm's automatic lockfile updates to reduce disk IO during install
pnpm config set auto-install-peers=false
# Set retry count to improve success rate in unstable networks
pnpm config set fetch-retries 3
# Set retry factor to increase the interval between retries
pnpm config set fetch-retry-factor 2
# Set network timeout
pnpm config set network-timeout 60000
SSH Key Management
Use the keychain
tool to centrally manage SSH and GPG key agents, enabling one-time unlocking and multi-session sharing.
# Install keychain
# Debian/Ubuntu
sudo apt install keychain
# CentOS/RHEL
sudo dnf install keychain
To enable automatic loading, edit your shell initialization file (such as .bash_profile
or .profile
) and add the following (adjust the key path as needed):
# Start keychain to manage SSH and GPG keys
if command -v keychain > /dev/null; then
eval $(keychain --quiet --eval ~/.ssh/id_rsa)
fi
# If you use GPG for signing or encryption, you can also manage it together:
eval $(keychain --quiet --eval ~/.ssh/id_rsa GPG_KEY_EMAIL@DOMAIN.COM)
The
--quiet
option suppresses login messages (such as* Found existing ssh-agent: 1996
), suitable for silent operation in production. ReplaceGPG_KEY_EMAIL@DOMAIN.COM
with your GPG key’s email address.
On first login, you’ll be prompted for your private key password. Subsequent new terminals or SSH sessions will automatically reuse the unlocked agent. Multiple shells share the same set of keys, so you don’t need to re-enter the password repeatedly.
Enjoy Reading This Article?
Here are some more articles you might like to read next: