Queuing Requests / Async Processing?

Oct 28, 2010

I'm putting together a web app that will process time consuming jobs in the background.so for example 100 users are on the site 20 of them submit jobs to the server. these 20 jobs get added to a list and the background worker pickes them up one by one. I want to be able to have up to 10 background workers doing the tasks.

for scaleability the job list is likely to be a database table, however at the proof of concept stage I will probably use an application variable (stack of some sort) with a GUID to identify each job.

So I *think* what I need is ....

a single background worker process that starts when the web app starts.This process monitors the stack / job list. It dynamically creates a worker process for the first item, removes the job from the stack and increments the thread count.If there is a second job it creates another thread (up to 10) and increments the thread counter.When each thread finishes it closes itself and decrements the thread count.
If I move to the database table job list would it be better to have ASP.Net add jobs and a windows service do the processing?

View 8 Replies


Similar Messages:

AJAX :: WebMethod Is Fast On Local But Works Slowly In Processing Requests On Server

Aug 28, 2012

I am using the following Web method.. its work fast on local host , but on Domain hosted server .. its works odd , i;e; some time its work fast about (1-3 sec) and some take about 10-14 sec to process..  how do i make it work properly and fast..
 
here is my code 

[WebMethod]
public static string DisplayMessage(string name, string price,string obj, string id)
{
SqlConnection conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["eshopConnectionString"].ConnectionString);
//Creating Delay""

[Code]....

View 1 Replies

Queuing Using The Database Or MSMQ?

Mar 23, 2010

A part of the application I'm working on is an swf that shows a test with some 80 questions. Each question is saved in SQL Server through WebORB and ASP.NET. If a candidate finishes the test, the session needs to be validated. The problem is that sometimes 350 candidates finish their test at the same moment, and the CPU on the web server and SQL Server explodes (350 validations concurrently).Now, how should I implement queuing here? In the database, there's a table that has a record for each session. One column holds the status. 1 is finished, 2 is validated.

I could implement queuing in two ways (as I see it, maybe you have other propositions):A process that checks the table for records with status 1. If it finds one, it validates the session. So, sessions are validated one after one.
If a candidate finishes its session, a message is sent to a MSMQ queue. Another process listens to the queue and validates sessions one after one.Now:What would be the best approach?Where do you start the process that will validate sessions? In your global.asax (application_start)? As a windows service? As an exe on the root of the website that is started in application_start?To me, using the table and looking for records with status 1 seems the easiest way.

View 3 Replies

Selectively Redirecting HTTP Requests To HTTPS Requests?

Jun 18, 2010

What's the simplest and most effective way to selectively redirect HTTP requests to your ASP.NET page to its HTTPS equivalent? For example, if my page site URL is [URL], I want to redirect some (or all) page requests to [URL] What's the easiest way to do that?

View 2 Replies

Client (Javascript) Processing Rather Than C# Processing HTML?

Mar 18, 2010

We are in the process of building a huge site. We are contemplating on whether to do the processing of HTML at server side (ASP .Net) or at the client side. For example we have HTML files which acts like templates for the generation of tabs. Is it better for the server side to get hold of content section (div) of HTML load the appropriate values and send the updated HTML to the browser or is it better that a chunk of data is passed onto client and make Javascript do the work?

View 2 Replies

MVC :: Where The Async Method Has Arguments?

Jun 5, 2010

I have a MVC project in a test environment with an AsyncController. I have a pair of methods, ...Async and ...Completed and it seems to work well.The thing is that I've seen examples where the Async method has arguments such as....

public void IndexAsync(AsyncCallback callback, object state)

In my project that defintion yields "No parameterless constructor defined for this object." When I remove the arguments like this...

public void IndexAsync()

it runs fine. I'd like to explore some examples that use these arguments. Where do they come from? How can I get them...

View 2 Replies

Async Thread To Run Executable

Nov 16, 2011

I have a page which has populated a database with a set of information that needs to be processed. This could take a considerable amount of time and I want it to run in the background, mean while I will have my web app display a page with an intermittent meta refresh showing me progress of the records in the DB being processed.

What I think I need to do is start an executable, in a different thread running in the backgound on the server which will run until it is complete, without interfering with other web activity.

Can this be done? Do I start it in a different thread? How can I start the exe in that thread and just leave it to do its work?

View 2 Replies

C# - 'Loading' Web Page For Async Call?

