• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 334
  • Last Modified:

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

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
johnjbarryjr
Asked:
johnjbarryjr
  • 2
1 Solution
 
mxjijoCommented:

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
 
jkrCommented:
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
 
johnjbarryjrAuthor Commented:
jkr:  If this is the case, is there anyway to speed this up, or keep it from timing out?
0
 
jkrCommented:
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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now