Post-Install: Performance

Settings post-install Proxmox

Performance options inside the Customizable post-install script. Currently this category contains a single optimization: replacing gzip with pigz so backups and compression use every CPU core instead of one.

What this category covers

The only performance option here rewires the system's gzip to a parallel implementation. Other performance-related tweaks (memory tuning, I/O scheduling, ZFS ARC sizing, kernel limits) live under their own categories (System, Storage) because they affect different subsystems.

Use pigz for faster gzip compression

Standard gzip compresses data using a single CPU core. On modern Proxmox hosts with 8, 16 or 32 cores, that is a huge bottleneck during vzdump VM/CT backups, log rotation, and anything else that pipes through gzip. pigz is a drop-in parallel replacement: same gzip-compatible output, but it spreads the work across every core.

What ProxMenux does

Four steps, all idempotent:

  1. Sets pigz: 1 in /etc/vzdump.conf so Proxmox's backup tool uses pigz natively.
  2. Installs the pigz apt package if not already present.
  3. Writes a wrapper script at /bin/pigzwrapper that forwards every argument to /usr/bin/pigz.
  4. Moves the original /bin/gzip aside to /bin/gzip.original and replaces /bin/gzip with the wrapper. From now on, anything that calls gzip — logrotate, tar czf, scripts, vzdump — uses pigz transparently.
# What ProxMenux runs under the hood
sed -i "s/#pigz:.*/pigz: 1/" /etc/vzdump.conf
apt-get -y install pigz

cat > /bin/pigzwrapper <<'EOF'
#!/bin/sh
PATH=/bin:$PATH
GZIP="-1"
exec /usr/bin/pigz "$@"
EOF
chmod +x /bin/pigzwrapper

# Only replaces gzip if not already replaced (idempotent)
[ ! -f /bin/gzip.original ] && mv /bin/gzip /bin/gzip.original \
  && cp /bin/pigzwrapper /bin/gzip && chmod +x /bin/gzip

This replaces a system binary

Replacing /bin/gzip with a wrapper is unusual. It is safe (the wrapper produces gzip-compatible output), but worth knowing: scripts that hardcode paths, run inside restrictive chroots, or verify binary hashes may behave differently. The original binary is preserved as /bin/gzip.original so you can always swap it back.

Not reversible from the Uninstall menu

This optimization is applied by Customizable, but does not currently have a matching entry in the Uninstall Optimizations menu. To revert it by hand, restore the original gzip and clear the wrapper:
# Manual rollback of pigz
mv /bin/gzip.original /bin/gzip    # restore original binary
rm /bin/pigzwrapper
sed -i 's/^pigz: 1/#pigz: 1/' /etc/vzdump.conf
# Optional: remove the package
apt purge pigz

Verification

After applying, gzip --version should mention pigz. A quick benchmark also shows the speed difference on a multi-core host:

# Confirm gzip now points to pigz
gzip --version
# Expected first line: "pigz 2.x … by Mark Adler"

# Compare throughput (create a 1GB file of random data and compress it)
dd if=/dev/urandom of=/tmp/test.bin bs=1M count=1024 status=none
time gzip -k /tmp/test.bin       # uses pigz — parallel
rm /tmp/test.bin.gz

time /bin/gzip.original -k /tmp/test.bin   # original single-threaded gzip
rm /tmp/test.bin /tmp/test.bin.gz

When this matters most

The impact scales with how many cores the host has and how often you run backups. On a 2-core home-lab box with one daily vzdump, the benefit is marginal. On a 16-core production host backing up a dozen VMs every night, pigz can cut the backup window to a fraction of what single-threaded gzip takes.

Related