I am trying to put a hard limit in CPU usage for a dd command . I have created the following unit file
[Unit]
Description=Virtual Distributed Ethernet
[Service]
ExecStart=/usr/bin/ddcommand
CPUQuota=10%
[Install]
WantedBy=multi-user.target
which call the following simple script
#!/bin/sh
dd if=/dev/zero of=/dev/null bs=1024k
As I have seen in this guide: http://www.freedesktop.org/software/systemd/man/systemd.resource-control.html The CPU usage for my dd service should not exceed the 10%. But when I run the system-cgtop command the usage is about 70-75% .
Any ideas of what am I doing wrong and how can I fix it?
P.S. When I execute systemctl show dd
I get the following results regarding CPU
CPUShares=18446744073709551615
StartupCPUShares=18446744073709551615
CPUQuotaPerSecUSec=100ms
LimitCPU=18446744073709551615