All of lore.kernel.org
 help / color / mirror / Atom feed
* cgroups and limit firefox  processes cpu time
@ 2010-01-22  5:34 william
       [not found] ` <4B5938EB.3040809-FuVYq0B8HF8swF9hGuCkNA@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: william @ 2010-01-22  5:34 UTC (permalink / raw)
  To: containers-qjLDD68F18O7TbgM5vRIOg

Hello list

I have a question about how i can limit the cpu for a firefox process on 
a terminal server.

We have 150 firefox processes running on a terminalserver but there are 
always people who take more cpu when they use flash or java.
Some firefox processes take sometimes about 50 percent cpu time.
Is there a way to give all firefox processes equal cpu shares so that 
other people who are using firefox for research have no issues (slow 
responding scrolling and menu)  because there are a few firefox 
processes eating all the cpu time?

I hope i made clear what i meant, this is new to me and i haven't found 
other people with examples doing the same.

e.g
1 core
firefox 1 80%
firefox 2 60%
firefox 3 10%

now what i want is that the firefox processes 1 and 2 get the cpu time 
they want but if firefox process 3 is going todo something then he gets 
the cpu time he want's because the first two are over there limit.

I will be happy to answer questions to make this more clear.

With kind regards

William

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

* Re: cgroups and limit firefox  processes cpu time
       [not found] ` <4B5938EB.3040809-FuVYq0B8HF8swF9hGuCkNA@public.gmane.org>
@ 2010-01-22 11:15   ` Balbir Singh
       [not found]     ` <4B5988DC.8020100-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Balbir Singh @ 2010-01-22 11:15 UTC (permalink / raw)
  To: william
  Cc: containers-qjLDD68F18O7TbgM5vRIOg, V Srivatsa, Bharata B Rao,
	Dhaval Giani

On Friday 22 January 2010 11:04 AM, william wrote:
> Hello list
> 
> I have a question about how i can limit the cpu for a firefox process on 
> a terminal server.
> 
> We have 150 firefox processes running on a terminalserver but there are 
> always people who take more cpu when they use flash or java.
> Some firefox processes take sometimes about 50 percent cpu time.
> Is there a way to give all firefox processes equal cpu shares so that 
> other people who are using firefox for research have no issues (slow 
> responding scrolling and menu)  because there are a few firefox 
> processes eating all the cpu time?

Are these running on behalf of different users? You can always create a
good hiearchy and organize. FAIR_USER scheduler option is going away
soon. Some more context on the firefox applications and whose behalf
they are running on, etc would help.


-- 
Three Cheers,
Balbir Singh

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

* Re: cgroups and limit firefox  processes cpu time
       [not found]     ` <4B5988DC.8020100-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
@ 2010-01-22 11:33       ` william
       [not found]         ` <4B598D0D.9080206-FuVYq0B8HF8swF9hGuCkNA@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: william @ 2010-01-22 11:33 UTC (permalink / raw)
  To: balbir-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
  Cc: containers-qjLDD68F18O7TbgM5vRIOg, V Srivatsa, Bharata B Rao,
	Dhaval Giani

Balbir Singh wrote:
> On Friday 22 January 2010 11:04 AM, william wrote:
>   
>> Hello list
>>
>> I have a question about how i can limit the cpu for a firefox process on 
>> a terminal server.
>>
>> We have 150 firefox processes running on a terminalserver but there are 
>> always people who take more cpu when they use flash or java.
>> Some firefox processes take sometimes about 50 percent cpu time.
>> Is there a way to give all firefox processes equal cpu shares so that 
>> other people who are using firefox for research have no issues (slow 
>> responding scrolling and menu)  because there are a few firefox 
>> processes eating all the cpu time?
>>     
>
> Are these running on behalf of different users? You can always create a
> good hiearchy and organize. FAIR_USER scheduler option is going away
> soon. Some more context on the firefox applications and whose behalf
> they are running on, etc would help.
>
>
>   
The terminal server only hosts firefox processes for different users 
(user is only allowed to login once) to provide internet access in a 
secure way.

So i have 150 firefox processes for different users. So i cannot set one 
group, I have to put all those processes in a separate container if i 
get it right?

William

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

* Re: cgroups and limit firefox  processes cpu time
       [not found]         ` <4B598D0D.9080206-FuVYq0B8HF8swF9hGuCkNA@public.gmane.org>
