Solved

RMI question multiple servers on one host

Posted on 2000-05-06
7
616 Views
Last Modified: 2012-06-27
Is it possible to run many instances of one RMI server on one host. (Of course it is)
Every server binds the same Objects to the registry with different server specific names.
And all objects are accepting input at only one server socket meaning providing a RMISocketfactory wich offers only one port for server sockets.
Will RMI handle this properly?
For clarification lets say registry is running at port 1600 and all objects are running at port 1601 (forced by RMISocketFactory directing every unspecified request port=0 do 1601)
doesn't matter to wich process they belong.
The reason for doing something like that is with many clients the server may run out of system resources /number of concurrent threads for one process, maximum amount of memory ...) and it is not a good solution to have for every server an extra host.

0
Comment
Question by:falter
  • 4
  • 3
7 Comments
 
LVL 7

Expert Comment

by:Ravindra76
Comment Utility
Sun 1.2.1 src file part:-



 The UnicastRemoteObject class defines a non-replicated remote
  object whose references are valid only while the server process is
  alive.  The UnicastRemoteObject class provides support for
  point-to-point active object references (invocations, parameters,
  and results) using TCP streams.

If java allows , replicated RMI servers,
then there should be a

MultiCastRemoteObject.

We will wait when SUN will provide this
support.

Currently Only UniCast supports is there.

It clearly tells that the RMI server is not replicated on multiple systems.



:)


0
 
LVL 3

Author Comment

by:falter
Comment Utility
Sorry ravindra for the late reaction,
but I had some trouble to connect to EE.

May be you are right, that the described
scenario isn't possible.

But I didn't understand your UniCast MultiCast remark and the replicated RMIServer.

First I didn't want MultiCast, which means every object will get the incoming data.
Its more thinking about a dispatcher inside RMI finding the right process and object.

In the moment I'm doing something like this:
- running n RMIServer at one machine
- the server are identical
- every server creates its own registry
- every server binds at least 2 Objects to the registry
- every server gets one ServerSocket port for request to all the remote objects.

This works fine.

Now I want to reduce the number of used ports from 2*n to 2.

Ok I interpret your answer as "not possible"

Because the ServerSockets for the RMI-Calls are created by the serverprocess and not the registry I have to provide a new port number for the second server, because this is the one and only way tcp can find the right process.

Is this right?

If yes
Lets try n+1 ports


It should be possible to have a second process using the registry from server one and binding its own Objects (same as the 2 of server one) with different names to this registry.
Ok?

So I can reduce the number of needed ports to n+1 where n = number of running servers?

At the moment I need 2*n ports because every process will create a new registry.

You agree?

If not please give some explanation
and you will get the points.
(yow will get them also if you agree)

regards
jf
0
 
LVL 7

Accepted Solution

by:
Ravindra76 earned 200 total points
Comment Utility

MultiCast is not posible any way and U don't need it.

In mY view, Ur solution is complicating things.

Keep one server only.

Other wise compare the performance with

1. One server increasing Memory

2. Ur n+1 port solution

and decide Ur self only.

FOr me it looks lime meaning less to have multiple same servfer code with different ports doing the same job

:)
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 3

Author Comment

by:falter
Comment Utility
ravindra,

running multiple servers is necessary, because the server is reaching his memory limits on AIX, more than 300MB needed and the number of native threads is also near the limit of 512 possible ones per process.

Increasing the memory means to get a JVM for AIX 4.2 with 2GB address space.

Not yet available as I know.

But this will not solve the thread problem.

So I have to run more than one server on on a machine.

regards
jf
0
 
LVL 7

Expert Comment

by:Ravindra76
Comment Utility

Ok.

 After n+1 ports, Ur problem has solved ??
0
 
LVL 3

Author Comment

by:falter
Comment Utility
Yes,
its better than to have 2 * n ports visible to the client.

I think to get what I want I have to  write a RMI-Server only dispatching requests to a number of background servers not necessarly RMI servers.

This will reduce the number of ports seen by the client to 2.

Still an open question, what todo if the dispatcher runs out of system resources in this case threads.
If RMI reuses native threads the limit will be reached when about 500 parallel client request will come in.


 
0
 
LVL 7

Expert Comment

by:Ravindra76
Comment Utility
no idea
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
mergeTwo  challenge 13 70
changeXy challenge 13 55
mapShare challenge 13 65
Java Jpanels and Jframe 8 18
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now