PDA

View Full Version : Maximum CPU an appliance will use


mgorman
06-28-2007, 11:42 AM
3tera docs say this:
"[the CPU] maximum is enforced only if other appliances need the CPU..."

I wanted to double check that this is still, indeed, the current behavior and to make sure I understand properly.

Suppose I have two appliances, Tomcat & MySQL, and I want them to both run on the same machine. (I know I am not supposed to think about physical machines but I do have to make sure I have purchased enough and that everything will run with an appropriate level of performance, etc., so just bear with me.) So I want them to be able to run together so logic says to give each 0.50 CPU so that they can both run
on a 1-CPU machine. Now in this case, virtually every time Tomcat passes a request on to MySQL, the Tomcat appliance will be idle while the MySQL appliance is crunching. Likewise, once MySQL returns its response to Tomcat, MySQL will go back to being idle while Tomcat resumes processing. (I know there could be concurrent requests 180-degrees out of phase with this scenario, but ignore that for now.)

My question is this: I really want Tomcat to be able to take full advantage (i.e. 100%) of the CPU as long as MySQL is not also needing it. Likewise, I want MySQL to have full reign of the CPU as long as Tomcat isn't needing it. What should my min/max CPU configurations look like for these two appliances? Based on what your documentation says, I would say I should set the min/max to 0.50/0.50 for both Tomcat & MySQL. In so doing, I am saying that Tomcat & MySQL require at least half a CPU to work, and according to your docs, Tomcat max CPU of 0.50 will not be enforced as long as MySQL is idle.

Can you please confirm?

nobu
06-29-2007, 06:41 AM
I do not think that it means the resources allocated for apps will change dynamically.
I'm checking with other guys to make sure about this, as Peter once mentioned
AppLogic 2 or 3 would have this capability.

If you want your two processes to share the resources, maybe it's best to put them in a single appliacne.

Anyway, stay tuned for more precision.

mgorman
06-29-2007, 07:54 AM
Well I don't mean to say I plan to go into a running application and change the amount of CPU I have allocated (thought I would like that!). I am just double checking that the actual behavior is what the docs say it is, and that is this (paraphrased): the max CPU you have set for your appliance will not be enforced unless another appliance that just happens to be running on the same machine is making use of the CPU.

Lets think of it another way. Suppose I have a Tomcat appliance and a MySQL appliance, both configured with 0.55 CPU. They both can't run on the same physical 1-cpu machine because, together, they would require 1.1 CPU so AppLogic is forced to run them on two different physical machines. Assuming I have nothing else running, my fundamental question is this: Even though I have set the max CPU to 0.55, will my appliance make full use of 100% of the CPU if nothing else is running on that machine?

The docs indicate yes, the 0.55 max will not be enforced if nothing else is running. I just wanted to make sure.

PeterNic
06-29-2007, 11:48 AM
Suppose I have two appliances, Tomcat & MySQL, and I want them to both run on the same machine. (I know I am not supposed to think about physical machines but I do have to make sure I have purchased enough and that everything will run with an appropriate level of performance, etc., so just bear with me.) So I want them to be able to run together so logic says to give each 0.50 CPU so that they can both run
on a 1-CPU machine. Now in this case, virtually every time Tomcat passes a request on to MySQL, the Tomcat appliance will be idle while the MySQL appliance is crunching. Likewise, once MySQL returns its response to Tomcat, MySQL will go back to being idle while Tomcat resumes processing.


Mike, you are exactly right.

By default, AppLogic will not enforce (cap) the CPU usage of an appliance unless another appliance on the same physical server needs the CPU.

Starting with AppLogic 2.0 (currently in beta), there are two additions:

you now have the option to start your application with the --cap_cpu option. If you do so, the CPU will be capped to what each appliance got on app start (see 'comp list <appname>' to see how much CPU each appliance got). This is useful for testing and to verify that your application will operate well on the resources you assigned.
an interesting case for SMP appliances: even if you don't specify the --cap_cpu option, the max CPU that an appliance will get is up to the next whole CPU. For example, if you gave the appliance 1.5 CPUs, the appliance will not be able to utilize more than 2 CPUs, even if the server has 4 CPUs and nothing else needs them. This is because the SMP appliances are started with # of CPUs based on the amount of CPU resource you assign to them -- rounded up to a whole CPU. (I was amazed Linux kernel works well with 3 CPUs; we could not get it to work with 2.5 CPUs :) )


Also, Nobu pointed out an out-of-date text in the documentation; we will fix that -- thanks Nobu.

Regards,
-- Peter

mgorman
06-29-2007, 12:02 PM
Cool.

(I wanted my message to just be "Cool" but your forum said it had to be at least 10 characters long so I thought I would add this parenthetical explanation to try to comply with these weird forum rules, which could understandably be added to, say, the minimum length of your password, but sometimes, just saying "Cool" can be an effective message, especially if you are trying to be good spirited or even the punchline of a joke. It has been said that the essence of humor is timing and brevity, but if you had a really good punchline, it wouldn't work on this forum unless it was at least 10 characters long. Well I think I have gotten the requisite 10 characters in, so I will sign off now.)