162 lines
5.5 KiB
TypeScript
Raw Normal View History

2025-03-01 16:12:26 +01:00
import type { Metadata } from "next"
import { Zap } from "lucide-react"
2025-03-02 11:17:44 +01:00
import CopyableCode from "@/components/CopyableCode"
2025-03-01 16:12:26 +01:00
export const metadata: Metadata = {
title: "ProxMenux Post-Install: Performance Settings",
description:
2025-03-02 11:17:44 +01:00
"Guide to Performance Settings in the ProxMenux post-install script for optimizing your Proxmox VE system performance.",
2025-03-01 16:12:26 +01:00
openGraph: {
title: "ProxMenux Post-Install: Performance Settings",
description:
2025-03-02 11:17:44 +01:00
"Guide to Performance Settings in the ProxMenux post-install script for optimizing your Proxmox VE system performance.",
2025-03-01 16:12:26 +01:00
type: "article",
url: "https://macrimi.github.io/ProxMenux/docs/post-install/performance",
images: [
{
url: "https://macrimi.github.io/ProxMenux/performance-settings-image.png",
width: 1200,
height: 630,
alt: "ProxMenux Post-Install Performance Settings",
},
],
},
twitter: {
card: "summary_large_image",
title: "ProxMenux Post-Install: Performance Settings",
description:
2025-03-02 11:17:44 +01:00
"Guide to Performance Settings in the ProxMenux post-install script for optimizing your Proxmox VE system performance.",
2025-03-01 16:12:26 +01:00
images: ["https://macrimi.github.io/ProxMenux/performance-settings-image.png"],
},
}
2025-03-02 11:17:44 +01:00
function StepNumber({ number }: { number: number }) {
return (
<div className="inline-flex items-center justify-center w-8 h-8 mr-3 text-white bg-blue-500 rounded-full">
<span className="text-sm font-bold">{number}</span>
</div>
)
}
2025-03-01 16:12:26 +01:00
export default function PerformanceSettingsPage() {
return (
<div className="container mx-auto px-4 py-8">
<div className="flex items-center mb-6">
<Zap className="h-8 w-8 mr-2 text-blue-500" />
<h1 className="text-3xl font-bold">Performance Settings</h1>
</div>
<p className="mb-4">
2025-03-02 11:17:44 +01:00
The <strong>Performance Settings</strong> category focuses on optimizing various aspects of your Proxmox VE
system to enhance overall performance. These settings are designed to improve system efficiency and speed up
certain operations.
</p>
<h2 className="text-2xl font-semibold mt-8 mb-4">Available Optimizations</h2>
2025-03-02 19:10:18 +01:00
2025-03-02 18:54:24 +01:00
<h3 className="text-xl font-semibold mt-16 mb-4 flex items-center">
<StepNumber number={1} />
Configure pigz for Faster gzip Compression
</h3>
<p className="mb-4">
2025-03-02 19:10:18 +01:00
This optimization replaces the default <strong>gzip</strong> compression with
<strong>pigz</strong>, a parallelized version that speeds up compression by
utilizing multiple CPU cores.
2025-03-02 18:54:24 +01:00
</p>
2025-03-02 19:10:18 +01:00
<h4 className="text-lg font-semibold mt-4">What does this configuration do?</h4>
2025-03-02 18:54:24 +01:00
<ul className="list-disc pl-5 mb-4">
2025-03-02 19:10:18 +01:00
<li><strong>Forces pigz usage</strong> in vzdump backups to accelerate Proxmox VE backup compression.</li>
<li><strong>Ensures pigz is installed</strong> before applying optimizations.</li>
<li><strong>Creates a pigz wrapper script</strong> to enforce compression behavior.</li>
<li><strong>Replaces gzip with the pigz wrapper</strong>, making pigz the system-wide default compressor.</li>
2025-03-02 18:54:24 +01:00
</ul>
2025-03-02 19:10:18 +01:00
<h4 className="text-lg font-semibold mt-4">How is pigz configured?</h4>
2025-03-02 18:54:24 +01:00
2025-03-02 19:10:18 +01:00
<p className="text-lg mb-2">This automation executes the following commands:</p>
2025-03-02 18:54:24 +01:00
<CopyableCode
code={`
2025-03-02 19:10:18 +01:00
# Force pigz usage in vzdump configuration (for Proxmox backups)
2025-03-02 18:54:24 +01:00
sed -i "s/#pigz:.*/pigz: 1/" /etc/vzdump.conf
2025-03-02 19:10:18 +01:00
# Install pigz package
2025-03-02 18:54:24 +01:00
apt-get -y install pigz
2025-03-02 19:10:18 +01:00
# Create a pigz wrapper script
2025-03-02 18:54:24 +01:00
cat <<EOF > /bin/pigzwrapper
#!/bin/sh
PATH=/bin:\$PATH
GZIP="-1"
exec /usr/bin/pigz "\$@"
EOF
chmod +x /bin/pigzwrapper
2025-03-02 19:10:18 +01:00
# Replace gzip with pigz wrapper (backup original gzip binary)
if [ ! -f /bin/gzip.original ]; then
mv -f /bin/gzip /bin/gzip.original
cp -f /bin/pigzwrapper /bin/gzip
chmod +x /bin/gzip
fi
2025-03-02 18:54:24 +01:00
`}
/>
2025-03-02 19:10:18 +01:00
<h4 className="text-lg font-semibold mt-6">How to Verify pigz is Active</h4>
2025-03-02 18:54:24 +01:00
<p className="mb-4">
2025-03-02 19:10:18 +01:00
You can confirm that <strong>pigz</strong> is being used by running the following command:
2025-03-02 18:54:24 +01:00
</p>
<CopyableCode
code={`
2025-03-02 19:10:18 +01:00
# Check if gzip now points to pigz
gzip --version
2025-03-02 18:54:24 +01:00
`}
/>
<p className="mb-4">
2025-03-02 19:10:18 +01:00
If the output mentions <code>pigz</code>, the replacement was successful.
2025-03-02 18:54:24 +01:00
</p>
2025-03-02 19:10:18 +01:00
<h4 className="text-lg font-semibold mt-6">Performance Test: gzip vs. pigz</h4>
2025-03-02 18:54:24 +01:00
<p className="mb-4">
2025-03-02 19:10:18 +01:00
To measure the speed difference between gzip and pigz, try compressing a large file:
2025-03-02 18:54:24 +01:00
</p>
<CopyableCode
code={`
2025-03-02 19:10:18 +01:00
# Compress a file using gzip (single-threaded)
2025-03-02 18:54:24 +01:00
time gzip largefile.img
2025-03-02 19:10:18 +01:00
# Compress a file using pigz (multi-threaded)
2025-03-02 18:54:24 +01:00
time pigz largefile.img
`}
/>
<p className="mb-4">
2025-03-02 19:10:18 +01:00
Since pigz utilizes multiple CPU cores, the compression process should be significantly faster.
2025-03-02 18:54:24 +01:00
</p>
<p className="mt-4">
2025-03-02 19:10:18 +01:00
With this optimization, vzdump backups and all gzip compression tasks benefit from parallel processing,
reducing execution time considerably.
2025-03-02 18:54:24 +01:00
</p>
2025-03-02 11:17:44 +01:00
2025-03-02 19:10:18 +01:00
2025-03-02 11:17:44 +01:00
<section className="mt-12 p-4 bg-blue-100 rounded-md">
<h2 className="text-xl font-semibold mb-2">Automatic Application</h2>
<p>
This performance optimization is automatically applied when selected in the Performance section. The
automation ensures that pigz is correctly configured and integrated into your system, potentially improving
the speed of compression operations without requiring manual intervention.
</p>
</section>
2025-03-01 16:12:26 +01:00
</div>
)
}