最近给一台256M Ubuntu VPS安排上Transmission,结果启动之后总是莫名其妙崩溃了

使用 sudo journalctl -u transmission-daemon 从日志里只能看到下面的输出,这输出来跟没输出了似的..

Jun 01 15:25:41 chancel systemd[1]: transmission-daemon.service: Main process exited, code=killed, status=9/KILL
Jun 01 15:25:41 chancel systemd[1]: transmission-daemon.service: Failed with result 'signal'.
Jun 01 15:25:50 chancel systemd[1]: Starting Transmission BitTorrent Daemon...

大致猜测跟内存有关系,因为安装还是以往那样安装,这台唯一奇葩的地方就是内存小

先看看内存情况 free -h,输出如下

chancel@chancel:~$ free -h
              total        used        free      shared  buff/cache   available
Mem:           229M        191M        3.4M          8K         34M         30M

尝试创建swapfile文件来缓存

sudo touch /swapfile
sudo dd if=/dev/zero of=/swapfile bs=1024 count=1024000
sudo mkswap /swapfile
sudo swapon /swapfile

重启之后果然就正常了,此时内存输出如下

chancel@chancel:~$ free -h
              total        used        free      shared  buff/cache   available
Mem:           229M        191M        3.4M          8K         34M         30M
Swap:          999M        202M        797M

为了正常使用,建议最好开机挂载swapfile