C# - Best Practice Instrumenting A Webpage When Having Parallel Tasks?

Jun 24, 2010

I try to get an understanding of the performance of a web page and use Trace.Write

Problem is that I use Parallel.Invoke and starts more threads where I would like to report back using Trace.Write

Parallel.Invoke(() => Chart1AndLegend(param),
() => Chart2(param),
() => Chart3(param),
() => Chart4(param));

I have realized that Trace.Write is not a good way of tracing as it is gives you the time since last entry which makes no sense if more threads are writing.

View 1 Replies


Similar Messages:

MVC :: Asynccontroller Multiple Tasks In Parallel Failed Sometime?

Jul 29, 2010

I am experimenting AsyncController feature. What I did is set up two tasks to run in parallel. As in the code below, the problem is that sometime all tasks finished and return successfully, sometime only one task finish and sometime each task finish half of it's work and return. It is weird, what did I do wrong?

[Code]....

View 29 Replies

Where Can I Find The Tasks To Practice

Sep 16, 2010

I am a beginner of C# programming. I have read a few books about C#.net. But I cannot find some exercises in the books. Someone told me to build up a blog to practice my coding.

But it is a huge task for a beginner. I just want some tasks to have a step by step learning process.

View 3 Replies

Multithreading - When Serve A Webpage -, Can Render The Various Controls On The Page In Parallel

Aug 10, 2010

When I serve an ASP.NET page, can I render the various controls on the page in parallel?

I have a few Telerik controls (RadGrids) on the page and when I step through the page being loaded, it seems as though the controls are databound and rendered serially.

Maybe this behavior is because I am hooked in with the debugger.

Is there anyway to load the page and have select controls build on separate threads? Is that even conceptually possible or must it be done sequentially?

View 2 Replies

Ajax - Pattern For Long Running Tasks Invoked Through Webpage?

Apr 1, 2011

I need to invoke a long running task from an ASP.NET page, and allow the user to view the tasks progress as it executes.

In my current case I want to import data from a series of data files into a database, but this involves a fair amount of processing. I would like the user to see how far through the files the task is, and any problems encountered along the way.

Due to limited processing resources I would like to queue the requests for this service.

I have recently looked at Windows Workflow and wondered if it might offer a solution?

I am thinking of a solution that might look like:

ASP.NET AJAX page -> WCF Service -> MSMQ -> Workflow Service *or* Windows Service

View 3 Replies

System.Threading.Tasks - Limit The Number Of Concurrent Tasks?

May 24, 2010

I have just started to look at the new "System.Threading.Tasks" goodness in .Net 4.0, and would like to know if there is any build in support for limiting the number of concurrent tasks that run at once, or if this should be manually handled.

E.G: If I need to call a calculation method 100 times, is there a way to set up 100 Tasks, but have only 5 execute simultaneously? The answer may just be to create 5 tasks, call Task.WaitAny, and create a new Task as each previous one finishes. I just want to make sure I am not missing a trick if there is a better way to do this.

[code]....

View 5 Replies

Vb - What Is The Best Practice For Ouputting Data From A Collection On A Webpage

Apr 20, 2010

I've ported a page from classic ASP to ASP.net. Part of what happens in this page is that a collection of custom types is generated and then displayed via Response.Write() commands. I'd like to get the business logic separated out into a code behind file (and maybe move this all into a user control), but I can't seem to figure out how I'd actually display the collection once it's been generated. I want to specify a master page here, too, so the code can't stay inline. Here's a very stripped down version of the current code:

[code]....

View 3 Replies

C# - Good Practice To Perform Direct Database Access In The Code-behind Of Webpage?

Jun 7, 2010

I am an experienced developer but I am new to web application development. Now I am in charge of developing a new web application and I could really use some input from experienced web developers out there.

I'd like to understand exactly what experienced web developers do in the code-behind pages. At first I thought it was best to have a rule that all the database access and business logic should be performed in classes external to the code-behind pages. My thought was that only logic necessary for the web form would be performed in the code-behind. I still think that all the business logic should be performed in other classes but I'm beginning to think it would be alright if the code-behind had access to the database to query it directly rather than having to call other classes to receive a dataset or collection back.

View 2 Replies

How Parallel Requests Are Processed?

Oct 21, 2010

Let's imaging there are 2 pages on the web site: quick and slow. Requests to slow page are executed for a 1 minute, request to quick 5 seconds.Whole my development career I thought that if 1st started request is slow: he will do a (synchronous) call to DB... wait answer... If during this time request to quick page will be done, this request will be processed while system is waiting for response from DB.[URL] One instance of the HttpApplication class is used to process many requests in its lifetime. However, it can process only one request at a time. Thus, member variables can be used to store per-request data.Does it mean that my original thoughts are wrong?Could you please clarify what they mean? I am pretty sure that thing are as I expect...

View 2 Replies

How To Perform Parallel Processing

Feb 19, 2011

I have windows service which need to execute around 10000 schedules (need to send/execute data to all the members).

