Solved

SQL with great memory usage

Posted on 2014-02-04
9
214 Views
Last Modified: 2014-03-17
Hi Experts,

I have a SQL Cluster but the cluster takes nearly all memory and is slow.
Can we check together from where it comes ?
It is SQL 2008 on WIN 2008 machine.
Some DB´s installed nearly 100GB DB's.
The RAM has 20GB
0
Comment
Question by:Eprs_Admin
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 10

Expert Comment

by:Alex Green
ID: 39832458
Lol,

Yeah if you've got 100GB database I'm not surprised it's ripping apart the 20GB you have installed. SQL is designed to pull every single bit of memory that's available to it. The reason it's slow is you're probably running out of memory whilst it's doing some of the more complicated queries.

To put it into perspective, I have a 45Gb database which runs complicated queries and it's got 128GB of memory.... SQL takes it all.

If you can, throw in some more memory, if it's a a VM then assign it 64GB and see how it goes with that. If you don't have the memory you could try increasing your page file but the performance still won't be great.

Regards

Alex
0
 

Author Comment

by:Eprs_Admin
ID: 39832512
No I don't have more memory.
Can you show me some performance counters to check ?
0
 
LVL 15

Expert Comment

by:jerseysam
ID: 39832592
SQL is designed to use memory as required, unless you set it a limit:

http://technet.microsoft.com/en-us/library/ms178067.aspx
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 16

Expert Comment

by:Surendra Nath
ID: 39832597
well dont worry about SQL Server hogging the complete memory, as long as that cluster is used only SQL Server alone.... and no other services are installed on it.

There are many reasons why SQL Server can take more memory

1) the minimum server memory can be set up to 19 GB
2) SQL Server will cache up some execution plans in memory for efficient reuse.
and many more.
0
 
LVL 10

Expert Comment

by:Alex Green
ID: 39832622
Well the thing is if you assign SQL a certain amount of memory it'll take it all. If you want to see how much it's using then check the working set of memory I think it is
untitled.JPG
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 39832635
if you have 20GB of memory in the machine, set the max memory setting of the sql server properties to 16000 (which is in MB ), this should help already (a sql instance restart may be needed to "force" the setting fast)

other than that, a sql profiler can help to see which queries are taking long, and check them for missing indexes, or (which is also often the case) for queries running in "parallel mode" which is often counter-productive. the following option, added to the sql, will then solve the issue
OPTION (MAXDOP=1) 

Open in new window

0
 

Author Comment

by:Eprs_Admin
ID: 39832646
yes I have the same with 90% of memory.
0
 

Author Comment

by:Eprs_Admin
ID: 39835615
for what is this option MAXDOP=1
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 39835639
that is to force sql server to run the query "non-parallelized", hence using 1 CPU only.
you may say "why limit the usage of CPU", but I have seen plenty of cases where small queries went very bad (minutes and more instead of subsecond) due to the overhead of having to "split" the work (data to be processed) to several CPU, and recombine the result later.
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to install and use the NTBackup utility that comes with Windows Server.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question