May 13, 2010

I have a simple web page in ASP.NET / C#. Currently to fully render the data I require calling a block of code that runs on background threads and can take multiple minutes to complete. I've got it to the point (using the async attribute on the page declaration) to execute and return fine with the html once it's done. What I'd like it to do is allow me to return immediately with a 'loading page' of some sort and then have that page be updated when the background work has been completed. Right now I get nothing on the page while the background work is being processed.

View 3 Replies

Strongly Typed API For MVC 2 Async Actions

May 17, 2010

Have anybody tried to create strongly typed API for ASP.NET MVC 2 async actions?

View 1 Replies

Multiple Async Postbacks At The Same Time?

Dec 11, 2010

Say I have 2 UpdatePanels on the page and each UpdatePanel has a one server Button each. When I click on the first button and then the second button and look in Firebug, I see that the 2nd async postback is not triggered until the first one completes.

Is this working as expected? My understanding was with AJAX postbacks, the event handlers for the buttons trigger simultaneously.

View 1 Replies

How To Handle Errors During Async Postbacks

Jan 5, 2010

We have an ASP.NET page which uses an update panel for partial page postbacks. On the server side, the postback performs some database work and updates several UI elements. The database code is all contained in several transactions, so the state will still be consistent if an exception is thrown. We're working on some error handling code now, and my first thought was to log the exception thrown, reload the last consistent UI state, and show some sort of modal popup or other ui element with a brief error message for the user (this is an intranet page, so we're automatically notified of the bug, and the users know where to find us.

View 1 Replies

Async Email With ASPCOMPAT True?

May 13, 2010

Is there anyway to send email asynchronous with the ASPCOMPAT=True.

View 2 Replies

AJAX :: Async Call Without Results?

Feb 23, 2011

I want to make an async call to the server when an achor tag is clicked and then have the browser advance to the href without waiting for the async call to return a result. I am using System.Web.UI.ICallbackEventHandler. My server code is not executing. The server code only executes if the GetCallbackEventReference call specifies a clientscript value which means the page has to wait before advancing. What am i doing wrong?

My client code is:

<script type="text/javascript">
function ReceiveServerData(arg, context) {
}
function DoAsyncTask(arg)
{
CallServer(arg, '');
return false;
}
</script>

View 3 Replies

.net - Async HttpWebRequest With No Wait From Within A Web Application?

Feb 1, 2010

In my web application (ASP.NET) I have a block of code that uses HttpWebRequest to make a call to a REST service and continue execution. Right now it's taking longer than I would like to complete the full web request. The thing is that what the REST service returns isn't useful. Ideally I would like to send an Async web request to the REST service and then NOT wait for a response. The problem is that I've tried it out using request.BeginGetResponse(New AsyncCallback(AddressOf myFunc), Nothing)

To start an async request and instead of NOT waiting (which I would assume would be the default behavior of an async request) it continuously executes the callback function before executing the next line of code after BeginGetResponse.I'm suspecting that ASP.NET may convert it to a sync request when it's within a web application. I'm led to believe this because there's a IAsyncResult result object that is passed into the callback function and when I examine its CompletedSynchronously property it's always set to true.if it's possible to do an async HttpWebRequest (with no wait) from within an ASP.NET web application or is it always converted to a synchronous request?

View 2 Replies

MVC :: Client Scripts Not Running After Async Postback?

Feb 28, 2010

I have a MVC view, say,:

[Code]....

somepartialview calls other partial views, that also contains client javascript. This loads and works fine, the javascript-based effects (vertical ticker, horizontal ticker) work fine as well.

The problem is that somepartialview has several AJAX.ActionLink(s) like this:

Ajax.ActionLink("LinkText", "SetIcons", new { id = l.ID }, new AjaxOptions { UpdateTargetId = "ajaxdiv" })
Namely, an <a> element which upon click changes the content of <div id="ajaxdiv"> using a 'SetIcons' controller:

[Code]....

But this works only partially: the page gets refreshed with the new HTML content, but the scripts that worked before the async postback do not run anymore. How do I get them to work?

I think that I am looking for the MVC alternative of the WebForms' ScriptManager.RegisterStartupScript

OSDBDataContext db = new OSDBDataContext();

View 1 Replies

C# - Best Practice To Handle Exception In The Async Call?

Nov 11, 2010