@ 2010-01-22 11:36           ` Balbir Singh
       [not found]             ` <4B598DB2.2030709-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Balbir Singh @ 2010-01-22 11:36 UTC (permalink / raw)
  To: william
  Cc: containers-qjLDD68F18O7TbgM5vRIOg, V Srivatsa, Dhaval Giani,
	Bharata B Rao

On Friday 22 January 2010 05:03 PM, william wrote:
> Balbir Singh wrote:
>> On Friday 22 January 2010 11:04 AM, william wrote:
>>   
>>> Hello list
>>>
>>> I have a question about how i can limit the cpu for a firefox process on 
>>> a terminal server.
>>>
>>> We have 150 firefox processes running on a terminalserver but there are 
>>> always people who take more cpu when they use flash or java.
>>> Some firefox processes take sometimes about 50 percent cpu time.
>>> Is there a way to give all firefox processes equal cpu shares so that 
>>> other people who are using firefox for research have no issues (slow 
>>> responding scrolling and menu)  because there are a few firefox 
>>> processes eating all the cpu time?
>>>     
>>
>> Are these running on behalf of different users? You can always create a
>> good hiearchy and organize. FAIR_USER scheduler option is going away
>> soon. Some more context on the firefox applications and whose behalf
>> they are running on, etc would help.
>>
>>
>>   
> The terminal server only hosts firefox processes for different users 
> (user is only allowed to login once) to provide internet access in a 
> secure way.
> 
> So i have 150 firefox processes for different users. So i cannot set one 
> group, I have to put all those processes in a separate container if i 
> get it right?

If the kernel is compiled with fair users then you are set, but that
option might go away soon. Yes, putthing them all in their own cgroup is
the best option. This can be done easily using libcgroup tools.

-- 
Three Cheers,
Balbir Singh

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

