Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

Performance and context switching

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
robm - 21 Sep 2007 15:09 GMT
Hi,

We have an ASP.NET 2 application that does some quite intensive work
in order to present data to the users.  A particular function gathers
a lot of data from the database and as the objects are quite fine
grained it makes thousands of stored procedure calls.  When under no
load the performance is fine, but when a few users use this at once
then the performance declines.  With around 4 users executing this
intensive function at once, using performance monitor we see around
40% CPU usage but massive levels of context switching (~300 000/sec).
I understand that context switching increases with the number of
threads, but it doesn't seem to me that this web server is under
particular load (it's a fairly well spec'd server with dual-processor,
dual-core).  If the CPU was maxed out I would just assume that the
server couldn't cope with the load that we are putting it under, but
it's not so it appears we are hitting some other server limit.  Can
anyone give me any pointers about what could be causing such huge
context switching values?

Thanks,
Rob
bruce barker - 21 Sep 2007 16:12 GMT
every call to the o/s is a context switch. every i/o interrupt is a
context switch. as the database calls use the network, every packet is a
context switch.

most likely you are hitting blocking with database and thats your
limiting factor. you should not be doing 100's of sp calls per page
request, much less 1000's.

read the chapters on set operations and joins and try to get the sql
calls to 10 - 50 a page request.

-- bruce (sqlwork.com)

> Hi,
>
[quoted text clipped - 17 lines]
> Thanks,
> Rob
robm - 24 Sep 2007 11:03 GMT
@Bruce:Thanks for your reply.  I'm working to reduce the stored
procedure calls so if this is the cause of the issue then I'm happy
with that.

Looking back through performance monitor logs though then the problem
(excessive context switching) and the perceived decrease in
performance did seem to get a lot worse after we carried out an
upgrade from .NET 1.1 to .NET 2.0; can anyone think of any plausible
explanation for this?

Thanks,

Rob

> every call to the o/s is acontextswitch. every i/o interrupt is acontextswitch. as the database calls use the network, every packet is acontextswitch.
>
[quoted text clipped - 28 lines]
> > Thanks,
> > Rob

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.