Solved

SQL with great memory usage

Posted on 2014-02-04
9
208 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 6

Expert Comment

by:alexgreen312
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
 
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 6

Expert Comment

by:alexgreen312
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 142

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 142

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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now