Solved

fopen and _lopen delay when opening a network file after a 15 minute idle period

Posted on 2004-09-17
4
318 Views
Last Modified: 2013-12-03
Our application needs to open files across a network, using fopen and _lopen calls.  Normally this is not a problem, but at our most recent installation site, we are experiencing a 6 second delay when executing an fopen or _lopen call to a network file.  Subsequent calls made immediately to fopen and _lopen execute without a delay, however if we wait for 15 minutes, the 6 second delay re-appears.

Other than this issue, normal networking functions at this site are within acceptable limits.

We are using Windows XP on the client workstation, and Windows 2000 on the file server.

An example of our call is:

fopen("\\192.168.1.100\bwclass\151\test.fil","rb");
0
Comment
Question by:johnjbarryjr
  • 2
4 Comments
 
LVL 8

Expert Comment

by:mxjijo
Comment Utility

I guess you need to narrow down the problem.

You should find out

1) Where exactly the delay happens
    a) Winthin requesting machine ?
    b) Network ?
    c) Machine at the other end

There could ne several reasons causing it. Network delay, disk usage etc.

I think you should run a few tools to figure this out.

Let me call the requesting machine as the client and the other machine server.

1) Run FileMon.exe (sysinternals.com) and a packet sniffer (ethereal.exe or similar) on the client side and find out if the there is a delay between the API call and the request packet being placed on the network.

2) At the same time run TDIMon.exe (sysinternals.com) on the serverside and find out if there is a network delay.

3) Again, Run FileMon.exe at the server side and see if there is a delay in disk access and/or sending the data back

Sounds a little messy, but without knowing which side causing the delay its hard to fix it.

Since you have 6 sec delay, you can easily observe the delay.
I would say start with Filemon.exe running on both sides and you can roughly see where the delay is.



0
 
LVL 86

Expert Comment

by:jkr
Comment Utility
I assume this is a problem regarding the caching of credentials on the server. After 15min idle, the clients' CRTs need to re-aithenticate aain, causing that delay.
0
 

Author Comment

by:johnjbarryjr
Comment Utility
jkr:  If this is the case, is there anyway to speed this up, or keep it from timing out?
0
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
Comment Utility
Hum, the easiest way (without fiddling with any registry or protocol settings) might be to issue an 'stat()' call in maybe 5min intervals to keep the connection "alive".
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

772 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