折腾小内存VPS

4,060 views次阅读
没有评论

之前用的VPS 内存一般都大于512M,最近因为翻墙需要购入一些小内存VPS。单纯安装SS 其实用不了多少内存,多出来的不用又觉得浪费。。。

 

干掉 SendMail 进程

SSH下,输入top命令,再输入M,可以查看运行的各个进程和内存使用率。里面逐一查看,没用的干掉。首先牺牲的是SendMail,我基本用不到它。

 

执行命令:

service sendmail stop

再执行:

chkconfig --list sendmail

显示: sendmail 0:off 1:off 2:on 3:on 4:on 5:on 6:off

执行:chkconfig --level 2345 sendmail off

这样sendmail被彻底关闭了。

 

或者直接执行命令

ntsysv

取消sendmail选项就可以了。

 

给OpenVZ增加一个可看但不可用的swap

 

  1. #!/bin/bash
  2. SWAP="${1:-512}"
  3. NEW="$[SWAP*1024]"; TEMP="${NEW//?/ }"; OLD="${TEMP:1}0"
  4. umount /proc/meminfo 2> /dev/null
  5. sed "/^Swap\(Total\|Free\):/s,$OLD,$NEW," /proc/meminfo > /etc/fake_meminfo
  6. mount --bind /etc/fake_meminfo /proc/meminfo

保存成a.sh 设成可执行的

chmod +x a.sh

然后执行一下。

./a.sh

再看下free

就有SWAP空间了

 

纯粹意淫@


 

未完待续

正文完
 0
HopoL
版权声明:本站原创文章,由 HopoL 于2015-12-26发表,共计653字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(没有评论)

HopoL's Blog

文章搜索
最新评论
HopoL HopoL Ciao!‌ Per trovare il tuo GUID, ti consiglio di cercare su Google qualcosa come "unRAID GUID tutorial" o "come ottenere il Flash GUID di unRAID". Ci sono tante guide dettagliate che ti spiegano passo passo come fare. Poiché il metodo esatto può variare a seconda del tuo setup, è meglio seguire una guida affidabile piuttosto che provare a spiegartelo qui. Buona fortuna!
HopoL HopoL Hey there! To find your GUID, I'd recommend searching for "unRAID GUID tutorial" or "how to get unRAID Flash GUID" on Google. There are plenty of detailed guides out there that walk you through the process step by step. Since the exact method can vary depending on your setup, it's best to follow a trusted tutorial rather than me trying to explain it here. Good luck!
acettu acettu tnx can you explain where i get my GUID?
HopoL HopoL full
19731973 19731973 so is this the full os or just a update file
HopoL HopoL Yeah, back in the older Unraid versions, some folks managed to get it booting from drives like SATA or NVMe by compiling the software themselves. But that method never got updated or maintained afterward, so it might not work with the current setups. Hope that helps!
MickeyDee MickeyDee Slightly off topic but anyone managed to get Unraid to boot off anything other than USB, like sata or nvme? If wrong place please delete and advise
Mrg Mrg I cannot Thank you enough. Thank you , Thank you , Thank you.
阿龙 阿龙 谢谢大佬分享
MickeyDee MickeyDee Cancell that, figured it out and it works, Much appriciated .