All of lore.kernel.org
 help / color / mirror / Atom feed
* Limiting CPU resources of a cgroup (how do I) HELP REQUESTED
@ 2012-08-08 12:24 Vecu BOSSEUR
       [not found] ` <CACivvv0G3CspFnFud569vgdh=_2sofb4P3f2sfdFRuu2XSvRaQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Vecu BOSSEUR @ 2012-08-08 12:24 UTC (permalink / raw)
  To: cgroups-u79uwXL29TY76Z2rM5mHXA

Dear Friends or Foes ;-)


It is quite some time now that I first tried to find an adequate
solution to my problem; none managed to get me right yet :=-(

Basically, I would like to limit CPU resource usage (i.e. ~= time
share) allocated to a said cgroup to let's say 30% of the machine
processing power, or 30 % of time.
( SMP and HyperThreading technologies will change the interpretation
of that goal; regardless, please read on. )

I am in the very need to throttle some cgroup's CPU usage, regardless
the overall machine CPU utilisation. I mean that I need to cap the
processing power dedicated and allowed to some cgroup, whether the
CPU(s) is(are) otherwise IDLE or BUSY (with respect to other tasks or
groups).

Any hint on how to accomplish this?

All that I happend to do was to create a renice-boosted daemon that
alternately froze then unfroze the said cgroup (using a calculated
time ratio between running/frozen states) to keep the cgroup's CPU
usage under control.

You can ea

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Limiting CPU resources of a cgroup (how do I) HELP REQUESTED
       [not found] ` <CACivvv0G3CspFnFud569vgdh=_2sofb4P3f2sfdFRuu2XSvRaQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-08-09 13:11   ` Udayan Bapat
       [not found]     ` <ECF03057-612C-4544-8174-1F6FF0E9FAB7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Udayan Bapat @ 2012-08-09 13:11 UTC (permalink / raw)
  To: Vecu BOSSEUR; +Cc: cgroups-u79uwXL29TY76Z2rM5mHXA

Unless, I am mistaken cgroup does not provide max guarantee. It can be used to provide min guarantee by setting CPU.shares value.

Besides, what is the use case where you would want to limit the usage even when other threads/cores are idle? Wouldn't you want to give 100 percent to finish your task earlier than giving say 30 percent only?


On Aug 8, 2012, at 8:24 AM, Vecu BOSSEUR <vecu.bosseur-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> Dear Friends or Foes ;-)
> 
> 
> It is quite some time now that I first tried to find an adequate
> solution to my problem; none managed to get me right yet :=-(
> 
> Basically, I would like to limit CPU resource usage (i.e. ~= time
> share) allocated to a said cgroup to let's say 30% of the machine
> processing power, or 30 % of time.
> ( SMP and HyperThreading technologies will change the interpretation
> of that goal; regardless, please read on. )
> 
> I am in the very need to throttle some cgroup's CPU usage, regardless
> the overall machine CPU utilisation. I mean that I need to cap the
> processing power dedicated and allowed to some cgroup, whether the
> CPU(s) is(are) otherwise IDLE or BUSY (with respect to other tasks or
> groups).
> 
> Any hint on how to accomplish this?
> 
> All that I happend to do was to create a renice-boosted daemon that
> alternately froze then unfroze the said cgroup (using a calculated
> time ratio between running/frozen states) to keep the cgroup's CPU
> usage under control.
> 
> You can ea
> --
> To unsubscribe from this list: send the line "unsubscribe cgroups" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Limiting CPU resources of a cgroup (how do I) HELP REQUESTED
       [not found]     ` <ECF03057-612C-4544-8174-1F6FF0E9FAB7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2012-08-10  0:50       ` Li Zefan
  0 siblings, 0 replies; 3+ messages in thread
From: Li Zefan @ 2012-08-10  0:50 UTC (permalink / raw)
  To: Udayan Bapat; +Cc: Vecu BOSSEUR, cgroups-u79uwXL29TY76Z2rM5mHXA

On 2012/8/9 21:11, Udayan Bapat wrote:
> Unless, I am mistaken cgroup does not provide max guarantee. It can be used to provide min guarantee by setting CPU.shares value.

Yes it does, by setting cpu.cfs_quota_us and cpu.cfs_period_us.

> 
> Besides, what is the use case where you would want to limit the usage even when other threads/cores are idle? Wouldn't you want to give 100 percent to finish your task earlier than giving say 30 percent only?
> 
> 
> On Aug 8, 2012, at 8:24 AM, Vecu BOSSEUR <vecu.bosseur-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> 
>> Dear Friends or Foes ;-)
>>
>>
>> It is quite some time now that I first tried to find an adequate
>> solution to my problem; none managed to get me right yet :=-(
>>
>> Basically, I would like to limit CPU resource usage (i.e. ~= time
>> share) allocated to a said cgroup to let's say 30% of the machine
>> processing power, or 30 % of time.
>> ( SMP and HyperThreading technologies will change the interpretation
>> of that goal; regardless, please read on. )
>>
>> I am in the very need to throttle some cgroup's CPU usage, regardless
>> the overall machine CPU utilisation. I mean that I need to cap the
>> processing power dedicated and allowed to some cgroup, whether the
>> CPU(s) is(are) otherwise IDLE or BUSY (with respect to other tasks or
>> groups).
>>
>> Any hint on how to accomplish this?
>>
>> All that I happend to do was to create a renice-boosted daemon that
>> alternately froze then unfroze the said cgroup (using a calculated
>> time ratio between running/frozen states) to keep the cgroup's CPU
>> usage under control.
>>
>> You can ea

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-10  0:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-08 12:24 Limiting CPU resources of a cgroup (how do I) HELP REQUESTED Vecu BOSSEUR
     [not found] ` <CACivvv0G3CspFnFud569vgdh=_2sofb4P3f2sfdFRuu2XSvRaQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-08-09 13:11   ` Udayan Bapat
     [not found]     ` <ECF03057-612C-4544-8174-1F6FF0E9FAB7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-08-10  0:50       ` Li Zefan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.