For one member it's taking 3 to 5 seconds for 10000 schedules it's taking around 10 minutes or so..

But I need to execute all these schedules in one minutes.

View 1 Replies

C# - AsParallel() - With More Than 2 Threads In Parallel?

Feb 21, 2011

I have a method that I call 8 times with different parametres.I use

AvailableYears.AsParallel()
.Select<Int32,DateUsedByThread>(x => GetDataForYearWorker(x,CIF))
.ToList();

GetDataForYearWorker gets the response from a webservice synchronously. It uses very little computing power on my asp.net application, but it ussualy takes 3-5 sec for each webservice response. Because the calls to the webservice are independent of eachother, I want to make tham all at the same time. But it looks like only 2 threads can run at the same time. Why is this and how can I have 8 threads working at the same time?

View 1 Replies

Options For Enabling Parallel Processing

Mar 11, 2011

It seems that by default, ASP.NET 3.5 running on IIS 6.0 does not do any parallel processing whatsoever. With a quad-core system and a test webforms application that runs an infinite while loop on the server, CPU usage never goes higher than 30% regardless of how many clients are connected and independently running the while loop.What are my options for enabling parallel processing?

View 2 Replies

Web Forms :: IFrames Not Executing In Parallel?

Aug 2, 2010

We are using 6 iFrames on our page. They fetch data from couple of external web services and an internal WCF service and display the data. There is a separate aspx page built for each of the iFrames. From our perf monitoring we found out that at any point only two threads are executing in parallel. Not all 6 threads get executed. What can probably be cause for this? Is there any restriction that more than 2 threads can't be created in parallel? Is there any configuration where I can change this?

View 3 Replies

C# - Throttle Parallel Request To Remote Api?

Jul 14, 2010

I'm working on an ASP.NET MVC application that uses the Google Maps Geocoding API. In a single batch there may be upto 1000 queries to submit to the Geocoding API, so I'm trying to use a parallel processing approach to imporove performance. The method responsible for starting a process for each core is:

