C# - Distributed Critical Section In Web-farm?

Mar 18, 2011

I have about 50 web-sites, load-balanced across 5 web-servers. They all use Enterprise Library Caching, and access the same Caching database. The items in the Caching database are refreshed every few hours, using an ICacheItemRefreshAction implementation.I want to guarantee that only one web-site ever refreshes the cache, by putting the refresh code in a critical section. If the web-sites were running in a single app-pool on a single server, I could use a lock()If the web-sites were running in separate app-pools on a single server, I could use a Mutex.However, these will not ensure the critical section across multiple web-servers.Currently, I am creating a new key in the caching database to act as a mutex. This will generally work, but I can see a slim chance that 2 processes could enter the critical section.

public class TakeLongTimeToRefresh : ICacheItemRefreshAction
{
#region ICacheItemRefreshAction Members

[code]...

View 2 Replies


Similar Messages:

Architecture :: Distributed Caching / Keeping Cache In Sync Between Multiple Webservers Or Even Better Farm Cache Management To Another Server?

Feb 26, 2010

I've got a web application that runs of a state server. It looks like soon it may need to distributed and there will be two web servers behind a load balancer.

This works great for session state but my next challenge is Cache

My application leverages heavily of cache. I understand ASP.Net 4.0 will be offering more here but nothing much has been said about the how too.

There are two challenges that I face

1). Each webserver will have its own copy of cache whereas it would be more efficient to put this to a third server the same as session state is put to state server.

2). The real challenge is keeping cache in sync if a simple dataset derived from the database is changed my code dumps that cache item and reloads the cache. That's all well on one webserver but webserver number two wont know to drop that particular cache item and reload it. This could cause some unexpected problems in the application.

For scenario number 2 I could attempt to do some smart coding so server number two knows to dump the cache and reload it.

My guess is someone else has already been here before and there's probably a better implementation approach rather than writing extra code.

Does anyone know how I could achieve the goal of keeping Cache in sync between multiple webservers or even better farm Cache management to another server?

View 2 Replies

Are CRC's Required For Critical Webservice Calls

Dec 1, 2010

I have data that is stored on a local machine and periodically replicated using webservices. This data is critical to the application of this program and is along the lines of business transactions.

TransactionHeader JOIN TransactionDetail

So forth.

Should I be using some type of CRC checking when sending the data to the webservice or is this handled by the TCP protocol itself sufficiently?

EDIT: Just to be clear the data isnt deleted from the client until the server acknowledges receipt and I use strongly typed parameters in my webservice but I am more thinking about "mangled" data (although in all cases but string it should theoretically fail datatype casting).

View 1 Replies

IIS Configuration :: Adding Add Section In HttpHandler Section In Web Config Results In Blank Page?

Jul 12, 2013

with this code website works perfect

<configuration>
<system.web>
<httpHandlers>
</httpHandlers>
</system.web>
</configuration>

but when I add

<add path="ThumbHandler.ashx" verb="*" type="Delshad.WebControls.ThumbHandler,Delshad.ThumbPic"/>

or

<add verb="GET" path="CaptchaImage.axd"
type="MSCaptcha.CaptchaImageHandler, MSCaptcha" />

in httphandlers section when I go in my site it is only a blank page!

before In other two host there wasent problem but this is a new host and I face with this problem.also in local there isn't any problem.

View 1 Replies

Custom Server Controls :: Unable To Create A Forgot Password Section Within Login Section

Mar 10, 2011

I am trying to create a forgot password section within my login section and it doesnt seem to work.

In my forgotpassword.aspx page my code looks like this:

[code]....

According to our records, you have requested that your password be reset. Your new password is: <%Password%>

If you have any questions or trouble logging on contact a site administrator.

No connection could be made because the target machine actively refused it ::1:25

Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it ::1:25

View 2 Replies

Caching Over Distributed Application On Servers?

Aug 22, 2010

I have a web application that will be distributed over 2 servers and the Database will be on a server other than the 2 servers. so application on each server will access database exists in another server.I am using caching in the application and when data changed the cache is cleared and the problem now how each server will feel with cache changes on the other server?

I have tried SQLCache dependency before and i have heard about Memcached, Velocity and Enterprise cache so which one will be more efficient and optimal for this case? and i have another solution to create webservice method on each application and when the cache is cleared in one application it will request the webservice method on the other application to clear cache there.

Which technique is more efficient and optimal in performance and security? and is SQLCache dependency related to SQL database only or can be applicable to other databases like Oracle?

Note: I am using load balancer to distribute requests coming for the application among the 2 server

View 1 Replies

