By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,267 Members | 1,861 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,267 IT Pros & Developers. It's quick & easy.

Read/Write to a physical file in a web farm?

P: n/a
Hi,
need help for this.
In asp.net, when I do a load balancing on my website, which means there are
2 or more servers behind, one of my webpage needs to read/write a temp file
in the server. But the client's first request may go to the first server,
but the second request goes to the second server, so there is a chance that
the request could not find the correct file to read/write.

how to solve this issue?

Thanks a lot.

Best Regards,
fengchun
Nov 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"Feng Chun" <fe******@newsgroup.nospam> wrote in news:ueeGrS5pFHA.3884
@TK2MSFTNGP10.phx.gbl:
how to solve this issue?


Write to a central file sever or file share?

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #2

P: n/a
You can take the example of Brinkster web hosting. All files are located in a
centralized location.

You may of course, need to have the FilePaths etc in the Web.config or the
related configuration files.

Did this attend to your query?

"Feng Chun" wrote:
Hi,
need help for this.
In asp.net, when I do a load balancing on my website, which means there are
2 or more servers behind, one of my webpage needs to read/write a temp file
in the server. But the client's first request may go to the first server,
but the second request goes to the second server, so there is a chance that
the request could not find the correct file to read/write.

how to solve this issue?

Thanks a lot.

Best Regards,
fengchun

Nov 19 '05 #3

P: n/a
Hi Feng,

Since File system it self is not server transparent so directly read/write
file in asp.net web application will cause problems in loading balance
enviornment. Generally, we would suggest avoid such temp file processing.
If it is really necessary to do so, I think you can consider Lucas's
suggestion on make temp dir in a shared public place. Also, you can make
check when accessing the temp file, if not exist recreate it again.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Subject: Re: Read/Write to a physical file in a web farm?
| From: Lucas Tam <RE********@rogers.com>
| References: <ue**************@TK2MSFTNGP10.phx.gbl>
| Organization: None of Your Business!!!
| Message-ID: <Xn**************************@127.0.0.1>
| User-Agent: Xnews/??.01.30
| X-Face:
#gFwhH/LPM9"eq<Dzb3~[P'7%dS98vHkcFbX;SjezglosS.OP?:tzhHT7o=G03o0%St#;xT bMCCP
'rF/EnVDK-y*a(Qh3J)+Fn]"/&@D(dOG=ITH!\afBA$O}D";gSvoEpfd
| Reply-To: RE********@rogers.com
| Lines: 11
| X-Complaints-To: ab***@easynews.com
| X-Complaints-Info: Please be sure to forward a copy of ALL headers
otherwise we will be unable to process your complaint properly.
| Date: Tue, 23 Aug 2005 04:30:55 GMT
| Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTFEED02.phx.gbl!tornad o.fastwebnet.it!tiscali!ne
wsfeed1.ip.tiscali.net!newshub.sdsu.edu!newsfeed.n ews2me.com!newsfeed2.easyn
ews.com!easynews.com!easynews!easynews-local!fe04.news.easynews.com.POSTED!n
ot-for-mail
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:119620
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| "Feng Chun" <fe******@newsgroup.nospam> wrote in news:ueeGrS5pFHA.3884
| @TK2MSFTNGP10.phx.gbl:
|
| > how to solve this issue?
|
| Write to a central file sever or file share?
|
| --
| Lucas Tam (RE********@rogers.com)
| Please delete "REMOVE" from the e-mail address when replying.
| http://members.ebay.com/aboutme/coolspot18/
|

Nov 19 '05 #4

P: n/a
You could think about trying to use sticky sessions, its usually a feature
of network load balancing - search google for Single Affinity load
balancing.

You can read a little about it here then ask your network admin to help you
enable it if its what your looking for.

http://www.microsoft.com/technet/pro...ng/nlbfaq.mspx

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"Feng Chun" <fe******@newsgroup.nospam> wrote in message
news:ue**************@TK2MSFTNGP10.phx.gbl...
Hi,
need help for this.
In asp.net, when I do a load balancing on my website, which means there
are 2 or more servers behind, one of my webpage needs to read/write a temp
file in the server. But the client's first request may go to the first
server, but the second request goes to the second server, so there is a
chance that the request could not find the correct file to read/write.

how to solve this issue?

Thanks a lot.

Best Regards,
fengchun

Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.