473,657 Members | 2,624 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

100% CPU Usage (Part 2)

Hi all

Please read my previous post here if this interests you:

http://groups.google.co.uk/group/com...u+usage&hl=en&

I have (or rather a colleague has) found the situation that appears to
be causing this problem but I am still no further to finding a
solution.

It appears that if we execute a query against one particular table in
the database and that query requests data that is not indexed, or a
column in the where clause is not indexed then this is when problems
occur.

The table cannot be copied using DTS reporting the error:

"Error occurred copying row 3 - unspecified error".

However, we can query using:

"SELECT TOP n FROM <Table>"

where n so far has been between 3 and 100000.

However we cannot do SELECT * FROM <Table>.

All we can guess at for now is that the problem occurs when a query is
performed to try and fetch data that is not indexed, using an index in
the where clause.

i.e. SELECT <Non-indexed column> FROM <Table> WHERE <Indexed Column> =
n

Could it be possible that we have one 'rogue' row in the table somehow
that is causing the problem?

The only thing to dispel this is that we can do the following:

SELECT * FROM <Table> WHERE ID < 1

which returns 1 row with ID = -1.

We cannot do:

SELECT * FROM <Table> WHERE ID < 200 even though we know that the only
record matching this criteria is the record with ID = -1.

Therefore the exact same data should be returned yet one query fails
and one works.

The actual problem that we see is that memory usage climbs
dramatically, then once all memory is used, the CPU usage climbs to
100% and stays there until we have to restart SQL Server.

Any suggestions on this would be hugely appreciated.

Thanks,

Paul

Feb 9 '06 #1
4 2983
Have you done a DBCC CHECKDB to rule out corruption?
SELECT * FROM <Table> WHERE ID < 1

which returns 1 row with ID = -1.

We cannot do:

SELECT * FROM <Table> WHERE ID < 200 even though we know that the only
record matching this criteria is the record with ID = -1.

Therefore the exact same data should be returned yet one query fails
and one works.

Do get an error message or does the 'failed' query not complete with 100%
CPU? Do you get the same execution plan with both queries?

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Paul" <pa***********@ hotmail.com> wrote in message
news:11******** *************@o 13g2000cwo.goog legroups.com... Hi all

Please read my previous post here if this interests you:

http://groups.google.co.uk/group/com...u+usage&hl=en&

I have (or rather a colleague has) found the situation that appears to
be causing this problem but I am still no further to finding a
solution.

It appears that if we execute a query against one particular table in
the database and that query requests data that is not indexed, or a
column in the where clause is not indexed then this is when problems
occur.

The table cannot be copied using DTS reporting the error:

"Error occurred copying row 3 - unspecified error".

However, we can query using:

"SELECT TOP n FROM <Table>"

where n so far has been between 3 and 100000.

However we cannot do SELECT * FROM <Table>.

All we can guess at for now is that the problem occurs when a query is
performed to try and fetch data that is not indexed, using an index in
the where clause.

i.e. SELECT <Non-indexed column> FROM <Table> WHERE <Indexed Column> =
n

Could it be possible that we have one 'rogue' row in the table somehow
that is causing the problem?

The only thing to dispel this is that we can do the following:

SELECT * FROM <Table> WHERE ID < 1

which returns 1 row with ID = -1.

We cannot do:

SELECT * FROM <Table> WHERE ID < 200 even though we know that the only
record matching this criteria is the record with ID = -1.

Therefore the exact same data should be returned yet one query fails
and one works.

The actual problem that we see is that memory usage climbs
dramatically, then once all memory is used, the CPU usage climbs to
100% and stays there until we have to restart SQL Server.

Any suggestions on this would be hugely appreciated.

Thanks,

Paul

Feb 9 '06 #2


It turns out that we have a table that is over 1GB in size. We only had
the server configured to allow SQL Server to use 800MB.

Therefore, when we were querying using a query resulting in a full
table scan there was not enough memory to perform the query. Instead of
returning an error it basically just stopped (or maybe it was doing the
query but it would take years!).

Anyway, thanks to all those that posted!

Paul

Feb 9 '06 #3
Paul (pa***********@ hotmail.com) writes:
It turns out that we have a table that is over 1GB in size. We only had
the server configured to allow SQL Server to use 800MB.

Therefore, when we were querying using a query resulting in a full
table scan there was not enough memory to perform the query. Instead of
returning an error it basically just stopped (or maybe it was doing the
query but it would take years!).