C# - Querying Multiple Databases Using Distributed Web Services?

Feb 5, 2011

I have a quick question about best practices and especially expected performance for the following scenario:

If I want to query data from multiple servers that contain schematically identital sql databases, would having each server provide a web method that a single client application can consume be an appropriate (and relatively fast) solution?

The data just needs to be consolidated on the client end, where several web methods would have to be consumed serially (or in parallel?) to provide the data to the client. Each server would also be implementing Entity Framework as an ORM.

Performance is my main concern here, would it turn out excessively slow as we start to scale up to more and more servers?

View 2 Replies

MSDTC Distributed Transaction Coordinator Enabling?

Feb 24, 2011

I've a web server and a separate SQL server. I'm trying to use transaction scope to ensure that SQL queries are completed with my linq queries.

I wrap everything with this

using (TransactionScope scope = new TransactionScope())

I want to know where I need to install DTC. Do I need to install it on the IIS 7.5 box AND the SQL server? Do I need to unblock some ports? Are there any security risk in doing so?

I've setup this up once before but don't remember how. If I can't get access to DTC then is there any other way to ensure a lINQ and sql query is atomic?

View 1 Replies

Crystal Reports :: Unable To Find Data File When Distributed?

May 14, 2010

I have a problem that i'm sure will not be hard to fix for anyone who has been using CR for some time.

To start I have created a program in VB2008, that uses a MS Access data file, I can connect to it with no problem and can also add data and amend data, so all seems to work perfectly. I have published it and it once again runs perfectly on another/s machines.

I have now a requirement for a number of reports so have choosen CR for this purpose. I have connected the report to the database and that runs with no problems at all, that is untill I try to run it on another machine, it seems not to be able to find the database and comes up with a panel wanting me to log in with a password and Admin name.

I feel it's proberly a problem with the path of the database, I have tried so many time with diferent data files but with no success.

View 6 Replies

A Critical Error Has Occurred / Object Reference Not Set To An Instance Of An Object

Aug 5, 2010

i have problem about when i try to login it cannot be perform, instead of it gives "A critical error has occurred. Object reference not set to an instance of an object." but user name can accepted but the password cannot be accepted.

View 4 Replies

The Configuration Section "system.web.extensions" Cannot Be Read Because It Is Missing A Section

Apr 14, 2010

My system: I have installed Windows 7, VS2010 and .NET40 and ASPAJAXExtSetup.msi I'm getting the error below.

Error Summary. HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid.

View 13 Replies

Configuration :: The Configuration Section ConnectionStrings Cannot Be Read Because It Is Missing A Section Declaration

Mar 17, 2010

Detailed Error Information
Module
IIS Web Core
Notification
Unknown
Handler
Not yet determined
Error Code
0x80070032

Config Error The configuration section 'connectionStrings' cannot be read because it is missing a section declaration Config File \?C:inetpubvhostscno-o.comhttpdocsweb.config

View 9 Replies

Create Member Section For Website And Non Member Section

Aug 29, 2010

I'm trying to create a member section for my website and a non member section. I want the nonmember pages to have access to all the member pages but just not certain features like saving to the database. Is there a way to have the same page for both members and non members but have certain controls like buttons and other things that are only usable to the member that is logged in?

View 5 Replies

Can Use Web Farm And Web Garden Together

Jul 6, 2010

Web farm is used for multiple request and multiple user using switching among them.

Web Garden creates worker processes for every processor individually for one user.

Is it possible to use worker process as a switch and convert it into Web Farm that can allocate multiple processor on bases of algorithm?

View 1 Replies

C# - How To Call Particular Web Farm

Sep 29, 2010

Currently have an asp.net web site which is contained on 2 web servers which are load balanced i.e. web farm.

I would like to have some code which would allow me to call a particular server and execute a method on it. I WANT TO do this so that i can force all web servers to refresh their cache via a web page on the site.

Use Case is: Admin user logs into site and makes a change to a setting which is cached and then clicks "Refresh web server cache" button which then calls the update cache method on each of the servers. this is to prevent me from having to restart the app pool every time a cached setting is changed.

View 2 Replies

.net - Authentication With A Web Farm?

Feb 24, 2011

Given the idea of a web application (.NET 3.5+)

Browser
web app

the authentication using forms will result in a similar line of code

FormsAuthentication.SetAuthCookie(strUsrNm, True)

this is fine in a non load balanced server instance. how does authentication work in a load balanced stuation (no sticky session/infinity), and you cannot store the client IP, users password or login in the browser.

Browser
Load balancer
Web app (on server 1) || Web app (on server 2)

