import type { Metadata } from "next" import { getTranslations, getMessages, setRequestLocale } from "next-intl/server" import { Link } from "@/i18n/navigation" import { ExternalLink } from "lucide-react" import { DocHeader } from "@/components/ui/doc-header" import { Callout } from "@/components/ui/callout" import CopyableCode from "@/components/CopyableCode" export async function generateMetadata({ params, }: { params: Promise<{ locale: string }> }): Promise { const { locale } = await params const t = await getTranslations({ locale, namespace: "docs.postInstall.performance.meta" }) return { title: t("title"), description: t("description") } } type RelatedItem = { label: string; href: string; tail?: string; tailRich?: string } export default async function PostInstallPerformancePage({ params, }: { params: Promise<{ locale: string }> }) { const { locale } = await params setRequestLocale(locale) const t = await getTranslations({ locale, namespace: "docs.postInstall.performance" }) const messages = (await getMessages({ locale })) as unknown as { docs: { postInstall: { performance: { pigz: { doesItems: string[] } related: { items: RelatedItem[] } } } } } const doesItems = messages.docs.postInstall.performance.pigz.doesItems const relatedItems = messages.docs.postInstall.performance.related.items const code = (chunks: React.ReactNode) => {chunks} const strong = (chunks: React.ReactNode) => {chunks} const em = (chunks: React.ReactNode) => {chunks} const pigzAnchor = (chunks: React.ReactNode) => ( {chunks} ) return (
{t.rich("intro.body", { em })}

{t("pigz.heading")}

{t.rich("pigz.intro", { code, strong, a: pigzAnchor })}

{t("pigz.doesTitle")}

{t("pigz.doesIntro")}

    {doesItems.map((_, idx) => (
  1. {t.rich(`pigz.doesItems.${idx}`, { code, em })}
  2. ))}
/bin/pigzwrapper <<'EOF' #!/bin/sh PATH=/bin:$PATH export GZIP="-1" exec /usr/bin/pigz "$@" EOF chmod +x /bin/pigzwrapper # gzip is diverted: the real binary is kept as gzip.distrib, package updates # land there, and the wrapper takes the place of gzip. # Path on Proxmox VE 9; on Proxmox VE 8 it is /bin/gzip. cp -p /usr/bin/gzip /usr/bin/gzip.distrib dpkg-divert --local --no-rename --divert /usr/bin/gzip.distrib --add /usr/bin/gzip cat /bin/pigzwrapper > /usr/bin/gzip`} className="my-4" /> {t.rich("pigz.replacesBody", { code })} {t.rich("pigz.revertBody", { strong, link: (chunks) => {chunks}, code: (chunks) => {chunks} })} /usr/bin/gzip # restore the real binary dpkg-divert --local --no-rename --remove /usr/bin/gzip rm /usr/bin/gzip.distrib /bin/pigzwrapper sed -i 's/^pigz: 1/#pigz: 1/' /etc/vzdump.conf # Optional: remove the package apt purge pigz`} className="my-4" />

{t("pigz.verifyTitle")}

{t.rich("pigz.verifyBody", { code })}

{t.rich("pigz.whenBody", { strong })}

{t("related.heading")}

    {relatedItems.map((item, idx) => (
  • {item.label} {item.tailRich ? t.rich(`related.items.${idx}.tailRich`, { code }) : item.tail}
  • ))}
) }