There is no reason why SQL Server would failed to return all rows from
a table that is larger than the available memory. However, it should
not comes as any surprise that returning so many rows will take a
very long time, and will saturate both server and client.

Or are you saying that you get a problem if you do:

SELECT * FROM tbl WHERE nonindexedcol = oddvalue

While it will take some load as the table is scanned, and both brought
into cache and out again, it should not send SQL Server into complete
nirvana.
--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Feb 9 '06 #4

"Paul" <pa***********@ hotmail.com> wrote in message
news:11******** ************@o1 3g2000cwo.googl egroups.com...


It turns out that we have a table that is over 1GB in size. We only had
the server configured to allow SQL Server to use 800MB.

This may hurt performance but should not break things.

We routinely use tables multiple gigabytes in size.

But we did hit a bug (I forget details) in a query we were doing on a SQL
2000 SP3 DB.

SP4 fixed it.

Therefore, when we were querying using a query resulting in a full
table scan there was not enough memory to perform the query. Instead of
returning an error it basically just stopped (or maybe it was doing the
query but it would take years!).

Anyway, thanks to all those that posted!

Paul

Feb 10 '06 #5

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

Similar topics

2
4865
by: vishal | last post by:
Hi I a am executing a stored procedure from C code using SQLExecute . It takes some time to Execute the procedure. However when I see the processor usage during that time it shows 100% cpu usage. Can anyone tell me why SQLExecute uses 100% CPU when running the stored proceudre. Thanks vishal
8
15970
by: Greg Merideth | last post by:
I've written a basic windows service to provide some helper xml functions for my web methods and even thou the service is only about 1k lines long with 1 timer, its mem usage is 10m and its vm mem usage is 14! The same code written as a program that requires you to click on the menu options to fire off the events takes up 4/9mb. I've seen examples where calling SetProcessWorkingSetSize(hWnd, -1, -1); does the same thing as minimizing a...
2
2116
by: wushupork | last post by:
I have written a screensaver application in C# .NET and have noticed that whenever the animation loop is running - CPU usage always spikes up close to 100%. My application uses a paint thread which is set at 100ms. the program looks sort of like this: // constructor public Form1() {
4
1421
by: hmedinapy | last post by:
has anyone had a issue like this... My application (VB .net) starts using about 20% from cpu, and slowly increase the cpu usage to 100%. I need to know any factor that hs influence on cpu usage... My app, needs to show rows in a datagrid, and refresh this data throught a timing, and I use the System.Windows.Forms.Timer object. I suspect threads are not been deallocated or disposed after I kill them explicity.. Actually I
2
2185
by: Sidharth | last post by:
Hello, We are experiencing some issues with the aspnet_wp process on our live servers. The problems are intermittent and we cannot reproduce it on our dev and test servers. Currently around twice a day the aspnet_wp process takes 100% of the cpu and causes the whole website to come to a stand still. We then have to end the process for the website to become useable. Once the aspnet_wp process recycled itself and in the event logs it...
11
4615
by: David Schwartz | last post by:
When I run my VB.NET Windows Forms application, the CPU usage jumps up to 100%. If I drop-down a menu, the usage goes down to a more reasonable number, like 0-2%. The same is true when a MsgBox comes up. Has anyone else noticed or experienced this? Why would this be? Is this the norm for VB.NET apps? Thanks in advance.
22
31963
by: Paul | last post by:
Hi I am having a real issue with CPU usage by SQL Server, and it is not related to a poor query. I have a clients database that I am currently investigating some issues with. After I perform a standard task using the application, and the results have been returned to the application the cpu usage remains at 100%.
5
1639
by: fniles | last post by:
I am having problem with thread. I have a Session class with public string variable (called Message) that I set from my Main program. In the session class it checks for the value of Message while inside it's "read loop" waiting for data from the client. In the main program, I check to see if the Message member has been cleared before changing its value, that way you know it has been written by the
1
2144
by: showson1 | last post by:
Hi all! I have some files that are basically a TIF with an ASCII header. I wrote an app that reads in the file, pulls some values from the header and writes out everything after the header as a new file. I'm using binaryreader and binarywriter. Everything functions fine, but the following loop causes 100% CPU usage and I can't figure out how to get around this. Here is a code sample that lists the declarations and the loop that's
0
8427
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8330
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8850
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8746
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8626
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7355
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6178
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.