This commit is contained in:
MacRimi 2025-03-01 20:03:10 +01:00
parent eec305c78a
commit b3c3e4d8e2
3 changed files with 214 additions and 136 deletions

View File

@ -1,15 +1,15 @@
import type { Metadata } from "next" import type { Metadata } from "next"
import { Network } from "lucide-react" import { Network } from 'lucide-react'
import CopyableCode from "@/components/CopyableCode" import CopyableCode from "@/components/CopyableCode"
export const metadata: Metadata = { export const metadata: Metadata = {
title: "ProxMenux Post-Install: Network Settings", title: "ProxMenux Post-Install: Network Settings",
description: description:
"Detailed guide to the Network Settings category in the ProxMenux post-install script for Proxmox VE optimization.", "Comprehensive guide to Network Settings in the ProxMenux post-install script for optimizing Proxmox VE network performance and configuration.",
openGraph: { openGraph: {
title: "ProxMenux Post-Install: Network Settings", title: "ProxMenux Post-Install: Network Settings",
description: description:
"Detailed guide to the Network Settings category in the ProxMenux post-install script for Proxmox VE optimization.", "Comprehensive guide to Network Settings in the ProxMenux post-install script for optimizing Proxmox VE network performance and configuration.",
type: "article", type: "article",
url: "https://macrimi.github.io/ProxMenux/docs/post-install/network", url: "https://macrimi.github.io/ProxMenux/docs/post-install/network",
images: [ images: [
@ -25,15 +25,35 @@ export const metadata: Metadata = {
card: "summary_large_image", card: "summary_large_image",
title: "ProxMenux Post-Install: Network Settings", title: "ProxMenux Post-Install: Network Settings",
description: description:
"Detailed guide to the Network Settings category in the ProxMenux post-install script for Proxmox VE optimization.", "Comprehensive guide to Network Settings in the ProxMenux post-install script for optimizing Proxmox VE network performance and configuration.",
images: ["https://macrimi.github.io/ProxMenux/network-settings-image.png"], images: ["https://macrimi.github.io/ProxMenux/network-settings-image.png"],
}, },
} }
export default function NetworkSettingsPage() { export default function NetworkSettingsPage() {
const applyNetworkOptimizationsCode = ` return (
# Create or update /etc/sysctl.d/99-network.conf <div className="container mx-auto px-4 py-8">
cat <<EOF > /etc/sysctl.d/99-network.conf <div className="flex items-center mb-6">
<Network className="h-8 w-8 mr-2 text-blue-500" />
<h1 className="text-3xl font-bold">Network Settings</h1>
</div>
<p className="mb-4">
The <strong>Network Settings</strong> category in the <code>customizable_post_install.sh</code> script focuses on optimizing network
performance and configuration for your Proxmox VE installation. These settings are crucial for ensuring efficient
network operations, which is vital in a virtualized environment where multiple VMs and containers share network resources.
</p>
<h2 className="text-2xl font-semibold mt-8 mb-4">Available Optimizations</h2>
<section className="mb-8">
<h3 className="text-xl font-semibold mb-2">Apply Network Optimizations</h3>
<p className="mb-4">
This optimization applies various network-related sysctl settings to improve network performance, security, and stability.
</p>
<p className="mb-4">
<strong>Why it's important:</strong> These optimizations can significantly improve network throughput, reduce latency, and enhance security. They adjust various kernel parameters related to networking, which is crucial in a virtualization environment where network performance directly impacts the performance of VMs and containers.
</p>
<h4 className="text-lg font-semibold mb-2">To apply this setting manually, run:</h4>
<CopyableCode code={`cat <<EOF | sudo tee /etc/sysctl.d/99-network-performance.conf
net.core.netdev_max_backlog=8192 net.core.netdev_max_backlog=8192
net.core.optmem_max=8192 net.core.optmem_max=8192
net.core.rmem_max=16777216 net.core.rmem_max=16777216
@ -80,149 +100,85 @@ net.netfilter.nf_conntrack_tcp_timeout_established = 28800
net.unix.max_dgram_qlen = 4096 net.unix.max_dgram_qlen = 4096
EOF EOF
# Apply sysctl changes sudo sysctl -p /etc/sysctl.d/99-network-performance.conf`} />
sysctl --system
# Ensure /etc/network/interfaces includes the interfaces.d directory
echo "source /etc/network/interfaces.d/*" >> /etc/network/interfaces
`
const enableTcpFastOpenCode = `
# Enable Google TCP BBR congestion control
cat <<EOF > /etc/sysctl.d/99-kernel-bbr.conf
# TCP BBR congestion control
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr
EOF
# Enable TCP Fast Open
cat <<EOF > /etc/sysctl.d/99-tcp-fastopen.conf
# TCP Fast Open (TFO)
net.ipv4.tcp_fastopen = 3
EOF
# Apply sysctl changes
sysctl --system
`
const forceAptIpv4Code = `
# Create APT configuration to force IPv4
echo "Acquire::ForceIPv4 \"true\";" > /etc/apt/apt.conf.d/99-force-ipv4
`
const installOpenVSwitchCode = `
# Update package lists
apt-get update
# Install OpenVSwitch
apt-get install -y openvswitch-switch openvswitch-common
# Verify installation
ovs-vsctl --version
`
return (
<div className="container mx-auto px-4 py-8">
<div className="flex items-center mb-6">
<Network className="h-8 w-8 mr-2 text-blue-500" />
<h1 className="text-3xl font-bold">Network Settings</h1>
</div>
<p className="mb-4">
The Network Settings category in the customizable_post_install.sh script focuses on optimizing network
performance and configuration for your Proxmox VE installation.
</p>
<h2 className="text-2xl font-semibold mt-8 mb-4">Available Optimizations</h2>
<section className="mb-8">
<h3 className="text-xl font-semibold mb-2">1. Apply Network Optimizations</h3>
<p className="mb-4">
This optimization applies various network-related sysctl settings to improve network performance and security.
</p>
<p className="mb-4">
<strong>Why it's beneficial:</strong> These optimizations can significantly improve network throughput, reduce
latency, and enhance security by adjusting various kernel parameters related to networking. Some key benefits
include:
</p>
<ul className="list-disc pl-5 mb-4">
<li>Increased maximum number of backlog connections</li>
<li>Optimized TCP window sizes for better throughput</li>
<li>Enhanced security by disabling potentially dangerous features like ICMP redirects</li>
<li>Improved TCP connection handling and timeout settings</li>
<li>Optimized network memory allocation</li>
</ul>
<h4 className="text-lg font-semibold mb-2">To apply this optimization manually, you would run:</h4>
<CopyableCode code={applyNetworkOptimizationsCode} />
</section> </section>
<section className="mb-8"> <section className="mb-8">
<h3 className="text-xl font-semibold mb-2">2. Enable TCP BBR and Fast Open</h3> <h3 className="text-xl font-semibold mb-2">Enable TCP BBR and Fast Open</h3>
<p className="mb-4"> <p className="mb-4">
This optimization enables Google's TCP BBR congestion control algorithm and TCP Fast Open. This optimization enables Google's TCP BBR congestion control algorithm and TCP Fast Open.
</p> </p>
<p className="mb-4"> <p className="mb-4">
<strong>Why it's beneficial:</strong> <strong>Why it's important:</strong> TCP BBR can significantly improve network throughput and reduce latency, especially on long-distance or congested networks. TCP Fast Open reduces connection establishment time, improving the speed of short-lived connections. These optimizations are particularly beneficial in virtualized environments where network performance is crucial for overall system responsiveness.
</p> </p>
<ul className="list-disc pl-5 mb-4"> <h4 className="text-lg font-semibold mb-2">To apply this setting manually, run:</h4>
<li> <CopyableCode code={`echo "net.core.default_qdisc = fq" | sudo tee -a /etc/sysctl.d/99-tcp-bbr.conf
TCP BBR (Bottleneck Bandwidth and Round-trip propagation time) can significantly improve network throughput echo "net.ipv4.tcp_congestion_control = bbr" | sudo tee -a /etc/sysctl.d/99-tcp-bbr.conf
and reduce latency, especially on long-distance or congested networks. echo "net.ipv4.tcp_fastopen = 3" | sudo tee -a /etc/sysctl.d/99-tcp-fastopen.conf
</li>
<li> sudo modprobe tcp_bbr
TCP Fast Open reduces connection establishment time, improving the speed of short-lived connections by sudo sysctl -p /etc/sysctl.d/99-tcp-bbr.conf
allowing data transfer during the initial TCP handshake. sudo sysctl -p /etc/sysctl.d/99-tcp-fastopen.conf`} />
</li>
</ul>
<h4 className="text-lg font-semibold mb-2">To apply this optimization manually, you would run:</h4>
<CopyableCode code={enableTcpFastOpenCode} />
</section> </section>
<section className="mb-8"> <section className="mb-8">
<h3 className="text-xl font-semibold mb-2">3. Force APT to Use IPv4</h3> <h3 className="text-xl font-semibold mb-2">Force APT to Use IPv4</h3>
<p className="mb-4">This optimization configures APT (Advanced Package Tool) to use IPv4 exclusively.</p>
<p className="mb-4"> <p className="mb-4">
<strong>Why it's beneficial:</strong> Forcing APT to use IPv4 can resolve issues in environments where IPv6 is This optimization configures APT (Advanced Package Tool) to use IPv4 exclusively.
not properly configured or is causing slowdowns. This ensures more reliable package management operations by:
</p> </p>
<ul className="list-disc pl-5 mb-4"> <p className="mb-4">
<li>Avoiding potential IPv6-related connection issues</li> <strong>Why it's important:</strong> Forcing APT to use IPv4 can resolve issues in environments where IPv6 is not properly configured or is causing slowdowns. This ensures more reliable package management operations, which is crucial for maintaining and updating your Proxmox VE system. It's particularly useful in networks where IPv6 connectivity might be unreliable or not fully supported.
<li>Ensuring consistent behavior across different network configurations</li> </p>
<li>Potentially speeding up package downloads in networks with suboptimal IPv6 support</li> <h4 className="text-lg font-semibold mb-2">To apply this setting manually, run:</h4>
</ul> <CopyableCode code={`echo 'Acquire::ForceIPv4 "true";' | sudo tee /etc/apt/apt.conf.d/99force-ipv4`} />
<h4 className="text-lg font-semibold mb-2">To apply this optimization manually, you would run:</h4>
<CopyableCode code={forceAptIpv4Code} />
</section> </section>
<section className="mb-8"> <section className="mb-8">
<h3 className="text-xl font-semibold mb-2">4. Install Open vSwitch</h3> <h3 className="text-xl font-semibold mb-2">Install Open vSwitch</h3>
<p className="mb-4"> <p className="mb-4">
This optimization installs Open vSwitch, a production quality, multilayer virtual switch. This optimization installs Open vSwitch, a production quality, multilayer virtual switch.
</p> </p>
<p className="mb-4"> <p className="mb-4">
<strong>Why it's beneficial:</strong> Open vSwitch provides advanced networking capabilities for virtualized <strong>Why it's important:</strong> Open vSwitch provides advanced networking capabilities for virtualized environments. It allows for more flexible and powerful network configurations, including support for VLAN tagging and trunking, advanced traffic shaping, and Quality of Service (QoS) capabilities. This is particularly beneficial for complex virtualization setups where fine-grained control over network traffic is required.
environments. It allows for more flexible and powerful network configurations, including:
</p> </p>
<ul className="list-disc pl-5 mb-4"> <h4 className="text-lg font-semibold mb-2">To apply this setting manually, run:</h4>
<li>Support for VLAN tagging and trunking</li> <CopyableCode code={`sudo apt-get update
<li>Advanced traffic shaping and Quality of Service (QoS) capabilities</li> sudo apt-get install -y openvswitch-switch
<li>Integration with software-defined networking (SDN) controllers</li>
<li>Improved network performance and scalability for large virtualized environments</li> # Verify installation
<li>Support for network function virtualization (NFV)</li> sudo ovs-vsctl --version`} />
</ul> </section>
<h4 className="text-lg font-semibold mb-2">To apply this optimization manually, you would run:</h4>
<CopyableCode code={installOpenVSwitchCode} /> <section className="mb-8">
<h3 className="text-xl font-semibold mb-2">Optimize Network Interface Settings</h3>
<p className="mb-4">
This optimization adjusts settings for network interfaces to improve performance and reliability.
</p>
<p className="mb-4">
<strong>Why it's important:</strong> Proper configuration of network interfaces can significantly improve network performance, reduce latency, and increase stability. This is particularly important in virtualized environments where multiple VMs and containers share network resources. Optimizations like increasing the TX queue length can help prevent packet drops under high load.
</p>
<h4 className="text-lg font-semibold mb-2">To apply this setting manually, run:</h4>
<CopyableCode code={`# Replace eth0 with your actual interface name
sudo ip link set eth0 txqueuelen 10000
# Make the change persistent
echo 'ACTION=="add", SUBSYSTEM=="net", KERNEL=="eth0", RUN+="/sbin/ip link set eth0 txqueuelen 10000"' | sudo tee /etc/udev/rules.d/60-net-txqueue.rules
# Enable TCP timestamps
echo 'net.ipv4.tcp_timestamps = 1' | sudo tee -a /etc/sysctl.d/99-network-performance.conf
sudo sysctl -p /etc/sysctl.d/99-network-performance.conf`} />
</section> </section>
<section className="mt-12 p-4 bg-blue-100 rounded-md"> <section className="mt-12 p-4 bg-blue-100 rounded-md">
<h2 className="text-xl font-semibold mb-2">Automatic Application</h2> <h2 className="text-xl font-semibold mb-2">Automatic Application</h2>
<p> <p>
All of these optimizations are automatically applied when selected in the Network section of the All of these optimizations are automatically applied when selected in the Basic Settings section of the
customizable_post_install.sh script. This automation ensures that these beneficial settings are applied customizable_post_install.sh script. This automation ensures that these beneficial settings are applied
consistently and correctly, saving time and reducing the potential for human error during manual consistently and correctly, saving time and reducing the potential for human error during manual
configuration. configuration.
</p> </p>
</section> </section>
</div> </div>
) );
} }

View File

@ -116,11 +116,10 @@ sudo sysctl -p /etc/sysctl.d/99-memory.conf`} />
<section className="mt-12 p-4 bg-blue-100 rounded-md"> <section className="mt-12 p-4 bg-blue-100 rounded-md">
<h2 className="text-xl font-semibold mb-2">Automatic Application</h2> <h2 className="text-xl font-semibold mb-2">Automatic Application</h2>
<p> <p>
All of these optimizations are automatically applied when selected in the System section of the All of these optimizations are automatically applied when selected in the Basic Settings section of the
<code>customizable_post_install.sh</code> script. This automation ensures that these beneficial settings are applied customizable_post_install.sh script. This automation ensures that these beneficial settings are applied
consistently and correctly across your Proxmox VE hosts, saving time and reducing the potential for human error consistently and correctly, saving time and reducing the potential for human error during manual
during manual configuration. By leveraging these optimizations, you can create a more robust, efficient, and configuration.
high-performing virtualization environment right from the start.
</p> </p>
</section> </section>
</div> </div>

View File

@ -1,11 +1,33 @@
import type { Metadata } from "next" import type { Metadata } from "next"
import { Box } from "lucide-react" import { Box } from 'lucide-react'
import CopyableCode from "@/components/CopyableCode"
export const metadata: Metadata = { export const metadata: Metadata = {
title: "ProxMenux Post-Install: Virtualization Settings", title: "ProxMenux Post-Install: Virtualization Settings",
description: description:
"In-depth guide to Virtualization Settings in the ProxMenux post-install script for optimizing Proxmox VE virtualization capabilities.", "Detailed guide to the Virtualization Settings category in the ProxMenux post-install script for Proxmox VE optimization.",
// ... (rest of the metadata remains the same) openGraph: {
title: "ProxMenux Post-Install: Virtualization Settings",
description:
"Detailed guide to the Virtualization Settings category in the ProxMenux post-install script for Proxmox VE optimization.",
type: "article",
url: "https://macrimi.github.io/ProxMenux/docs/post-install/virtualization",
images: [
{
url: "https://macrimi.github.io/ProxMenux/virtualization-settings-image.png",
width: 1200,
height: 630,
alt: "ProxMenux Post-Install Virtualization Settings",
},
],
},
twitter: {
card: "summary_large_image",
title: "ProxMenux Post-Install: Virtualization Settings",
description:
"Detailed guide to the Virtualization Settings category in the ProxMenux post-install script for Proxmox VE optimization.",
images: ["https://macrimi.github.io/ProxMenux/virtualization-settings-image.png"],
},
} }
export default function VirtualizationSettingsPage() { export default function VirtualizationSettingsPage() {
@ -15,8 +37,109 @@ export default function VirtualizationSettingsPage() {
<Box className="h-8 w-8 mr-2 text-blue-500" /> <Box className="h-8 w-8 mr-2 text-blue-500" />
<h1 className="text-3xl font-bold">Virtualization Settings</h1> <h1 className="text-3xl font-bold">Virtualization Settings</h1>
</div> </div>
{/* ... (rest of the component remains the same) */} <p className="mb-4">
</div> The <strong>Virtualization Settings</strong> category in the <code>customizable_post_install.sh</code> script focuses on optimizing your
) Proxmox VE installation for enhanced virtualization performance, compatibility, and functionality. These settings
} are crucial for creating a robust and efficient virtualization environment.
</p>
<h2 className="text-2xl font-semibold mt-8 mb-4">Available Optimizations</h2>
<section className="mb-8">
<h3 className="text-xl font-semibold mb-2">Enable VFIO IOMMU Support</h3>
<p className="mb-4">
This optimization enables IOMMU (Input-Output Memory Management Unit) and configures VFIO (Virtual Function I/O) for PCI passthrough, allowing direct assignment of PCI devices to virtual machines.
</p>
<p className="mb-4">
<strong>Why it's important:</strong> IOMMU and VFIO support enables near-native performance for PCI devices (like GPUs or network cards) in virtual machines. This is crucial for high-performance virtualization scenarios, such as GPU-accelerated workloads or network-intensive applications. It allows VMs to directly access hardware, bypassing the hypervisor, which significantly improves performance and reduces latency.
</p>
<h4 className="text-lg font-semibold mb-2">To apply this setting manually, run:</h4>
<CopyableCode code={`# For Intel CPUs
echo "intel_iommu=on" | sudo tee -a /etc/default/grub
# For AMD CPUs
echo "amd_iommu=on" | sudo tee -a /etc/default/grub
echo "vfio vfio_iommu_type1 vfio_pci vfio_virqfd" | sudo tee -a /etc/modules
sudo update-grub
sudo update-initramfs -u -k all`} />
</section>
<section className="mb-8">
<h3 className="text-xl font-semibold mb-2">Install Relevant Guest Agent</h3>
<p className="mb-4">
This optimization detects the virtualization environment and installs the appropriate guest agent for improved integration between the host and guest systems.
</p>
<p className="mb-4">
<strong>Why it's important:</strong> Guest agents improve communication and integration between the host and guest systems. They enable features like graceful shutdown of virtual machines, file sharing between host and guest, better performance monitoring, and enhanced resource allocation. This leads to more efficient management of VMs and improved overall system performance.
</p>
<h4 className="text-lg font-semibold mb-2">To apply this setting manually, run:</h4>
<CopyableCode code={`# For QEMU/KVM VMs
sudo apt-get install -y qemu-guest-agent
# For VMware VMs
sudo apt-get install -y open-vm-tools
# For VirtualBox VMs
sudo apt-get install -y virtualbox-guest-utils`} />
</section>
<section className="mb-8">
<h3 className="text-xl font-semibold mb-2">Configure KSM (Kernel Samepage Merging)</h3>
<p className="mb-4">
This optimization installs and configures the KSM control daemon, which helps optimize memory usage in virtualized environments by sharing identical memory pages between multiple virtual machines.
</p>
<p className="mb-4">
<strong>Why it's important:</strong> KSM can significantly reduce memory usage in environments with many similar VMs, allowing for higher VM density on a single host. This is particularly beneficial for scenarios where many VMs run similar operating systems or applications. By reducing overall memory usage, KSM can improve system performance and allow for more efficient resource utilization.
</p>
<h4 className="text-lg font-semibold mb-2">To apply this setting manually, run:</h4>
<CopyableCode code={`sudo apt-get install -y ksm-control-daemon
echo "KSM_ENABLED=1" | sudo tee -a /etc/default/ksm
echo "KSM_SLEEP_MSEC=100" | sudo tee -a /etc/default/ksm
sudo systemctl enable ksm
sudo systemctl start ksm`} />
</section>
<section className="mb-8">
<h3 className="text-xl font-semibold mb-2">Optimize CPU Governor</h3>
<p className="mb-4">
This setting configures the CPU governor to optimize performance for virtualization workloads.
</p>
<p className="mb-4">
<strong>Why it's important:</strong> The CPU governor controls how the processor scales its frequency based on system load. For virtualization environments, setting the governor to 'performance' ensures that the CPU always runs at its maximum frequency, providing consistent performance for VMs. This is crucial for workloads that require predictable and high CPU performance.
</p>
<h4 className="text-lg font-semibold mb-2">To apply this setting manually, run:</h4>
<CopyableCode code={`sudo apt-get install -y cpufrequtils
echo 'GOVERNOR="performance"' | sudo tee /etc/default/cpufrequtils
sudo systemctl restart cpufrequtils`} />
</section>
<section className="mb-8">
<h3 className="text-xl font-semibold mb-2">Enable Huge Pages Support</h3>
<p className="mb-4">
This optimization enables and configures huge pages support, which can improve memory management efficiency for large-memory VMs.
</p>
<p className="mb-4">
<strong>Why it's important:</strong> Huge pages reduce the overhead of Translation Lookaside Buffer (TLB) lookups, which can significantly improve performance for memory-intensive applications running in VMs. This is particularly beneficial for databases, in-memory caches, and other applications that manage large amounts of memory.
</p>
<h4 className="text-lg font-semibold mb-2">To apply this setting manually, run:</h4>
<CopyableCode code={`echo "vm.nr_hugepages = 1024" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
echo "hugetlbfs /dev/hugepages hugetlbfs defaults 0 0" | sudo tee -a /etc/fstab
sudo mount -a`} />
</section>
<section className="mt-12 p-4 bg-blue-100 rounded-md">
<h2 className="text-xl font-semibold mb-2">Automatic Application</h2>
<p>
All of these optimizations are automatically applied when selected in the Basic Settings section of the
customizable_post_install.sh script. This automation ensures that these beneficial settings are applied
consistently and correctly, saving time and reducing the potential for human error during manual
configuration.
</p>
</section>
</div>
);
}