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

  • Home
  • SEARCH
  • 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 6610103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:47:51+00:00 2026-05-25T19:47:51+00:00

We are experiencing an issue where our sql server where cpu usage jumps to

  • 0

We are experiencing an issue where our sql server where cpu usage jumps to and remains at 100% until the site is taken down and restarted. We have gone through the code and optimized everything we can, and this is still happening.

What we do with cache is run a query that loads an entire structure (~6000 rows) from sql server, store that in cache, and query that cache to perform the various operations we need to perform throughout the rest of the application (there are a lot of recursive operations that need to be performed on the data and it would be a huge hit to the sql server otherwise).

I describe the above because it seems that when sql cache dependency is used, we encounter the cpu spike on the sql server. If it is disabled, we no longer encounter the spike (on the sql server or the web server) even though we are still caching the same amount of data.

Does anyone have any idea what about sql cache dependency could cause behavior like this?
The sql server used is SQL Server 2008 R2. The web server is IIS 7.5 and we used ASP.NET 3.5. This web servers are set up as a cluster (x2), and they both point to the same sql server.

This is the code that loads/sets up the cache:

using (SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString))
{
    cn.Open();

    string query =
        @"SELECT 
            id, 
            parentid, 
            field1, 
            field2, 
            field3, 
            field4, 
            field5
        FROM 
            dbo.theTableWithDataInIt";

    SqlCommand cmd = new SqlCommand(query, cn);
    cmd.Notification = null;
    cmd.NotificationAutoEnlist = true;
    SqlCacheDependencyAdmin.EnableNotifications(
        ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString);

    if (!SqlCacheDependencyAdmin.GetTablesEnabledForNotifications(
         ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString)
         .Contains("dbo.theTableWithDataInIt"))
    {
        SqlCacheDependencyAdmin.EnableTableForNotifications(
                    ConfigurationManager.ConnectionStrings["MyConnectionString"].
        ConnectionString, "dbo.theTableWithDataInIt");
    }

    SqlCacheDependency dependency = new SqlCacheDependency(cmd);
    cmd.ExecuteNonQuery();

    //
    // Get Cache Data is a function that returns a DataSet with the data to be added to cache
    //
    Cache.Insert("mycache", GetCacheData(), dependency);
}
  • 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-05-25T19:47:51+00:00Added an answer on May 25, 2026 at 7:47 pm

    The problem was resolved. It turns out the indexes somehow became corrupt or lost. Right clicking on the index in the table and selecting “Rebuild” solved the problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently experiencing a strange issue that my understanding of SQL server doesn't quite
In our server/client-setup we're experiencing some weird behaviour. The client is a C/C++-application which
Im experiencing an issue with a production server. I can connect to the server
We are experiencing an issue where a FullTextSqlQuery is only returning the default 100
We are experiencing an issue where one of our deployment projects gets modified during
We recently are having major performance related issues in our current SQL Server DB.
I'm experiencing an issue on a test machine running Red Hat Linux (kernel version
I'm experiencing an issue with ActiveMQ and would like to trace/view all ActiveMQ activity.
I am experiencing an issue with v1 of Ninject and resetting the StandardKernel. I
I have an XP client that is experiencing an issue. My dev box is

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.