limitations: no database sessions, no AD server (for example: cater for external users)in short - in a load balanced situation how does the appliation know who the user is if they authenticated against the other server without re-authenticating.

View 1 Replies

SQL Server :: Query From MDB Files Error "cannot Be Used For Distributed Queries Because The Provider Is Configured To Run In Single-threaded Apartment Mode"

Mar 8, 2011

I would like to make a "select" from an Access (mdb) file in SQL Server 2008 R2. I was using:

SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0','C:..FILE.mdb', 'SELECT * FROM Users')

But I´m getting the error: Msg 7308, Level 16, State 1, Line 1 OLE DB provider 'Microsoft.ACE.OLEDB.12.0' cannot be used for distributed queries because the provider is configured to run in single-threaded apartment mode.

View 3 Replies

Difference Between The Web Farm And Web Garden?

Mar 23, 2011

difference between the Web Farm and Web Garden with some real time scenario?

View 2 Replies

Architecture :: Using Profile In Web Farm

May 6, 2010

My web app must access database via web service, and can not access databse directly.

In case my web app is deployed into a web farm, to remember the user's preference, I think I can't use ASP.NET Profile directly.

View 3 Replies

.NET Page Caching In A Web Farm

Mar 11, 2010

We have a small web farm(2 servers) balanced by the built in network load balancer in Windows 2003. We have a few pages that use page caching. My question is: Is it possible that that a given user could cause a page to be cached and another user see that content? Here is the page directive for the page in question:

<%@ OutputCache Duration="1" NoStore="true" VaryByParam="none" %>

The reason the duration is set to "1" is to ensure that the page isn't cached any longer than 1 second because of transactions that actions on the page can trigger.

View 2 Replies

To Get The Postback To Execute On This Web Farm?

Apr 6, 2010

So I have an ASP.Net web forms application that is using URL Routing. It works great on the old single server shared web hosting account. It has been moved over to a new platform that appears to be a web farm. When a postback happens it now just refreshes the page and the event handler is not envoked. Another thing I've noticed is they put the application into a sub-folder on the account and are using ISAPI Rewrite to point the domain to the sub folder.how to get the postback to execute on this web farm?

View 1 Replies

File Download From Web Farm?

Mar 28, 2011

I am working on a project where we want to provide link to download excel file.We are using NLB for load balancing,NLB cluster contains 3 machines.constraint is that excel file to be downloaded is available on a single machine.How to ensure that HTTP request underneath will served from the same mahine?

View 1 Replies

Configuration :: Error "The Configuration Section "connectionStrings" Cannot Be Read Because It Is Missing A Section" When Loading Page

Mar 5, 2010

I have this error: The configuration section 'connectionStrings' cannot be read because it is missing a section declaration on my site when loading this page [URL]. The rest of the site works [URL] Setup:The server is a hosting company - Mocha Hosting. [URL] contains a phpbb forum. This has been installed via the hosting company's web tool (Plesk). There is a root web.config, but there isn't in the /forum/ folder. The forum folder has been set by the phpbb installation wizard to be a virtual directory and application - and it appears to not have asp.net configured on it. The forum worked BEFORE uploading the root web.config file, and again if i temporarily remove the root web.config.

View 5 Replies

State Management :: How To Use HttpContext On A Web Farm

Aug 16, 2010

I'm considering using the HttpContext.Items HashTable to store reuseable user data (per user) instead of in the Session,

I'm hoping that this data is stored on the client and not on the server, but I did not see anywhere that this is the case...

Also, is there any drawback or loss of data that can happen when using web farm or clustered web servers ?

View 1 Replies

C# - WebResource.axd Throwing Exceptions In Web Farm?

Jan 17, 2011

We have an array of about 12 servers serving a website. Over the past few hours, one single server has started throwing exceptions for WebResource.axd and ScriptResource.axd requests.

Exception

System.Web.HttpException - This is an invalid script resource request.

Stack Trace

at System.Web.Handlers.ScriptResourceHandler.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Broken server URL

/WebResource.axd?d=S6kjkBsrIKni9uO5HCkv0c8eYObzibWXn9R6A7Yr_Fy7CW4dRFZm1HfcnUTEZ8xBYZDM-5zeTVk1tTgC1hp7d5YYw3o1&t=634308186300177825

All other servers URL

/WebResource.axd?d=yj6PW1hbOvqhMkOh2gYGlw2&t=634207187366247462

I have checked the web.config, machine.config for every server and they're all identical. The only difference been able to find so far is that prior to the problem commencing, the servers were patched, after which, the problematic server looks to be using different version of the System.Web.dll to the others?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved