473,395 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Help needed with an issue related to ASP.Net and WCF Service

Hi,

We are developing a web based application "UltraLearn.com" with a mix of
junior/senior Microsoft technologies. That includes Microsoft Silverlight,
ASP.Net Ajax and WCF/WF. Recently, we have hit the wall with some of
tested/proven technologies. The problem statement follows:

We are calling a WCF Service from our site pages to track user navigation.
The service in turn makes call to a gateway/server (using HttpWebRequest,
HttpWebResponse) which just logs entries into the database. A call to the
service is initiated from the Page_Init method of Master Page so that it is
ensured that page will be tracked even if there is some problem while
rendering the page. The call is asynchronous/non-blocking due to obvious
performance reason (Quick Load Test proved that asynchronous version affects
page's response
time significantly)

Here is the piece of code that is making the call from Page_Init method of
master page:

SiteTrackingServiceRef.SiteTrackingServiceClient trackingClient = new
SiteTrackingServiceRef.SiteTrackingServiceClient trackingClient();
trackingClient.StartTrackingCompleted += new
EventHandler<SiteTrackingServiceRef.StartTrackingC ompletedEventArgs>(trackingClient_StartTrackingCom pleted);
trackingClient.StartTrackingAsync(pageVisit);

The site works perfectly fine until you put some load onto it after which it
slows down extremely. At first, we thought that it was some networking issue
but different tests related to congestion, DNS entries, Dos attacks etc.
suggested against it. Then we thought that it was issue with IIS 6.0 running
on Win2k3 (our production environment), but IIS logs and performance
counters didn't suggest the same. Also, other sites on the same
IIS/environment run perfectly fine. Then we unit/load tested our WCF Service
individually to find out that
it wasn't causing bottleneck either leaving us clueless.

It may be worthwhile to mention that when the site starts slowing down after
some time with variable load on the site, our WCF Service
(SiteTrackingService) still does great job with logging the navigation. It's
just that something happens to the page loading (or server response time)

The following suggested solutions didn't impact the outcome in any ways.

1) WCF Service Throttling (Making the service Singleton, PerCall, PerSession
and/or adjusting MaxConcurrentCalls, MaxConcurrentSessions etc.)
2) Calling the WCF Service synchronously as opposed to asynchronously

Somebody also suggested to remove the WCF Service altogether and initiating
navigation logging directly from ASP.Net page. But we really need to
understand this strange behavior as our site is heavily dependent upon the
happy marriage of ASP.Net and WCF Services. We can avoid this issue here by
removing WCF Service altogether but not in other places. Really need some
expert advice/help from you guys soon.

Please note that most obvious performance counters related to CPU, Memory
and ASP.Net processing on the server shows system to be in healthy state
when the site slows down.

Thanks,
Nadeem

Nov 14 '08 #1
1 2737
you are incorrectly using async processing on your page. an async call runs
on the current thread and does a callback when complete on the same thread.
unless you page request does a wait until the async completes and turns off
thread agility (aspcompat=true), during load the callback will happen on a
different request. you will also stack up async calls on the same thread.

if you use async processing, you need to switch to the
AddOnPreRenderCompleteAsync which is the only supported way to do async
processing on an asp.net page. this will run the aync request (and wait for
completion just before prerender).

you probably want to switch from async to a background thread pool to do
your logging.
-- bruce (sqlwork.com)
"Nadeem Ashraf" wrote:
Hi,

We are developing a web based application "UltraLearn.com" with a mix of
junior/senior Microsoft technologies. That includes Microsoft Silverlight,
ASP.Net Ajax and WCF/WF. Recently, we have hit the wall with some of
tested/proven technologies. The problem statement follows:

We are calling a WCF Service from our site pages to track user navigation.
The service in turn makes call to a gateway/server (using HttpWebRequest,
HttpWebResponse) which just logs entries into the database. A call to the
service is initiated from the Page_Init method of Master Page so that it is
ensured that page will be tracked even if there is some problem while
rendering the page. The call is asynchronous/non-blocking due to obvious
performance reason (Quick Load Test proved that asynchronous version affects
page's response
time significantly)