For example, I am using wenclient.DownloadfileAsync to download a file asynchronously.

In the DownloadFileCompleted event handler, I can check if I have any exception or not by using AsyncCompletedEventArgs.Error property.

If I re-throw this exception, however my executable is stopping running immediately.

I am wondering how to handle this kind of exeception? How to pass this exception back to the
calling thread?

View 1 Replies

Web Forms :: Setting Page.Async From MasterPage?

Mar 21, 2011

I'm using a CMS, which removes my ability to access the actual Page, I can only program Master pages. I need to set the Async property of the @Page directive on a particular page, but can't figure out how to do so from the Master page.

View 2 Replies

Architecture :: Async Controls In Large Page?

Apr 4, 2010

I am currently working on a page that has 13 gridviews in it. Each one is in a control and a separate updatepanel. The time from link click to page load is 20 seconds though and I am looking for ways to load the controls asynchronously so that the page can load and then the data can come after. I have tried a few different methods so far but have been unsucessful so far. I thought about using the Ajax incremental page display pattern but I did not think this would work because it only returns html. I need to load the gridviews in and they need to support pagination and sorting.

View 5 Replies

MVC :: How To Validate The View Model From An Async Page

Apr 26, 2010

Like this?

[Code]....

I'm looking for the best way to do this!

View 3 Replies

Modal Loading Popup On Async Postback?

Sep 9, 2010

I have a web application that does some complicated data retrieval tasks and so I am trying to show a modal dialog box with a loading message when the tasks begins. I am using ASP.Net 3.5, the jQeury popup I am using is bPopup.

Firstly, I have a table where the rows can be clicked. Im am using a script from[URL] to do an async postback from the table row. Here is my function

[Code]....

so the $("#<%=lDiv.ClientID %>").openPopup(); opens up my loading modal and then the server starts doing its thing. When the server finishes though how would I then close the dialog box?

I just need to call one line of code like $("#<%=lDiv.ClientID %>").closePopup();

View 1 Replies

How To Get The Id Of Updatepanel That Triggered The Async Postback On Serverside

Sep 16, 2010

I know about Always vs. Conditional, I just need to know exactly which update panel's data needs to be refreshed (not taken from app tier cache) on the serverside.

View 1 Replies

AJAX :: Nested Updatepanels And Async Postbacks?

Mar 23, 2011

I'm trying to get something like this to work

[Code]....

What I'm looking for is to disable the submit button if any of the inner updatepanels are in postback mode. I would also like some way to block that particular panel. I guess for the outer updatepanel, updatemode should be set to conditional, and usechildrenastriggers should be false. What's really bugging me is how to block the panel while a postback is occurring.

In all my tests thus far, the outer updatepanel's updateprogress is triggered, which blocks the whole page.

View 2 Replies

AJAX :: Events Don't Fire In Async Postbacks

Feb 16, 2010

So I have a page with an UpdatePanel and some controls in there. When I explicitly type/copy+paste the page's address into the address bar, let VS navigate there for me, or follow a link to the page, all of the AJAX works fine. But if I refresh this page, the JS on the page initiates the async postback, but the appropriate event is never called on the server (although Page_Load is) and the client never recieves the markup sent back by the server. This issue seems to be limited to Firefox 3.6 (Gecko build 1/15/2010)(doesn't happen in IE8). I have yet to try on other versions of Firefox.

View 2 Replies

How Can Control Focus Be Maintained Across Async Postbacks

Aug 3, 2010

I have a page setup like so:

[code]...

I know lastFocused is getting a value and RestoreFocus is running, but whenever it runs the value of lastFocused is null.

View 1 Replies

Ajax - Telerik Rad Combo And Async Postbacks In C#?

Jul 26, 2010

I have a very typical set up, an ajax update panel is updated when a drop list of offices changes. Each form could have it's own values, for instance each store will have it's own list of employees. Here is where the fun begins. The form can be changed by the drop down (new office) or validated and submitted.

On drop down change, I create a new instance of the same rad combo, bind it to the current data, confirm that the correct data is bound. Then on the return trip I see selected the default user from the previous user. This is a composite control, and firebug shows me that the value for the "text box" that simulates the combo still has the old value. I'm suspecting onViewStateLoaded, but turning viewstate off for the Telerik didn't . II don;t need it anyway, cuz I have to put the selected value in another hidden to make a cross page post on submit.

View 2 Replies







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