Single-Threading / Performance issues

From: Peter The Spate (anonymous_at_discussions.microsoft.com)
Date: 10/28/04


Date: Thu, 28 Oct 2004 03:59:21 -0700

Hi Robin

Firstly have a look at the following
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/instsql/in_upgrade_5jw3.asp

The reason why I put this in is because you said you
restored the database, so your statistics are going to be
wrong. If you supply an email address I can send you some
code that will update the stats.

Other things you can look at.

In the database properties take off auto close and auto
shrink if its on, and make sure the compatability level is
set to 8.0

Under the server properties select Dynamically configure
SQL Memory, under processor control make sure that all
cpu's have bee selected, select use all available
processors.

Anyway there are a lot more options you can use as well.

Other things you can look are server stuff. Find out what
applications are running on your server, for instance
having exchange on the same server will really effect
performance. Set up a performance monitor and check what
sort of performance your server has, and if any of them
look high then speak to the server guy.

In the meanwhile get the book SQL Server 2000 Performance
Tuning.

As I said, if you give me your email I can provide some
code.

Peter
"Real knowledge is to know the extent of one's ignorance."
Confucius

>-----Original Message-----
>Hello World ;-))
>
>I'm not a DBA, more of a programmer, so am calling on you
good folk for clues - because I'm at my wits end.
>Apologies up front for my long post - I'm hoping to give
sufficient indication of what's going on.
>
>
>Early this year my database was migrated from a single
CPU, SQL7 database on Win Nt4 to a quad-processor, SQL2000
on a Win2K platform.
>(Done by restore, not DTS of data)
>
>Trouble is the performance is not what it should be ...
worse than on the old system ... it appears to me as if
the system is single-threading at times. (when a long
select query is running, the website users will time-out
trying to log-in).
>
>During this time, refreshing under Enterprise Manager to
check "Current Activity" gives you ... hourglass.
>No update until whatever process it is has completed
enough to let you in to look.
>
>I haven't found any blockers, and the wait-state codes
(when I get in to ask the question), show nothing wrong
(not waiting), or the odd disk-related wait state. (I can
understand waiting for disk - gotta fetch the data from
somewhere ;-))
>
>
>My DBA has tried tweaking some parameters and sez nothing
is wrong, my server guy also sez it's not his problem.
>
>So I'm left in the middle trying to figure out what's
going wrong.
>
>
>
>
> Here's an example.
> From Query Analyser, I run my import proc - which first
copies data across the network and then loads to SQL.
> Seems to be going fine until nearing the end of the
proc - about when the load happens.
>
> Then Enterprise Manager hangs on Refresh of "Current
Activity".
> I alt-tab to WinVNC session and try get in to start
PerfMon.
> Connect okay, enter password, press Enter ...
Nothing happens.
> Can't alt-tab back to EM - not responding.
>
> Alt-Tab to Query Analyser - proc has completed ??!!
>
> Still no response on EM or WinVNC.
>
> Some two minutes later - both come back.
> Nothing waiting, no apparent problem.
>
> What the heck is going on ... some sort of SQL cleanup ?
>
>
>
>Here's some other detail :-
>
> The new hardware should be fine ...
> HP/Compaq branded server,
> 4 Intel Xeon 2.5 gHz processors,
> 2048Mb memory, (maybe too little ?)
> 2x 72Gb disks. (apparently set to RAID-5)
>
>
> Product: SQL Server Standard Edition.
> O/S: MS WinNT 5 (2195) (SP4)
> Version: 8.00.760 (SP3)
>
> Memory Tab:
> Dynamically configure
> No reserve
>
>Processor Tab:
> SQL to use all 4 processors
> Max worker threads 100
> Use all available processors
> Minimum Query plan threshold: 5
>
>
>
>
>The main .MDF is around 45Gb, so shouldn't be a problem
in terms of size. We have, however, been battling to back
this thing up, now having to reboot daily because it gets
locked/held ... system message about "another process" has
locked a portion of the file. We've lost the database
twice on cancelling a running Select query - so we don't
do that any more.
>
>
>
>I've seen other funnies as well ... when a single user
runs a long query (Table scan of some 8 million rows) ...
PerfMon shows 100% disk utilisation.
>At this point access to the O/S facilities itself are
slowed / frozen ... and appear to wait until the query
completes.
>(CPU etc almost zero, screen-paint of forms delayed !)
>
>Occasionally I get this in the Event Log ...
> Error: 17883, Severity: 1, State: 0
> The Scheduler 0 appears to be hung. SPID 6, ECID
0, UMS Context 0x039634A0
>
> This happens at the time data is flowing / batch
updates of incoming data records.
>
>
>Sometimes a BCP of data into the database will die,
copies across the network are fine, but it fails on the
import step.
>Not always at the same time or on the same table - and
this is circa 1 AM with nothing else supposed to be
running.
>
>
>Another thing. The first time I run a long table-scan,
it takes ages - like the database is sleeping / paged out.
>If I then change the selection for a subsequent scan, the
results are almost immediate.
>(Within reason of course - too different and it's just as
slow - like 20 minutes to scan 8 million rows)
>
>
>Based on my years in the IBM mainframe world, this smacks
of an I/O bottleneck of some sort.
>My guess is disk vs memory, but sadly, I'm going to have
to prove what the problem is before my server guy will
respond.
>
>
>ANY CLUES would be most welcome
>
>Regards,
>Robin Martin.
>
> System Integration and MIS
> Nedcor Call Center
> +27 11 710-3040
>
> NATMTWCBEBI - Never ascribe to malice, that which can be
explained by incompetence. [Napoleon]
>
>*****************************************
>* This message was posted via http://www.sqlmonster.com
>*
>* Report spam or abuse by clicking the following URL:
>* http://www.sqlmonster.com/Uwe/Abuse.aspx?
aid=e7b8cec0bd5a4998b82fe3c64876ea5c
>*****************************************
>.
>



Relevant Pages

  • Re: DBMS and lisp, etc.
    ... Naively implemented with SQL, again for 10 ... (1 query for the initial orders, 1 query for each order for its ... soon as you upgrade to the SQL database. ... (eq (order-customer orderA) ...
    (comp.lang.lisp)
  • Re: Action pass-through with a form variable Access 2003
    ... database, but a local Access database) or a database object derived ... I'm not sure that you said you were using MS SQL Server. ... Query object, and simply replace the SQL string with the modified one. ...
    (comp.databases.ms-access)
  • Re: Action pass-through with a form variable Access 2003
    ... I've never used Connect as a property of a database, ... I'm not sure that you said you were using MS SQL Server. ... Query object, and simply replace the SQL string with the modified one. ...
    (comp.databases.ms-access)
  • RE: Backups have Shadow Copy Problems
    ... and restarted the server. ... suggested and changed the recovery model to simple on the one database called ... I understand the issue to be: the backup task failed ... You back up data from a volume that contains a Microsoft SQL Server ...
    (microsoft.public.windows.server.sbs)
  • Re: MailMerge hangs and crashes with Access on Server
    ... Since I am fairly new to working in this environment, I am not sure what you mean by an "Access group" with help to restructuring the query? ... "Peter Jamieson" wrote: ... All I know is that the performance of queries depends to a large extent on whether, for example, a join is performed on the client side, or on the server side, incurring no network traffic and potentially benefitting from caching on the server. ... There are no dialog boxes, and actually, I have now split the database, and have kept the Word templates and the Access frontend locally on my machine, and moved the backend to the server. ...
    (microsoft.public.word.mailmerge.fields)