Here is the piece of code that is making the call from Page_Init method of
master page:

SiteTrackingServiceRef.SiteTrackingServiceClient trackingClient = new
SiteTrackingServiceRef.SiteTrackingServiceClient trackingClient();
trackingClient.StartTrackingCompleted += new
EventHandler<SiteTrackingServiceRef.StartTrackingC ompletedEventArgs>(trackingClient_StartTrackingCom pleted);
trackingClient.StartTrackingAsync(pageVisit);

The site works perfectly fine until you put some load onto it after which it
slows down extremely. At first, we thought that it was some networking issue
but different tests related to congestion, DNS entries, Dos attacks etc.
suggested against it. Then we thought that it was issue with IIS 6.0 running
on Win2k3 (our production environment), but IIS logs and performance
counters didn't suggest the same. Also, other sites on the same
IIS/environment run perfectly fine. Then we unit/load tested our WCF Service
individually to find out that
it wasn't causing bottleneck either leaving us clueless.

It may be worthwhile to mention that when the site starts slowing down after
some time with variable load on the site, our WCF Service
(SiteTrackingService) still does great job with logging the navigation. It's
just that something happens to the page loading (or server response time)

The following suggested solutions didn't impact the outcome in any ways.

1) WCF Service Throttling (Making the service Singleton, PerCall, PerSession
and/or adjusting MaxConcurrentCalls, MaxConcurrentSessions etc.)
2) Calling the WCF Service synchronously as opposed to asynchronously

Somebody also suggested to remove the WCF Service altogether and initiating
navigation logging directly from ASP.Net page. But we really need to
understand this strange behavior as our site is heavily dependent upon the
happy marriage of ASP.Net and WCF Services. We can avoid this issue here by
removing WCF Service altogether but not in other places. Really need some
expert advice/help from you guys soon.

Please note that most obvious performance counters related to CPU, Memory
and ASP.Net processing on the server shows system to be in healthy state
when the site slows down.

Thanks,
Nadeem
Nov 14 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: abcd | last post by:
kutthaense Secretary Djetvedehald H. Rumsfeld legai predicted eventual vicmadhlary in Iraq mariyu Afghmadhlaistmadhla, kaani jetvedehly after "a ljetvedehg, hard slog," mariyu vede legai pressed...
8
by: slim | last post by:
hi again all, i am still working on the website as mentioned in earlier threads and have hit another snag... http://awash.demon.co.uk/index.php http://awash.demon.co.uk/vd.css the php is...
3
by: Abhas | last post by:
> > Hi, this is Abhas, > > I had made a video library program in C++, but was facing a problem. > > After entering 12 movies, i cannot enter any more movies. > > Something gibberish comes instead....
1
by: VK | last post by:
Hello, I am currently doing a project on Access and am current stuck in the "search" process and hoping that you could help me out. I have got 3 tables designed. When the user clicks on search...
5
by: Matthew Speed | last post by:
(About me: I know very little about writing server applications. I have done plenty of VB6 desktop app work but this is my first server program. I got it to work by modifying examples. I...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
1
by: =?Utf-8?B?YXZucmFv?= | last post by:
We have a web service that gets data in xml format. In that Xml data, we parse few date fields that are in this format <data datefield="12/26/2008" timefield="16:33:45" ...> we parse it into a...
0
by: =?Utf-8?B?YXZucmFv?= | last post by:
We have a web service that gets data in xml format. In that Xml data, we parse few date fields that are in this format <data datefield="12/26/2008" timefield="16:33:45" ...> we parse it into a...
5
by: dm3281 | last post by:
I'm really starting to hate writing services -- or trying to, anyway. Why do I need to rename my project to the service name? Why do I need to set the "ServiceName" property to my service name?...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.