Fog Creek Software
Discussion Board




Simultaneous virtual machines

Let's imagine that my colleagues/managers consider running 30 (thirty) JVMs simultaneously on a production machine (because they want to run 30 instances of the same Java program), and that I am thus thrown into perplexity.
Apart from my instinctive feelings, what sound arguments could be given in this context ?
(Bi-pro W2K box, if it is of any interest).

Pakter
Monday, May 26, 2003

Well you have three major issues, probably.

First is memory. Memory is cheap, so that shouldn't really be a stopping point.

Second is communication. If this thing is running 30 times, do they all talk to each other? Or are they independent entities?

Third is CPU. How busy are these things? If they're constantly computing, then running 30 of them is more or less counter-productive. However, if they spend most of the time waiting for input, then there's no reason that a modern computer can't handle 30 things running at once (in fact, you probably have a couple dozen things running at once just after booting a Win2K box).

So it doesn't really sounds like that big a deal, if your problem space is appropriate.

Brad Wilson (dotnetguy.techieswithcats.com)
Monday, May 26, 2003

What OS are you running on?

Daniel Shchyokin
Monday, May 26, 2003

'thus thrown into perplexity'

Can I steal that? <g>

B#
Monday, May 26, 2003

Why don't you run a multi-threaded application in a single JVM? There would be a lot less overhead.

Julian
Tuesday, May 27, 2003

Julian, you remind me of this about recycling VMs
http://www.kuro5hin.org/story/2002/7/10/13747/7913

.
Tuesday, May 27, 2003

Javalobby's Echnidna could be an alternative:

http://www.javagroup.org/echidna/

It provides process management for running multiple applications within a single JVM.

Ged Byrne
Tuesday, May 27, 2003

On a production machine? As in something a customer wants to see and use. Java processes are big, typically about 8MB and will grow big if they are doing a lot like GUI work. The biggest issue is resource sharing, things like filesystems, databases, sockets etc. Other than that, you might be OK for free memory, certainly with later VMs.

If this is a requirement for a customer site, then ultimately you need to consider making your application multithreaded. VM sharing is another issue, but I have no experience with it.

Your misgivings are as big as mine, running 30 VMs is somethign I wouldn't want to do. You get a lot of that stuff when you are makign CORBA servers and it can be unpleasant.

Richard
Tuesday, May 27, 2003

Thanks to all.

The application is not supposed to be CPU-bound (although the task manager rarely indicates less than 94 % ; it depends on the test computer though).
I suppose they chose the figure of 30 to fit in memory.
The processes do not talk to each other (apart from writing to a common database).
I forgot to mention that the server freezes from time to time, though not on every test computer, again.
(This is JRE 1.4.1_02 on Windows 2000.)

As suggested Julian, my idea was to run a multi-threaded application in a single JVM. But that would mean a few hours of development, which they seem afraid to do.

I didn't know Echidna, I suppose it could be the sort of tool to use in such a case.

P.S. :
B# : sorry for my funny-sounding expressions ; you can guess this is not my mother tongue ;-)

Pakter
Tuesday, May 27, 2003

Pakter

Quite the contrary!  That phrasing was perfect and I wish it had been mine...

B#
Tuesday, May 27, 2003

Pakter,

There was an article in Java Developer's Journal written in the last year or so on how to run multiple applications on top of a single JVM as opposed to running each one in its own JVM.

I forget which  issue it was in, but it should be available from their website.

http://www.sys-con.com/java/

Avrom Finkelstein
Tuesday, May 27, 2003

Found the article, from the April 2002 issue.

"A Multiple Application Launcher"

http://www.sys-con.com/java/article.cfm?id=1408

Avrom Finkelstein
Tuesday, May 27, 2003

*  Recent Topics

*  Fog Creek Home