Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8082763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:13:38+00:00 2026-06-05T17:13:38+00:00

I’ve come across a rather unique problem that I haven’t seen before. The customer

  • 0

I’ve come across a rather unique problem that I haven’t seen before.

The customer has a application server and a database server. The application server (win 2008) runs a ASP.NET MVC 3 App. The database server (also Win 2008) runs SQL Server 2008.

Whenever a request to the database is made, CPU for w3wp.exe goes up to 50 – 80 % and network traffic reaches 2% (of 10 Gbps). This takes a minute or so after which the requested web page is displayed.

I checked the actual Linq execution time and it only takes a few milliseconds to get the data.

I hope some of the professionals here can shed some light on what’s going on. Of course, it works on my machine.

update

Even a query executed from SQL Server Management Studio (on the app server) that retrieves 828 rows takes a full 12 seconds to complete… So I guess the problem is not the app but somewhere on the database server or the connection

update 2
Here’s something interesting I found out.

This is the slow code:

MyAppDataContext DataContext = MyAppDataContext.CreateNewContext();
IEnumerable<Requests> Entities = DataContext.Requests;

using (profiler.Step("get data")) {
    IEnumerable<Requests> dataset = from x in Entities
                                    where x.ControleStatus == 4
                                    orderby x.ID
                                    select x;
}

But when I change IEnumerable to IQueryable, the code executes 10x faster:

MyAppDataContext DataContext = MyAppDataContext.CreateNewContext();
IQueryable<Requests> Entities = DataContext.Requests.AsQueryable();

using (profiler.Step("get data")) {
    IQueryable<Requests> dataset = from x in Entities
                                   where x.ControleStatus == 4
                                   orderby x.ID
                                   select x;
}

So my question is: what could be causing this big difference between IEnumerable and IQueryable ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T17:13:39+00:00Added an answer on June 5, 2026 at 5:13 pm

    Whenever a request to the database is made, CPU for w3wp.exe goes up
    to 50 – 80 % and network traffic reaches 2% (of 10 Gbps).

    1. Are you taking care of Memory leaks?
    2. Using statements are included in the Database Interaction classes?
    3. I use Red Gate ANTS Memory Profiler to check for the Memory Management Issues.
    4. You are looking for SQL Profiler that tells Reads and Duration.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
In my XML file chapters tag has more chapter tag.i need to display chapters
I am doing a simple coin flipping experiment for class that involves flipping a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.