Bruno,
Thanks for the helpful advice. However in the end all I had to do was
change jndi.properties from e.g.
java.naming.provider.url jrmi://localhost:4444
to
java.naming.provider.url jrmi://123.456.789.123:4444
This did the trick and the server now runs ok. Actually, I remember seeing
this in the archives before:
http://www.objectweb.org/messages/JonasUsers/2000/04/msg00046.html
It seems strange that specifying "localhost" should cause so many problems
(I was also intermittently getting a "Cannot rebind TM" error on starting
the registry/server). According to this posting by Kathleen Milsted you
were intending to fix this some time ago:
http://www.objectweb.org/messages/JonasUsers/2000/04/msg00062.html
It would be nice to use localhost as it's one less thing for the sysadmin
to change if the server is moved between machines.
One other question on the topic of socket resources. I notice that
InitialContext has a close method which frees up resources associated with
it. Would calling this on a JRMI InitialContext help free up sockets?
Joe
-----Original Message-----
From: Bruno Dumant [SMTP:[EMAIL PROTECTED]]
Sent: Wednesday, November 29, 2000 1:08 PM
To: Joe Gittings
Cc: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: Re: "Too many open files" error from Jeremie on Linux: socket
management problem?
Joe Gittings wrote:
> Hi,
>
> I'm trying to run Jonas on Linux using Jeremie. I have a large, complex
> compound bean which makes lots of intercomponent calls to populate itself
> when ejbLoad is called. Unfortunately on Linux, some way into the
execution
> of ejbLoad (i.e. when it's already made lots of intercomponent calls), we
> are getting the exception listed below.
>
> The bean loads fine under Solaris and WinNT. Also, more trivial beans
> (which don't make lots of intercomponent calls during ejbLoad) load fine
on
> Linux.
>
> It looks like Jeremie is exceeding the per-process filehandle limit
(which
> is fixed by the kernel at 1024). Some possibilities we have thought of,
> which may or may not be contributing to this apparent problem:
> * Is Jeremie setting SO_LINGER on the sockets it uses?
SO_LINGER is set to 100 on the sockets used by Jeremie (don't ask me why
100
...) . If you want to change this value, add a property in the
jonathan.prop
file :
jonathan.tcpip.SO_LINGER=<VALUE>
If <VALUE> is negative, the property is not set. If it is positive, it is
set
to the provided value.
Likewise, you may want to change the SO_TIMEOUT value used. The default is
0
(no timeout). To have a different timeout, add a property in the
jonathan.prop
file :
jonathan.tcpip.SO_TIMEOUT=<VALUE>
Remember that the jonathan.prop should be somewhere in the classpath.
You may also want to monitor the creation/deletion of connections, by
adding a
property in the jonathan.prop file :
jonathan.tcpip.verbose = true
Last comment : Jonathan tries to reuse connections as much as possible, and
keeps a pool of connections for possible future use. The default size of
the
pool is 22. To change that value, add a property :
jonathan.tcpip.max_idle=<VALUE>
<VALUE> should be positive.
To be honest, I have just been looking at the code, and I am not sure it is
correct. I will let you know if I find something.
> * Is Jeremie closing *both* ends of a socket connection when it's done
with
> them?
Yes.
> We're using Redhat Linux 6.2, (2216 kernel). Has anyone else run up
> against this problem? And if so, how did you solve it? Will it help us to
> increase the per-process filehandle limit? Any hints would be very
> gratefully received!
Best regards,
Bruno
--
*******************************************************************
Bruno Dumant
DTL/ASR
france telecom R&D
38-40 rue du general Leclerc
92794 Issy Moulineaux Cedex 9
FRANCE
mailto:[EMAIL PROTECTED]
tel: +33 1 45 29 46 03
fax: +33 1 45 29 66 04
*******************************************************************