最近雲主機出現了個報錯,查看系統日誌發現是update-apt-xapi任務佔用資源過高,甚至內存佔完了無法開闢內存
雲主機:Ubuntu 14.04.5 LTS
update-apt-xapi
是幹嘛的呢?
網上搜索出來,這個任務是系統用來更新內部資源包的,默認會自動在後臺啓動。主要是索引軟件包的擴展數據,不是必要的系統依賴,
解決方案一:
建議直接卸載
sudo apt-get autoremove --purge apt-xapian-index
sudo apt-get autoremove --purge
解決方案二:
修改參數. /etc/cron.weekly/apt-xapian-index
#!/bin/sh
CMD=/usr/sbin/update-apt-xapian-index
IONICE=/usr/bin/ionice
# Rebuild the index
if [ -x $CMD ]
then
if [ -x $IONICE ]
then
nice -n 19 $IONICE -c 3 $CMD --update --quiet
else
nice -n 19 $CMD --update --quiet
fi
fi
參考:
ubuntu官網