Problem: scheduler doesn't seem to favor interactive processes:
On a desktop system with automatic cron-scheduled backups from one (
btrfs) disk to another (
ext4). The backup process mounts the idle disk (
/dev/sda<X>), backups to it, and finally unmounts it.
Every time the backup process kicks in, the system becomes unusable. The scheduler seems to be failing to do its most basic job of favoring interactive processes over batch ones. While the backup processes run, there's a lot of IO going on and everything else freezes. The keyboard and mouse pointer stop responding. Echo when keys are pressed in any terminal/shell is delayed by several seconds.
As soon as the backup completes, interactive response goes back to normal.
More details on the setup and configs:
The backup process uses
rsnapshot (which calls
cp -al) and runs at a lower priority (the backup job is preceded by
nice), like so:
nice /usr/bin/rsnapshot -VD -c /etc/my-rsnapshot.conf daily
Running the backup under
nice doesn't seem to help. During backups, all interactive processes seem to be starved by the heavy CPU and IO of the
This is a IA-64, iCore-7 system, which should be able to run 8-processes in parallel. Memory is 16GB and some of it is free. Trimmed down
mount output (when additional disk is mounted) is:
/dev/sdb2 on / type btrfs (rw,relatime,subvol=@,thread_pool=4) /dev/sdb3 on /home type btrfs (rw,relatime,subvol=@home,thread_pool=4) /dev/sda2 on /media/idisk/root ext4 (rw,relatime) /dev/sda3 on /media/idisk/home ext4 (rw,relatime) none on /sys/fs/cgroup type tmpfs (rw) cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,relatime,cpuset,release_agent=/run/cgmanager/agents/cgm-release-agent.cpuset,clone_children) cgroup on /sys/fs/cgroup/cpu type cgroup (rw,relatime,cpu,release_agent=/run/cgmanager/agents/cgm-release-agent.cpu) cgroup on /sys/fs/cgroup/cpuacct type cgroup (rw,relatime,cpuacct,release_agent=/run/cgmanager/agents/cgm-release-agent.cpuacct) cgroup on /sys/fs/cgroup/memory type cgroup (rw,relatime,memory,release_agent=/run/cgmanager/agents/cgm-release-agent.memory) cgroup on /sys/fs/cgroup/devices type cgroup (rw,relatime,devices,release_agent=/run/cgmanager/agents/cgm-release-agent.devices) cgroup on /sys/fs/cgroup/freezer type cgroup (rw,relatime,freezer,release_agent=/run/cgmanager/agents/cgm-release-agent.freezer) cgroup on /sys/fs/cgroup/blkio type cgroup (rw,relatime,blkio,release_agent=/run/cgmanager/agents/cgm-release-agent.blkio) cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,relatime,perf_event,release_agent=/run/cgmanager/agents/cgm-release-agent.perf_event) cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,relatime,hugetlb,release_agent=/run/cgmanager/agents/cgm-release-agent.hugetlb)
This is on an up-to-date 14.04 LTS system. The scheduler, by default is set to completely-fair-queue (
# cat /sys/block/sda/queue/scheduler noop deadline [cfq] # cat /sys/block/sdb/queue/scheduler noop deadline [cfq]
I was able to find one related question. scheduler starves processes which suggests to use
nice, but I'm already doing this.
Another related question with relevant information is: How do I change the
How can I make keyboard, mouse, and interactive-shells more responsive when the backup is running?
Thanks in advance.