I've recently seen an email on our internal mail list which was entitled
"Multiple JVMs vs Multiple Instances"
The author of the original email was testing performance differences between multiple jvms on a single container vs multiple containers... He noticed (quite correctly in my view) that the performance is virtually identical..
So whats the difference, well in my view one of the responses nailed it down, smack down style..
The processes share the same configuration for the entire container (not
just for the JVM parameters).
Same applications, same container configuration etc.
This is a great way of scaling symmetrically to better utilize the CPUs and
still only having to manage one container.
You can individually control all of the container configurations, have
different applications deployed etc. You can use this strategy in
combination with multiple JVMs to scale while at the same time having a
heterogeneous environment wrt. nr. of applications deployed, container
So it really falls down into a how do you want to deploy your oc4j application.
Now that reminds me of a different question I often get, its
"How many JVMs shall I have for my application?"
Now in the past the JVM had some limitations and if you had a large number of connections it was very very wise to have lots of jvms.. Nowadays the JVM has grown up and is quite a mature beast.. I remember for example 3 years ago I was working with a Israeli Consulting company and they were boasting that they had 2500 concurrent users running on a single jvm. Quite a large number it sounded but not so large when you dug a bit and discovered that the actualy pages/second wasnt huge (10's from memory) and that the clients were all effectively stateless.....
So back to the original question, lets assume I have an application with say 100 users, how many JVMs, well different people have different ideas, you really need to test it, but my rule of thumb to start with is :
- Minimum of two JVMs , this is to cope with JVM process failure
and then add 1.2 per available extra CPU in your box, then round it up/down depending on how you feel....
So a 4 CPU box would have 2+(round(3*1.2)) = 5
Now different CPUs/Operating systems/applications work differently so you always need to load test it and see what works best in your environment.
Thankfully in Oracle Application Server Control its really easy to change the number of JVMs for a OC4J instance, simply navigate to the OC4J Instance / Server properties and then you'll see at the top of the page "JVM processes"
Checkout this blog entry
Also dont forget the documentation!!!
Oracle Application Server 10.1.3.1 Performance Guide
Oracle Application Server OC4J Config. & Admin Guide