public void GeoCode(Queue<Job> qJobs, bool bolKeepTrying, bool bolSpellCheck, Action<Job, bool, bool> aWorker)
{
// Get the number of processors, initialize the number of remaining
// threads, and set the starting point for the iteration.
int intCoreCount = Environment.ProcessorCount;
int intRemainingWorkItems = intCoreCount;

[Code]...

This is based on patterns document I found on Microsoft's parallel computing web site. The problem is that the Google API has a limit of 10 QPS (enterprise customer) - which I'm hitting - then I get HTTP 403 error's. Is this a way I can benefit from parallel processing but limit the requests I'm making? I've tried using Thread.Sleep but it doesn't solve the problem.

View 1 Replies

IIS 7 To Process The Request Queue In Parallel?

Apr 20, 2010

Currently we are developing an ASMX, ASP 2.0, IIS 7 web service that does some calculations (and return a dynamically generated document) and will take approx. 60 seconds to run.Since whe have a big machine with multiple cores and lots of RAM, I expected that IIS tries its best to route the requests that arrive in its requests queue to all available threads of the app pool's thread pool.But we experience quiet the opposite:When we issue requests to the ASMX web service URL from multiple different clients, the IIS seems to serially process these requests. I.e. request 1 arrives, is being processed, then request 2 is being processed, then request 3, etc

View 2 Replies

C#: Adding Context To Parallel.ForEach()?

Sep 24, 2010

I have a static class with a static get property, and in this property, I do this:

// property body
{
// HttpContext.Current is NOT null
Parallel.ForEach(files, file =>
{
// HttpContext.Current is null
var promo = new Promotion();
});
// HttpContext.Current is NOT null
}

This static class doesn't undergone type initialization until a view uses this property.

The problem is that Promotion's static constructor, which is initialized the first time a new Promotion() is created within the Parallel.ForEach(), uses HttpContext.Current. When promo is instantiated within the scope of this Parallel.ForEach(), HttpContext.Current is null, and new Promotion() therefore causes an exception.

HttpContext.Current is not null within the static get property because it's not called until the view uses it (and there is therefore a HttpContext.Current).

If Promotion used HttpContext.Current in its instances instead of its static members, I could probably just pass HttpContext.Current into the new Promotion() constructor:

var context = HttpContext.Current;
Parallel.ForEach(files, file =>
{
var promo = new Promotion(context);
});

But since static members of Promotion need HttpContext.Current, I can't. I could probably redesign the Promotion class to change the static members that need it to be instance members, but they are static for a reason--there would be a large performance penalty if all the members that were static had to be defined instead on each instance each time a new Promotion was instantiated.

What are the possible workarounds for this? I didn't realize HttpContext.Current would be null within the scope of Parallel.ForEach().

View 2 Replies

WCF / ASMX :: Web Service Process In Parallel Support?

Mar 14, 2011

I am seeking your expertise in ASP.Net with regards to multi-thread support of WebService in a scenario , that is If a WebService-Client is making simultaneous calls from the same process, the requests will be serialized at the WebServices so that only one-call will execute at any one time , on the contrary, if those calls are sent from different WebService-Clients ( Instances/Processes) , they are processed in-parallel by WebServices.

Have you ever experienced the same with ASP.Net, and what configurations/Settings should be followed, in order for a WebServices to concurrently process simultaneous calls form a single WebClient , when deploying a large number of Web-Clients' instances/processes is impractical in a project-context.

View 1 Replies

WCF / ASMX :: Do Multiple WCF Web Service Requests Queue Up Or Do They Run In Parallel

Mar 17, 2011

I've got a WCF web service that runs fine at the moment but there is talk about using it very heavily soon. As part of it's normal process it writes a file out, then reads it back in again (don't ask why, I know it's stupid). I'm concerned that if we start hitting it with lots of requests then the following might happen.

1. Request 1 writes the file out.

2. Request 2 comes in and overwrites the file.

3. Request 1 reads the file back in but this is now the wrong file.

My understanding is that the requests would naturally queue up so that request 2 wouldn't start until request 1 had finished, but I'm not totally sure.

View 1 Replies

Visual Studio :: Running VS2008 And VS 2010 Parallel To Each Other?

Feb 28, 2011

I've got about 30 projects in VS 2008 and we are finally starting to upgrade to 2010. I get change requests pretty regularly so I'm likely to have to make changes to projects that are still in 2008 after VS 2010 is installed. Is it possible to intall VS 2010 without messing up the VS 2008 install? If so is there any particular trick to it so they live side by side or do they automatically do parallel install in different directories?

View 3 Replies

Web Forms :: Remove The Vertical Lines Parallel To Each Field Column?

Dec 15, 2010

On our webform, I do I remove the vertical lines parallel to each field column?

Visit the webform at [URL]

View snippet code, below:

[Code]....

View 4 Replies

MVC :: Firing Startup Tasks?

Jun 21, 2010

I used Castle Windsor before and had this routine that fired the certain method of all classes that implement a certain interface.If I recall correctly, the interface was IBootStrapTask and only had an excecute method. Then, for instance, I'd place all my route registrations in one of these, and know it get fired on application startup.Have to admit I did not understand the code to well, so I'm even more unsure how can I do this. I'm using structure map now. (still knowing very little about it)

View 1 Replies

How To Use Threading To Perform Background Tasks

Jan 29, 2011

In my ASP.NET website, I am having a function which has to be automatically performed once every 2-3 mins on its own, i.e. without user intervention. This function contains database access.

Can I use threading to perform this process in background?

If Yes, How can I use that?

Edit

Also I am not looking for a solution which includes windows service because I am using shared hosting. So I dont have all the rights to access the host computer.

View 5 Replies

MVC And Web Application Administrative Tasks - How It Will Be Treated

Jan 12, 2010

I am little bit confuse with Asp.net MVC Area.

When we talk about WebForms we say, for Administrative tasks, you must have an Admin folder to separate the admin task.

In MVC how i will treat my Admin tasks?

I will go for Admin Area or Admin Controllers,

Because if i will write controller for Admin tasks, each and every task will be written in one controller (AdminController) or if i will write Area -> Controller, means i will need to write at-least two controllers for each feature.

Second if we breaks the application in Areas (as modules) how i will manage Admin task for each Area.

View 1 Replies

Javascript - Running Tasks Before Redirect

Apr 4, 2011

We have a timer process (a JQuery plugin) that redirects after X number of minutes to the login page, all via JavaScript. When the timer hits zero, I want to run a task (could be anything; however, in this specific scenario, it's a web service call).

So the process does:

if (zeroedOut) {
window.setTimeout(function() {
//Run finish-up processes
}, 0);
window.location = "login.aspx";
}

The issue I'm having is the web service that runs with the finish-up processes is not being called. The web service call happens, the redirect happens, I don't see any errors (I have try/catch statements around the setTimeout call), but no WS call.

View 1 Replies

AJAX :: Scheduling Tasks Within A Web Application?

Feb 6, 2010

As part of the web application I am working on there will be functionality to export data from the web application into a windows application copying the data between the database for the web application and the windows application. The databases for these two programs could have been combined but are being kept apart for simplicity.The utility to export the data can be triggered manually from the web application but it is also required that this task can be scheduled to run by the user (once a day, on web app shutdown etc)

I envisage this to be run as a service - I have created services for windows applications before but this is the first time I have needed to create this for a web application. Searching on goggle, I have found an msdn magazine article that suggests creating a web service and then creating a windows service which would call into this web service. So in my situation, I am thinking that I would create a web service which would contain the data transfer functionality between the web application and the windows application. Then I would create a windows service which would be installed as part of installing the web application, which would then call into the web service (at pre-defined intervals) using settings configured by the user within the web application (so that the data transfer functionality can be scheduled).Does this seem the correct solution? I would appreciate any advice on how I might achieve the above.

View 3 Replies







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