Re: ms sql server grabbing 5Gb. Is this good nomal?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On 19 mar, 17:53, Jeroen Mostert <jmost...@xxxxxxxxx> wrote:
Raphael Gomes wrote:
So I have a .NET site with a few rather large tables (the three main
ones at about 1 million records each). The hosting setup consists of
some Web Servers running IIS 6, being served by another box running MS
SQL Server 2005.

The web servers run smoothly enough, but even without much use (this
site has such a multi-server setup because it has spikes of use near
holidays) but the SQL Server is coughing up and dying about once a
day.

The guys at the hosting company show me the logs showing that the SQL
server is under heavy use (processor at almost +90%, 5Gb of RAM used).

I'm willing to bet good money that you're either missing critical indexes or
issuing inherently inefficient queries ("SELECT * FROM hugetable") or both.
Heavy processor and memory use are typical of table scans, and scanning a
table of a million records is... inadvisable.

I see... So, if I understand correctly these, I should filter the
selects ('SELECT fields I actually will use' instead 'SELECT *') and,
if I need to search a field (which I do) which is not the PK, it
should be an index.

I'm running SQL profiler trying to find out if there are some rogue
query causing trouble (I used linq for this project) but so far, I
haven't seen good benchmarks for sql server performance.

Check for queries which take an inordinate amount of time (anything over 10
seconds that's issued more than once almost certainly needs tuning) and
queries which take far greater amounts of logical reads than others. Focus
on optimizing these first.

Good advice! So far, all the queries run in a couple of seconds, but
some have about 200x more reads (as seen on SQL Server Profiler) than
others. I'm talking about 7780 reads for some selects versus 3, for
selects in the same table.

Are these numbers "normal" for a setup like this? (single sql server
serving multiple web servers, tables of about 1 million records each - so
far being used for simple selects, inserts and updates).

What's "normal" also depends on your hardware and your actual data needs --
what is "simple" to you is not necessarily simple for the server. However,
if your SQL Server consistently eats 90% CPU you're almost certainly doing
*something* wrong -- either the server is way underpowered or your database
design is wrong, with the latter being a lot more likely.

Probably, I did the mistake of using lots of settings out of the box
and then scalability struck back, badly. :-P

Now, all this said, this has nothing do to with C# so far, .NET and LINQ or
no. A far better newsgroup for questions like this would be
microsoft.public.sqlserver.server. But before you ask questions there,
searching the web for tips on optimizing SQL Server performance is likely to
be even more fruitful.

Indeed! Group found and added. I'll ask there, now.

Thanks for you answers. They really helped.

--
Raphael Gomes
.



Relevant Pages

  • Scanning for SQL Injection
    ... I need to scan about 350+ sites from three different web servers that all connect to one MS SQL server for SQL injection. ... solution FREE - limited Time Offer ...
    (Pen-Test)
  • SSL Security Error
    ... We have two web servers load balanced by ... We are using ASP.NET 1.1 and authenticating to SQL server 2005 using ... integrated authentication. ... System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ms sql server grabbing 5Gb. Is this good nomal?
    ... The queries to find missing indexes and to find unusedindexes is ... You can also look at the Sql Server Dashboard Reports, ... some Web Servers running IIS 6, being served by another box running MS ...
    (microsoft.public.dotnet.languages.csharp)
  • Text file to sql challenge...
    ... I pose this challenging situation to see if anyone has any suggestions as to ... Text files with dynamic name are stored on one of several web servers. ... by each web service. ... SQL Server is the standard edition out of the box with SP3 ...
    (microsoft.public.sqlserver.programming)
  • Re: Load Balancing
    ... SQL Server is not Load Balance aware. ... Even with clustering does not ... You could have load balance your web servers, ...
    (microsoft.public.sqlserver.replication)