解决update-apt-xapi占用资源过高的问题

最近云主机出现了个报错,查看系统日志发现是update-apt-xapi任务占用资源过高,甚至内存占完了无法开辟内存
云主机:Ubuntu 14.04.5 LTS

/var/log/syslog

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官网

猜你喜欢

转载自www.cnblogs.com/faithfu/p/11833901.html