Solved

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

Posted on 2004-09-17
4
326 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 8

Expert Comment

by:mxjijo
ID: 12089327

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
ID: 12091716
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
ID: 12101903
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
ID: 12102660
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 Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

739 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