Wednesday, March 21, 2012
Processor activity is high.
processor activity is peak or not, and it showed continually above 80%.
Should I upgrade server by adding additional processor?
Is there any other alternatives?
Thanks
Robert Lie
"Robert Lie" <robert.lie24@.gmail.com> wrote in message
news:uJlS%23vbWFHA.3044@.TK2MSFTNGP10.phx.gbl...
>I used %Processor Time counter from System Monitor to know whether the
>processor activity is peak or not, and it showed continually above 80%.
> Should I upgrade server by adding additional processor?
> Is there any other alternatives?
Determine what is using all the CPU cycles and optimize it.
David
|||Hi,
Execute a profiler (With Duration and CPU) when the usage is high. Save the
Profiler output to a table and query the stored procedures / TSQL which uses
more CPU. This will help you to identify the code which eats your CPU. Use
the Execution plans and Index tuning wizard to tune the procedure.
Mostly you will be able to solve the CPU bottleneck, if you still have
issues then probably you need to add one more Processor.
Thanks
Hari
SQL Server MVP
"Robert Lie" <robert.lie24@.gmail.com> wrote in message
news:uJlS%23vbWFHA.3044@.TK2MSFTNGP10.phx.gbl...
>I used %Processor Time counter from System Monitor to know whether the
>processor activity is peak or not, and it showed continually above 80%.
> Should I upgrade server by adding additional processor?
> Is there any other alternatives?
> Thanks
> Robert Lie
Processor activity is high.
processor activity is peak or not, and it showed continually above 80%.
Should I upgrade server by adding additional processor?
Is there any other alternatives?
Thanks
Robert Lie"Robert Lie" <robert.lie24@.gmail.com> wrote in message
news:uJlS%23vbWFHA.3044@.TK2MSFTNGP10.phx.gbl...
>I used %Processor Time counter from System Monitor to know whether the
>processor activity is peak or not, and it showed continually above 80%.
> Should I upgrade server by adding additional processor?
> Is there any other alternatives?
Determine what is using all the CPU cycles and optimize it.
David|||Hi,
Execute a profiler (With Duration and CPU) when the usage is high. Save the
Profiler output to a table and query the stored procedures / TSQL which uses
more CPU. This will help you to identify the code which eats your CPU. Use
the Execution plans and Index tuning wizard to tune the procedure.
Mostly you will be able to solve the CPU bottleneck, if you still have
issues then probably you need to add one more Processor.
Thanks
Hari
SQL Server MVP
"Robert Lie" <robert.lie24@.gmail.com> wrote in message
news:uJlS%23vbWFHA.3044@.TK2MSFTNGP10.phx.gbl...
>I used %Processor Time counter from System Monitor to know whether the
>processor activity is peak or not, and it showed continually above 80%.
> Should I upgrade server by adding additional processor?
> Is there any other alternatives?
> Thanks
> Robert Lie
Tuesday, March 20, 2012
Processor activity is high.
processor activity is peak or not, and it showed continually above 80%.
Should I upgrade server by adding additional processor?
Is there any other alternatives?
Thanks
Robert Lie"Robert Lie" <robert.lie24@.gmail.com> wrote in message
news:uJlS%23vbWFHA.3044@.TK2MSFTNGP10.phx.gbl...
>I used %Processor Time counter from System Monitor to know whether the
>processor activity is peak or not, and it showed continually above 80%.
> Should I upgrade server by adding additional processor?
> Is there any other alternatives?
Determine what is using all the CPU cycles and optimize it.
David|||Hi,
Execute a profiler (With Duration and CPU) when the usage is high. Save the
Profiler output to a table and query the stored procedures / TSQL which uses
more CPU. This will help you to identify the code which eats your CPU. Use
the Execution plans and Index tuning wizard to tune the procedure.
Mostly you will be able to solve the CPU bottleneck, if you still have
issues then probably you need to add one more Processor.
Thanks
Hari
SQL Server MVP
"Robert Lie" <robert.lie24@.gmail.com> wrote in message
news:uJlS%23vbWFHA.3044@.TK2MSFTNGP10.phx.gbl...
>I used %Processor Time counter from System Monitor to know whether the
>processor activity is peak or not, and it showed continually above 80%.
> Should I upgrade server by adding additional processor?
> Is there any other alternatives?
> Thanks
> Robert Lie
Processing User Activity Table
I have an application that will be logging to a SQL Server 2000
database user user activity from several Windows 2003 terminal
servers. This information will be retrieved by monitoring the
Security logs of these servers (this part I know how to accomplish
already).
A table in the database, tblLogEntries, will contain the following
fields:
- ID = autoincrementing int
- LogTime = Date/Time the user activity was recorded in the security
log
- Username = User's login ID that the activity was recorded with
- Type = int, referencing a lookup table with the values of Logon,
Logoff, and possible other future items
- Server = The name of the server the activity was recorded on.
The only question I have is, can you offer a way to process the total
user login time during a given range using T-SQL.
For Example...
Given the table data:
ID LogTime Username Type Server
1 10-10-2003 8:30:00 Tom Logon SERVER-A
2 10-10-2003 8:45:00 Sarah Logon SERVER-A
3 10-10-2003 16:45:00 Tom Logoff SERVER-A
4 10-10-2003 17:00:00 Sarah Logoff SERVER-A
5 10-11-2003 8:30:00 Tom Logon SERVER-A
6 10-11-2003 8:45:00 Sarah Logon SERVER-A
7 10-11-2003 16:30:00 Sarah Logoff SERVER-A
8 10-11-2003 17:15:00 Tom Logoff SERVER-A
How would you receive the output:
User Logon Total Time for SERVER-A
Tom 17.0 hrs
Sarah 16.0 hrs
I know I can handle this type of processing on my ASP.NET front-end,
but I'm curious as to how easily it can be done by the database,
itself.
Thanks in advance for your assistance.Do:
SELECT UserName,
SUM( DATEDIFF( hour, Login, COALESCE( Logoff, Login ) ) )
FROM ( SELECT t1.Username, t1.LogTime,
( SELECT MIN( t2.LogTime )
FROM tbl t2
WHERE t2.Server = t1.Server
AND t2.UserName = t1.Username
AND t2.Type = 'LogOff'
AND t2.LogTime > t1.LogTime )
FROM tbl t1
WHERE t1.Type = 'Logon'
AND t1.Server = 'SERVER-A' ) D ( UserName, Login, Logoff )
GROUP BY UserName ;
--
- Anith
( Please reply to newsgroups only )|||Thanks for the reply.. the query looks good, but I'm having a little
trouble following it, and, as a result, cannot get it to work.
Would you mind explaining it a bit or point me to a reference for this
type of processing?
I'm not sure what that "D" operator is for, and I'll read up on the
COALESCE in BOL.
------------
http://members.tripod.com/kcourville0/
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||D is an alias used for a derived table used in the query; when you use a
subquery construct directly in the FROM clause of an SQL statement with an
alias, in t-SQL, it is called a derived table. Pl. refer to SQL Server Books
Online for syntax and more details on this construct.
The logic is simple:
1. Retrieve the list of users with their login times and the subsequent
logout time (this is achieved using a subquery with MIN function). You can
run the derived table by itself to further understand how it is evaluated.
2. With the data in the derived table, the outer query, get the time
difference between the login time and the logout times and then find the
total using the SUM function.
--
- Anith
( Please reply to newsgroups only )|||Cool... I'll have to learn more of derived tables.
Thanks again for your response.
------------
http://members.tripod.com/kcourville0/
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Wednesday, March 7, 2012
Process Info (SQL Server Enterprise - Management - Current Activity)
I have problem with my database server which running SQL server 2000.
The server running very slow. The worst case, to save a record required
more than 20-30 seconds.
Since this problem, I usually monitoring Process Info from Enterprise
Manager (Management - Current Activity), and I found a misterious
process as follow :
1. User: System
AccessTo: Master
Status: Background
Common: Task Manager
Waiting: >438 Million
2. User: System
AccessTo: Master
Status: Background
Common: Task Manager
Physical IO: > 51000
3. User: Administrator (Join domain)
Database: MSDB
Status: Sleeping
Common: Awaiting Command
App: SQL Agent Alert Engine
CPU Usage: > 16 Million
Anybody know about these condition? Does it normal?
Thanks
Michael
Mike
What is amount of memory?
Run SQL Server Profiler to see what is going on. (Blocking ,locks)
EXEC sp_who2 , see blkby column (If I remember well).
"Michael" <yapmichael2000@.gmail.com> wrote in message
news:1115718206.985119.318980@.o13g2000cwo.googlegr oups.com...
> Dear All
> I have problem with my database server which running SQL server 2000.
> The server running very slow. The worst case, to save a record required
> more than 20-30 seconds.
> Since this problem, I usually monitoring Process Info from Enterprise
> Manager (Management - Current Activity), and I found a misterious
> process as follow :
> 1. User : System
> AccessTo : Master
> Status : Background
> Common : Task Manager
> Waiting : >438 Million
> 2. User : System
> AccessTo : Master
> Status : Background
> Common : Task Manager
> Physical IO : > 51000
> 3. User : Administrator (Join domain)
> Database : MSDB
> Status : Sleeping
> Common : Awaiting Command
> App : SQL Agent Alert Engine
> CPU Usage : > 16 Million
> Anybody know about these condition? Does it normal?
> Thanks
> Michael
>
|||Thanks for your answer,
Amount of memory that be used by SQL Server is 1 GB.
I've check using sp_who, and on nothing on column blkby.
I think that not caused by Locks.
Note : After I restart the server, everything run well for a while. In
the worst case, the problem will be occured in 1 day, but usually
system running well within 3,4 days.
Process Info (SQL Server Enterprise - Management - Current Activity)
I have problem with my database server which running SQL server 2000.
The server running very slow. The worst case, to save a record required
more than 20-30 seconds.
Since this problem, I usually monitoring Process Info from Enterprise
Manager (Management - Current Activity), and I found a misterious
process as follow :
1. User: System
AccessTo: Master
Status: Background
Common: Task Manager
Waiting: >438 Million
2. User: System
AccessTo: Master
Status: Background
Common: Task Manager
Physical IO: > 51000
3. User: Administrator (Join domain)
Database: MSDB
Status: Sleeping
Common: Awaiting Command
App: SQL Agent Alert Engine
CPU Usage: > 16 Million
Anybody know about these condition? Does it normal?
Thanks
MichaelMichael (yapmichael2000@.gmail.com) writes:
> I have problem with my database server which running SQL server 2000.
> The server running very slow. The worst case, to save a record required
> more than 20-30 seconds.
> Since this problem, I usually monitoring Process Info from Enterprise
> Manager (Management - Current Activity), and I found a misterious
> process as follow :
> 1. User : System
> AccessTo : Master
> Status : Background
> Common : Task Manager
> Waiting : >438 Million
> 2. User : System
> AccessTo : Master
> Status : Background
> Common : Task Manager
> Physical IO : > 51000
> 3. User : Administrator (Join domain)
> Database : MSDB
> Status : Sleeping
> Common : Awaiting Command
> App : SQL Agent Alert Engine
> CPU Usage : > 16 Million
> Anybody know about these condition? Does it normal?
These are system processes, and they be normal, particularly if SQL Server
has been up for a long time. I checked a production box, and while it
had lower numbers than yours, they were still big.
The most likely reason when a server appears to be slow is poor indexing,
poorly written code and fragmentation. For instance, when saving a row and
there is a poorly written trigger, this could make the INSERT statement
to take a long time. Blocking could also be an issue, and blocking can
also easily occur, if there are slow queries.
You don't say whether this is an application, you have control over
or a third-party app. But in any, case you need to analyse exactly
which queries that are slow. One way to do this is use the SQL Profiler,
and filter for operations with a long duration. Note though that from
duration alone, you cannot tell whether it was due to blocking or bad
performance. The CPU, Reads and Writes columns can give some hints about
this. (If they are low and duration is high, there was blocking.) You
can also use sp_who to see if you have any blocking, by looking for
non-zero values in the Blk column.
Once you have found the queries that are long-running, you can look
into improving indexes, and if possible also rewrite them.
You can also try running DBCC DBREINDEX on tables where you experience
problem. If you have fragmentation, you can get improvements.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Thanks for your answer.
I've problem, as I wrote down, sometime to save a record required much
time.
When this happen, usually I restart the server, and then the problem
solved for a while. The problem will happen again within 10 day.
When the problem occured, on the Task Manager, Process Tab, SQLServ.exe
using more than 1 Gigabyte memory. And after restart the server,
SQLServ.exe only use about 450 to 500 Megabyte.
While the problem occured, there were difficulty to make connection to
the server (using Enterprise manager, Query Analyser, Application).
Usually an error message : Timeout expired.
About the application, I use visual basic to develop application.
And there were a few trigger, some of there were use cursor.
At this momenth, I have disable many trigger that used cursor, but
there a bit trigger which used cursor still active.
Would you like to give any suggestion?
Thanks very much
Michael|||Michael (yapmichael2000@.gmail.com) writes:
> I've problem, as I wrote down, sometime to save a record required much
> time.
> When this happen, usually I restart the server, and then the problem
> solved for a while. The problem will happen again within 10 day.
> When the problem occured, on the Task Manager, Process Tab, SQLServ.exe
> using more than 1 Gigabyte memory. And after restart the server,
> SQLServ.exe only use about 450 to 500 Megabyte.
That's perfectly normal. SQL Server grabs as much memory it needs and
can get. This memory is used for cache. So if SQL Server are kept running,
and there is no other activity on the machine, SQL Server should by
time have grown to use about all memory on the machine that the OS
does not need. (If there are other apps asking for memory, SQL Server
will yield memory.) Thus, a high memory consumption is no sign of
problem.
> While the problem occured, there were difficulty to make connection to
> the server (using Enterprise manager, Query Analyser, Application).
> Usually an error message : Timeout expired.
This one on the other hand obviously is a token of that something is wacko.
Do you get these problems also when you try to connect from the machine on
which SQL Server is running? If this works fine, one could suspect network
problems.
If not, it sounds like something is bogging down SQL Server very heavily.
This could be a poorly written query, but it also be an anomaly in the
server. Check what is in the SQL Server log at these occassions; there
might be some interesting messages. Particularly, I have one about UMS
Scheduler in mind. (A message that was added in SP3, but you are running
SP3 aren't you? By the way, SP4 is out.)
It could also be an idea to keep a Profiler trace running so you can see
what commands that are submitted and then try to correlate these commands
with the conditions where there server is not very reposnive.
Another check to make, just to rule out the more silly stuff, is that
you don't have any compressed database files.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp
Process Info (SQL Server Enterprise - Management - Current Activity)
I have problem with my database server which running SQL server 2000.
The server running very slow. The worst case, to save a record required
more than 20-30 seconds.
Since this problem, I usually monitoring Process Info from Enterprise
Manager (Management - Current Activity), and I found a misterious
process as follow :
1. User : System
AccessTo : Master
Status : Background
Common : Task Manager
Waiting : >438 Million
2. User : System
AccessTo : Master
Status : Background
Common : Task Manager
Physical IO : > 51000
3. User : Administrator (Join domain)
Database : MSDB
Status : Sleeping
Common : Awaiting Command
App : SQL Agent Alert Engine
CPU Usage : > 16 Million
Anybody know about these condition? Does it normal?
Thanks
MichaelMike
What is amount of memory?
Run SQL Server Profiler to see what is going on. (Blocking ,locks)
EXEC sp_who2 , see blkby column (If I remember well).
"Michael" <yapmichael2000@.gmail.com> wrote in message
news:1115718206.985119.318980@.o13g2000cwo.googlegroups.com...
> Dear All
> I have problem with my database server which running SQL server 2000.
> The server running very slow. The worst case, to save a record required
> more than 20-30 seconds.
> Since this problem, I usually monitoring Process Info from Enterprise
> Manager (Management - Current Activity), and I found a misterious
> process as follow :
> 1. User : System
> AccessTo : Master
> Status : Background
> Common : Task Manager
> Waiting : >438 Million
> 2. User : System
> AccessTo : Master
> Status : Background
> Common : Task Manager
> Physical IO : > 51000
> 3. User : Administrator (Join domain)
> Database : MSDB
> Status : Sleeping
> Common : Awaiting Command
> App : SQL Agent Alert Engine
> CPU Usage : > 16 Million
> Anybody know about these condition? Does it normal?
> Thanks
> Michael
>|||Hi Michael,
I agree with Uri, something is a bit iffy with your server and you should
run the profiler.
If you don't have any jobs running I would sugest you stop then restart the
service that way when it re-starts it will start with a 'clean plate' then
your can put on your monitoring stuff. NB if you to have jobs running then
you run the risk of losing data.
However when it does re-start it should be a lot faster.
Peter
"Michael" wrote:
> Dear All
> I have problem with my database server which running SQL server 2000.
> The server running very slow. The worst case, to save a record required
> more than 20-30 seconds.
> Since this problem, I usually monitoring Process Info from Enterprise
> Manager (Management - Current Activity), and I found a misterious
> process as follow :
> 1. User : System
> AccessTo : Master
> Status : Background
> Common : Task Manager
> Waiting : >438 Million
> 2. User : System
> AccessTo : Master
> Status : Background
> Common : Task Manager
> Physical IO : > 51000
> 3. User : Administrator (Join domain)
> Database : MSDB
> Status : Sleeping
> Common : Awaiting Command
> App : SQL Agent Alert Engine
> CPU Usage : > 16 Million
> Anybody know about these condition? Does it normal?
> Thanks
> Michael
>|||Thanks for your answer,
Amount of memory that be used by SQL Server is 1 GB.
I've check using sp_who, and on nothing on column blkby.
I think that not caused by Locks.
Note : After I restart the server, everything run well for a while. In
the worst case, the problem will be occured in 1 day, but usually
system running well within 3,4 days.
Process Info (SQL Server Enterprise - Management - Current Activity)
I have problem with my database server which running SQL server 2000.
The server running very slow. The worst case, to save a record required
more than 20-30 seconds.
Since this problem, I usually monitoring Process Info from Enterprise
Manager (Management - Current Activity), and I found a misterious
process as follow :
1. User : System
AccessTo : Master
Status : Background
Common : Task Manager
Waiting : >438 Million
2. User : System
AccessTo : Master
Status : Background
Common : Task Manager
Physical IO : > 51000
3. User : Administrator (Join domain)
Database : MSDB
Status : Sleeping
Common : Awaiting Command
App : SQL Agent Alert Engine
CPU Usage : > 16 Million
Anybody know about these condition? Does it normal?
Thanks
MichaelMike
What is amount of memory?
Run SQL Server Profiler to see what is going on. (Blocking ,locks)
EXEC sp_who2 , see blkby column (If I remember well).
"Michael" <yapmichael2000@.gmail.com> wrote in message
news:1115718206.985119.318980@.o13g2000cwo.googlegroups.com...
> Dear All
> I have problem with my database server which running SQL server 2000.
> The server running very slow. The worst case, to save a record required
> more than 20-30 seconds.
> Since this problem, I usually monitoring Process Info from Enterprise
> Manager (Management - Current Activity), and I found a misterious
> process as follow :
> 1. User : System
> AccessTo : Master
> Status : Background
> Common : Task Manager
> Waiting : >438 Million
> 2. User : System
> AccessTo : Master
> Status : Background
> Common : Task Manager
> Physical IO : > 51000
> 3. User : Administrator (Join domain)
> Database : MSDB
> Status : Sleeping
> Common : Awaiting Command
> App : SQL Agent Alert Engine
> CPU Usage : > 16 Million
> Anybody know about these condition? Does it normal?
> Thanks
> Michael
>|||Thanks for your answer,
Amount of memory that be used by SQL Server is 1 GB.
I've check using sp_who, and on nothing on column blkby.
I think that not caused by Locks.
Note : After I restart the server, everything run well for a while. In
the worst case, the problem will be occured in 1 day, but usually
system running well within 3,4 days.
Process Info
Under Managment/Current Activity/Process Info you can see
all the users with connections to the system.
Here is the problem. A couple of users seem to have
multiple (10 or more) process ID's, all of them sleeping.
After a chat with them they said they were not in the
application, but the process was still being displayed.
My questions are then, should I be concerned, and why
aren't they closing automatically ?
Thanks
Peter
Users have different ideas of what "being in an application"
means so it depends on what they meant. If they meant they
weren't actively using it, then the processes would still be
there if they are still connected. If they application was
actually closed then the processes will clean up eventually.
The processes remaining after closing an app could be due to
poor coding practices in the application, such as ado
references are not being cleaned up. If the issue is the 10
or more processes, that is also controlled by the
application. If it's an ADO app, then it probably wasn't
written to use the active connection - instead it keeps
creating new connections for whatever it needs to do.
It's not really going to hurt anything but it looks like
it's likely related to how the application was written.
-Sue
On Wed, 7 Apr 2004 08:17:28 -0700, "Peter"
<anonymous@.discussions.microsoft.com> wrote:
>Dear All,
>Under Managment/Current Activity/Process Info you can see
>all the users with connections to the system.
>Here is the problem. A couple of users seem to have
>multiple (10 or more) process ID's, all of them sleeping.
>After a chat with them they said they were not in the
>application, but the process was still being displayed.
>My questions are then, should I be concerned, and why
>aren't they closing automatically ?
>Thanks
>Peter
Process Info
-PatP
Process Info
Under Managment/Current Activity/Process Info you can see
all the users with connections to the system.
Here is the problem. A couple of users seem to have
multiple (10 or more) process ID's, all of them sleeping.
After a chat with them they said they were not in the
application, but the process was still being displayed.
My questions are then, should I be concerned, and why
aren't they closing automatically ?
Thanks
PeterUsers have different ideas of what "being in an application"
means so it depends on what they meant. If they meant they
weren't actively using it, then the processes would still be
there if they are still connected. If they application was
actually closed then the processes will clean up eventually.
The processes remaining after closing an app could be due to
poor coding practices in the application, such as ado
references are not being cleaned up. If the issue is the 10
or more processes, that is also controlled by the
application. If it's an ADO app, then it probably wasn't
written to use the active connection - instead it keeps
creating new connections for whatever it needs to do.
It's not really going to hurt anything but it looks like
it's likely related to how the application was written.
-Sue
On Wed, 7 Apr 2004 08:17:28 -0700, "Peter"
<anonymous@.discussions.microsoft.com> wrote:
>Dear All,
>Under Managment/Current Activity/Process Info you can see
>all the users with connections to the system.
>Here is the problem. A couple of users seem to have
>multiple (10 or more) process ID's, all of them sleeping.
>After a chat with them they said they were not in the
>application, but the process was still being displayed.
>My questions are then, should I be concerned, and why
>aren't they closing automatically ?
>Thanks
>Peter
Process Info
Under Managment/Current Activity/Process Info you can see
all the users with connections to the system.
Here is the problem. A couple of users seem to have
multiple (10 or more) process ID's, all of them sleeping.
After a chat with them they said they were not in the
application, but the process was still being displayed.
My questions are then, should I be concerned, and why
aren't they closing automatically ?
Thanks
PeterUsers have different ideas of what "being in an application"
means so it depends on what they meant. If they meant they
weren't actively using it, then the processes would still be
there if they are still connected. If they application was
actually closed then the processes will clean up eventually.
The processes remaining after closing an app could be due to
poor coding practices in the application, such as ado
references are not being cleaned up. If the issue is the 10
or more processes, that is also controlled by the
application. If it's an ADO app, then it probably wasn't
written to use the active connection - instead it keeps
creating new connections for whatever it needs to do.
It's not really going to hurt anything but it looks like
it's likely related to how the application was written.
-Sue
On Wed, 7 Apr 2004 08:17:28 -0700, "Peter"
<anonymous@.discussions.microsoft.com> wrote:
>Dear All,
>Under Managment/Current Activity/Process Info you can see
>all the users with connections to the system.
>Here is the problem. A couple of users seem to have
>multiple (10 or more) process ID's, all of them sleeping.
>After a chat with them they said they were not in the
>application, but the process was still being displayed.
>My questions are then, should I be concerned, and why
>aren't they closing automatically ?
>Thanks
>Peter