RE: Too many connections open and dependency on actual ethernet interface
"Tim Anderson" <[email protected]>
| Newsgroups | gmane.comp.java.openjms.user |
|---|---|
| Message-ID | <[email protected]> |
> From: David Waitzman
>
> We are using openjms-0.7.6.1 running on one Redhat Enterprise
> linux box.
> There are four processes communicating with a local openjms
> server. The config file is:
>
> <Configuration>
> <!-- Optional. This represents the default configuration -->
> <ServerConfiguration host="localhost" embeddedJNDI="true" />
>
> <!-- Required when using an RMI connector -->
> <Connectors>
> <Connector scheme="rmi">
> <ConnectionFactories>
> <QueueConnectionFactory name="JmsQueueConnectionFactory" />
> <TopicConnectionFactory name="JmsTopicConnectionFactory" />
> </ConnectionFactories>
> </Connector>
> </Connectors>
>
> <!-- Required -->
> <DatabaseConfiguration>
> <JdbmDatabaseConfiguration name="openjms.db" />
> </DatabaseConfiguration>
>
> <!-- Required -->
> <AdminConfiguration script="${openjms.home}\bin\startup.bat" />
>
> <!-- Optional. If not specified, no destinations will be
> created -->
> <AdministeredDestinations>
> <AdministeredTopic name="xxTopic"/>
> <AdministeredQueue name="xx1" />
> <AdministeredQueue name="xx2" />
> <AdministeredQueue name="xx3"/>
> </AdministeredDestinations>
>
> <!-- Optional. If not specified, no users will be created -->
> <Users>
> <User xxxxx />
> </Users>
> </Configuration>
>
> I have two problems:
>
> 1. I get a hundred or so TCP connections open, many short lived.
> Why? I would expect perhaps 4 long lived TCP connections
> would be sufficient (one from each of the processes to the
> openjms server). I think that the many connections are
> causing performance problems.
This is a side-effect of using the RMI connector.
>
> 2. The TCP connections use the external IP address of the
> host. If the ethernet interface is unplugged or ifconfig'ed
> down, then openjms dies. How do I force use of the loopback
> interface, 127.0.0.1?
>
Try changing:
<ServerConfiguration host="localhost" embeddedJNDI="true" />
to:
<ServerConfiguration host="127.0.0.1" embeddedJNDI="true" />
And set the following system property for both clients and server:
-Djava.rmi.server.hostname=127.0.0.1
(See http://java.sun.com/j2se/1.4.2/docs/guide/rmi/javarmiproperties.html)
Also, don't use the JdbmDatabase if you can avoid it. Its no longer
supported.
-Tim
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642