Some performance issues when coming back from appserver

Some performance issues when coming back from appserver

Old forum URL: forums.lhotka.net/forums/t/12088.aspx


Chris62 posted on Wednesday, July 24, 2013

I have a survey application where a Survey has multiple questions, each question in turn may have answers(or may not, if not I display a text box).

The object structure looks like this:

Survey(root/parent biz object) -> Questions child list (with Question child objects) -> Each Question child object may have answers to choose from(Answers list with Answer child object, or count may be 0).

We recently created a survey with 75 questions, about half had predetermined answers(about 4 per question), the rest are text boxes(where child list Answers count is 0).

I've traced the movement of the biz objects between the webserver and appserver to try and determine where the slowdown is occurring.  (I wrote to the event viewer)  Going from the webserver to the appserver takes about a second, querying the database and building the object model takes about 2.5 to 3 seconds.  When the objects return from the appserver to the webserver takes about 9-10 seconds.  I don't understand why the return is taking so long.

 

In the controller (ASP.NET MVC website) I have:

string appname = "StagingWebsite";

if (!EventLog.SourceExists(appname))

{

EventLog.CreateEventSource(appname, "Application");

}

EventLog.WriteEntry(appname, "Webserver: BEGIN survey GET " + DateTime.Now.ToString());

Survey survey = Survey.GetSurvey(sid);

EventLog.WriteEntry(appname, "Webserver: END survey GET " + DateTime.Now.ToString());

 

The biz object Survey

[Serializable]

public class Survey : Business<Survey>

{

public static Survey GetSurvey(int SurveyId)

{

string appname = "StagingWebsite";

if (!EventLog.SourceExists(appname))

{

EventLog.CreateEventSource(appname, "Application");

}

EventLog.WriteEntry(appname, "Webserver: BEGIN Go Thru DATAPORTAL" + DateTime.Now.ToString());

Survey s = DataPortal.Fetch<Survey>(SurveyId);

EventLog.WriteEntry(appname, "Webserver: END Go Thru DATAPORTAL" + DateTime.Now.ToString());

return s;

}

private void DataPortal_Fetch(int SurveyId)

{

string appname = "StagingWebsite";

if (!EventLog.SourceExists(appname))

{

EventLog.CreateEventSource(appname, "Application");

}

EventLog.WriteEntry(appname, "Appserver: BEGIN survey DATA " + DateTime.Now.ToString());

// snip, loading data for all properties(including children takes ~3 seconds

EventLog.WriteEntry(appname, "Appserver: END survey DATA " + DateTime.Now.ToString());

}

}

In the event viewer I'm seeing:

In child lists I'm setting RaiseListChangedEvents to false when I load the biz objects in(and set back to true when complete).

If anyone needs more code I post it up.  Does anyone know where I can look to speed up the "return  trip" from the app server to web server?

Chris62 replied on Wednesday, July 24, 2013

From the event viewer

Webserver: BEGIN survey GET 7/24/2013 3:19:55 PM

Webserver: BEGIN Go Thru DATAPORTAL7/24/2013 3:19:55 PM

 

Appserver: BEGIN survey DATA 7/24/2013 3:19:54 PM

Appserver: END survey DATA 7/24/2013 3:19:56 PM

 

Webserver: END Go Thru DATAPORTAL7/24/2013 3:20:05 PM

Webserver: END survey GET 7/24/2013 3:20:05 PM

Webserver: END GET SURVEY MODEL 7/24/2013 3:20:08 PM

 

I believe the appserver clock is about a second behind the webserver.

Copyright (c) Marimer LLC