This commit is contained in:
spiritlhl
2024-06-23 09:00:07 +00:00
parent 37b274d630
commit dcfe8038e8
2 changed files with 36 additions and 2 deletions

View File

@@ -55,7 +55,7 @@ There are many bugs need to be fixed, welcome to PR to solve the problem, the ac
## Optimizing the memory footprint of Proxmox-VE on low-configuration systems
The following optimizations can reduce the memory usage by about 400M, which is better than nothing.
The following optimization can reduce at least 400M memory occupation, some machines can reduce more than 6GB, the actual reduction of how much memory occupation to test by yourself.
### Reduce the number of max_workers
@@ -118,6 +118,23 @@ systemctl stop spiceproxy.service
systemctl disable spiceproxy.service
```
### Deleting the memory cache using a timed task
Clearing different types of caches and performing TRIM operations on file systems
```shell
TEMP_CRON=$(mktemp)
sudo crontab -l > $TEMP_CRON
echo "*/5 * * * * echo 1 > /proc/sys/vm/drop_caches >> /root/checkio.log" >> $TEMP_CRON
echo "*/5 * * * * sleep 60; echo 2 > /proc/sys/vm/drop_caches >> /root/checkio.log" >> $TEMP_CRON
echo "*/5 * * * * sleep 120; echo 3 > /proc/sys/vm/drop_caches >> /root/checkio.log" >> $TEMP_CRON
echo "*/5 * * * * sleep 180; fstrim -av >> /root/checkio.log >> /root/checkio.log" >> $TEMP_CRON
sudo crontab $TEMP_CRON
rm $TEMP_CRON
```
The above commands require the ```sudo``` and ```crontab``` commands to be available on the host itself.
## Self-mapping of public ports on KVM VMs with open NATs
Use the ```nano``` or ```vim``` command to modify the file to add port mapping:

View File

@@ -55,7 +55,7 @@ spiritlhl/pve:7_aarch64
## 在低配置系统中优化Proxmox-VE的内存占用
以下优化可以减少400M内存左右的占用聊胜于无。
以下优化可以减少至少400M内存左右的占用部分机器能减少6GB以上实际减少多少内存占用自行测试
### 减少max_workers数量
@@ -118,6 +118,23 @@ systemctl stop spiceproxy.service
systemctl disable spiceproxy.service
```
### 使用定时任务删除内存缓存
清理不同类型的缓存以及对文件系统进行TRIM操作
```shell
TEMP_CRON=$(mktemp)
sudo crontab -l > $TEMP_CRON
echo "*/5 * * * * echo 1 > /proc/sys/vm/drop_caches >> /root/checkio.log" >> $TEMP_CRON
echo "*/5 * * * * sleep 60; echo 2 > /proc/sys/vm/drop_caches >> /root/checkio.log" >> $TEMP_CRON
echo "*/5 * * * * sleep 120; echo 3 > /proc/sys/vm/drop_caches >> /root/checkio.log" >> $TEMP_CRON
echo "*/5 * * * * sleep 180; fstrim -av >> /root/checkio.log >> /root/checkio.log" >> $TEMP_CRON
sudo crontab $TEMP_CRON
rm $TEMP_CRON
```
上面的命令需要宿主机本身有```sudo```和```crontab```命令才可使用。
## 在开设出的NAT的KVM虚拟机上自行映射公网端口
使用```nano```或```vim```命令修改文件增加端口映射: