<div class="gmail_quote">On Wed, Aug 18, 2010 at 10:55 AM, Michael B Allen <span dir="ltr">&lt;<a href="mailto:ioplex@gmail.com">ioplex@gmail.com</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>
<div></div>
<div class="h5">On Wed, Aug 18, 2010 at 2:53 AM, Marasim &lt;<a href="mailto:marasim@gmail.com">marasim@gmail.com</a>&gt; wrote:<br>&gt; Michael B Allen &lt;ioplex &lt;at&gt; <a href="http://gmail.com/" target="_blank">gmail.com</a>&gt; writes:<br>

&gt;&gt;<br>&gt;&gt; Hi Marasim,<br>&gt;&gt;<br>&gt;&gt; If you have a retry loop, why do you care if JCIFS has to reopen the pipe?<br>&gt;&gt;<br>&gt;&gt; If a connection is idle for longer than jcifs.smb.client.soTimeout<br>

&gt;&gt; milliseconds, it will be closed to conserve resources. This is by<br>&gt;&gt; design.<br>&gt;&gt;<br>&gt;&gt; Mike<br>&gt;<br>&gt; Hi Mike,<br>&gt;<br>&gt; Thanks again for your reply.<br>&gt;<br>&gt; I do have to care, because it is affecting the performance of my application<br>

&gt; (closing and reopening connections become expensive when a large number of hosts<br>&gt; are involved that I use to connect using JCIFS).<br>&gt;<br>&gt; So looks like I should be able to set a higher value for<br>&gt; jcifs.smb.client.soTimeout to test if that helps the performance.<br>

<br></div></div>Hi Marasim,<br><br>Actually that could have the opposite effect. If you really have that<br>many connections open, all of those sockets use a lot of memory. JCIFS<br>closes those connections specifically to free that memory. If you<br>

increase soTimeout to keep idle connections open, you may pressure VM<br>memory and performance could actually decrease.<br><br>It all depends on how frequently you&#39;re using the connection. If it&#39;s<br>every consistently 60 or 120 seconds (like a network monitor agent),<br>

then increasing the soTimeout might be better than the default of 35<br>because you know the connection is going to be used again very soon.<br>If it&#39;s every 5 minutes or longer or the timing is unpredictable, then<br>

I would use the default soTimeout. Try both ways and measure.<br>
<div>
<div></div>
<div class="h5"><br>Mike<br><br>--<br>Michael B Allen<br>Java Active Directory Integration<br><a href="http://www.ioplex.com/" target="_blank">http://www.ioplex.com/</a><br></div></div></blockquote></div>
<div> </div>
<div> </div>
<div>
<div>Hi Mike,</div>
<div> </div></div>
<div>Thanks for your help. Changing the timeout did help in my case, I need to do more testing though to make sure it is stable :)</div>
<div> </div>
<div>Marasim</div>