* Re: cgroups and limit firefox processes cpu time
       [not found]             ` <4B598DB2.2030709-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
@ 2010-01-22 12:00               ` Dhaval Giani
       [not found]                 ` <8aa016e11001220400j5bc568e6vb9d087f4310203aa-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Dhaval Giani @ 2010-01-22 12:00 UTC (permalink / raw)
  To: balbir-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8
  Cc: william, containers-qjLDD68F18O7TbgM5vRIOg, Bharata B Rao,
	Libcg Development list, V Srivatsa

On Fri, Jan 22, 2010 at 12:36 PM, Balbir Singh
<balbir-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> wrote:
> On Friday 22 January 2010 05:03 PM, william wrote:
>> Balbir Singh wrote:
>>> On Friday 22 January 2010 11:04 AM, william wrote:
>>>
>>>> Hello list
>>>>
>>>> I have a question about how i can limit the cpu for a firefox process on
>>>> a terminal server.
>>>>
>>>> We have 150 firefox processes running on a terminalserver but there are
>>>> always people who take more cpu when they use flash or java.
>>>> Some firefox processes take sometimes about 50 percent cpu time.
>>>> Is there a way to give all firefox processes equal cpu shares so that
>>>> other people who are using firefox for research have no issues (slow
>>>> responding scrolling and menu)  because there are a few firefox
>>>> processes eating all the cpu time?
>>>>
>>>
>>> Are these running on behalf of different users? You can always create a
>>> good hiearchy and organize. FAIR_USER scheduler option is going away
>>> soon. Some more context on the firefox applications and whose behalf
>>> they are running on, etc would help.
>>>
>>>
>>>
>> The terminal server only hosts firefox processes for different users
>> (user is only allowed to login once) to provide internet access in a
>> secure way.
>>
>> So i have 150 firefox processes for different users. So i cannot set one
>> group, I have to put all those processes in a separate container if i
>> get it right?
>
> If the kernel is compiled with fair users then you are set, but that
> option might go away soon.

I have already posted a patch to remove it, and it will go away in the
next release of the kernel

> Yes, putthing them all in their own cgroup is
> the best option. This can be done easily using libcgroup tools.
>

Right, libcgroup already has the ability to sort on the basis of
username and process name. You should be able to use that. Though it
might be impractical at the moment since you will need to list all the
usernames/groups in a configuration file.

Thanks,
Dhaval

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

* Re: cgroups and limit firefox processes cpu time
       [not found]                 ` <8aa016e11001220400j5bc568e6vb9d087f4310203aa-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2010-01-22 13:06                   ` william
  0 siblings, 0 replies; 6+ messages in thread
From: william @ 2010-01-22 13:06 UTC (permalink / raw)
  To: Dhaval Giani
  Cc: containers-qjLDD68F18O7TbgM5vRIOg, V Srivatsa, Bharata B Rao,
	Libcg Development list, balbir-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8

Dhaval Giani wrote:
> On Fri, Jan 22, 2010 at 12:36 PM, Balbir Singh
> <balbir-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> wrote:
>   
>> On Friday 22 January 2010 05:03 PM, william wrote:
>>     
>>> Balbir Singh wrote:
>>>       
>>>> On Friday 22 January 2010 11:04 AM, william wrote:
>>>>
>>>>         
>>>>> Hello list
>>>>>
>>>>> I have a question about how i can limit the cpu for a firefox process on
>>>>> a terminal server.
>>>>>
>>>>> We have 150 firefox processes running on a terminalserver but there are
>>>>> always people who take more cpu when they use flash or java.
>>>>> Some firefox processes take sometimes about 50 percent cpu time.
>>>>> Is there a way to give all firefox processes equal cpu shares so that
>>>>> other people who are using firefox for research have no issues (slow
>>>>> responding scrolling and menu)  because there are a few firefox
>>>>> processes eating all the cpu time?
>>>>>
>>>>>           
>>>> Are these running on behalf of different users? You can always create a
>>>> good hiearchy and organize. FAIR_USER scheduler option is going away
>>>> soon. Some more context on the firefox applications and whose behalf
>>>> they are running on, etc would help.
>>>>
>>>>
>>>>
>>>>         
>>> The terminal server only hosts firefox processes for different users
>>> (user is only allowed to login once) to provide internet access in a
>>> secure way.
>>>
>>> So i have 150 firefox processes for different users. So i cannot set one
>>> group, I have to put all those processes in a separate container if i
>>> get it right?
>>>       
>> If the kernel is compiled with fair users then you are set, but that
>> option might go away soon.
>>     
>
> I have already posted a patch to remove it, and it will go away in the
> next release of the kernel
>
>   
>> Yes, putthing them all in their own cgroup is
>> the best option. This can be done easily using libcgroup tools.
>>
>>     
>
> Right, libcgroup already has the ability to sort on the basis of
> username and process name. You should be able to use that. Though it
> might be impractical at the moment since you will need to list all the
> usernames/groups in a configuration file.
>   
So then i would have to create a config file with 65k users in it :(

Would it be possible to setup a specific application in libcgroup, so 
that the libcgroup will create a container for that firefox process?

say something like:
#applicationgroup firefox {
#    perm {
#        task {
#            application = /usr/bin/firefox;
#            gid = users;
#        }
#    }
#    cpu {
#        cpu.shares = 10;
#    }
#}

so every firefox process started should get the same cpu cycles.
And if i understood it correctly a process can take as much cpu cycles 
as he want till the hard limit , if another process requests more cycles 
and has not reached his soft limit then the process which is already 
over the softlimit will be cut back?


> Thanks,
> Dhaval
>   

Thank you for helping.

With kind regards
William

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

end of thread, other threads:[~2010-01-22 13:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-22  5:34 cgroups and limit firefox processes cpu time william
     [not found] ` <4B5938EB.3040809-FuVYq0B8HF8swF9hGuCkNA@public.gmane.org>
2010-01-22 11:15   ` Balbir Singh
     [not found]     ` <4B5988DC.8020100-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2010-01-22 11:33       ` william
     [not found]         ` <4B598D0D.9080206-FuVYq0B8HF8swF9hGuCkNA@public.gmane.org>
2010-01-22 11:36           ` Balbir Singh
     [not found]             ` <4B598DB2.2030709-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2010-01-22 12:00               ` Dhaval Giani
     [not found]                 ` <8aa016e11001220400j5bc568e6vb9d087f4310203aa-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-01-22 13:06                   ` william

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.