Eprs_Admin
asked on
sql performance
Hi Experts,
i have an SQL 2008 cluster in my network and the user tell me a very bad performance.
Sometimes they wait 5 minutes to finish a task.
Can you help me and guide me to find these performance killers ?
i have an SQL 2008 cluster in my network and the user tell me a very bad performance.
Sometimes they wait 5 minutes to finish a task.
Can you help me and guide me to find these performance killers ?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hello,
I have installed the Performance Dashboard.
Here I can see over 70 locks and a lot of parallelism.
Can you explain the parallelism problem please ?
I have installed the Performance Dashboard.
Here I can see over 70 locks and a lot of parallelism.
Can you explain the parallelism problem please ?
Parallelism can be explicit (you set it in the query with MAXDOP option) or implicit (the engine will decide to use it or not depending on the conditions) and it's used to split a query execution in many task as existing CPU/core or as many is set by the MAXDOP option.
When well used it can be a perform boost but in the other hand can be a big bottleneck if you use it wrong.
To verify the MAXDOP configured in the SQL Server instance run the following in a New Query window:
Can't help you more without seeing the query and the respective query plan.
When well used it can be a perform boost but in the other hand can be a big bottleneck if you use it wrong.
To verify the MAXDOP configured in the SQL Server instance run the following in a New Query window:
EXEC sp_configure 'show advanced options', 1;
GO
RECONFIGURE WITH OVERRIDE;
GO
EXEC sp_configure 'max degree of parallelism',
GO
RECONFIGURE WITH OVERRIDE;
GO
EXEC sp_configure 'show advanced options', 0;
GO
RECONFIGURE WITH OVERRIDE;
Can't help you more without seeing the query and the respective query plan.
ASKER
the script comes with an error:
Meldung 102, Ebene 15, Status 1, Zeile 1 - this is german sorry.
But it says ,ther eis an error near the comma (,)
Meldung 102, Ebene 15, Status 1, Zeile 1 - this is german sorry.
But it says ,ther eis an error near the comma (,)
It's right. Was a typo. Here the correct code without the extra comma:
EXEC sp_configure 'show advanced options', 1;
GO
RECONFIGURE WITH OVERRIDE;
GO
EXEC sp_configure 'max degree of parallelism'
GO
RECONFIGURE WITH OVERRIDE;
GO
EXEC sp_configure 'show advanced options', 0;
GO
RECONFIGURE WITH OVERRIDE;
ASKER
ok now it works.
But now all users are at home.
So it shows 0.
But now all users are at home.
So it shows 0.
ASKER
during the day I had a lot of locks.
What can I do against these locks ?
What can I do against these locks ?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
the queries are very long, which ones you need ?
ASKER
No one can't says a good value for a MAXDOP for a query only by looking to the code.
You need to provide the query plan and the server configuration (it's a VM or physical machine? Has hyperthreading on? How many CPU? How many cores?).
By the way, why do you think that query is the one that has bad performance?
You need to provide the query plan and the server configuration (it's a VM or physical machine? Has hyperthreading on? How many CPU? How many cores?).
By the way, why do you think that query is the one that has bad performance?
ASKER
This query was found with the performance dashboard.
The SQL Server is physical.
It has 2 CPUs and 8 Cores.
By the way there is an article from Microsoft about this MAXDOP.
They speak about processors less than 8 then put it in.
But do they really mean processors or cores ?
The SQL Server is physical.
It has 2 CPUs and 8 Cores.
By the way there is an article from Microsoft about this MAXDOP.
They speak about processors less than 8 then put it in.
But do they really mean processors or cores ?
They mean cores. But if your server has hyper threading then you need to count only half of the cores and if it's NUMA architecture then you should only count the cores for one CPU.
What you can do with that query in particular is to set MAXDOP=1 so the engine won't parallelize it.
What you can do with that query in particular is to set MAXDOP=1 so the engine won't parallelize it.
ASKER
when I have 8 cores, why not to set to 4 ?
And can you explain the threshold value of costs ? What is 50 ?
And can you explain the threshold value of costs ? What is 50 ?
when I have 8 cores, why not to set to 4 ?If it's a Quadcore NUMA architecture, then it's recommend to set the value to 4. If not, 8 it's the recommend value but since it's only a recommendation, you need to make tests to see if with 4 the performance is better.
And can you explain the threshold value of costs ? What is 50 ?Sorry, now you lost me. What you mean with this?
ASKER
How can I check if its NUMA on my server ?
ASKER
Sorry, now you lost me. What you mean with this?
Here I mean the costs of parallelism. This is also set to 5.
But can you explain this a little bit ? What is 5 ?
What the SQL is doing when a query comes and the costs are set to 5 ?
Means that it will parallelize the query to run in 5 cores at same time. If the server has 8 cores, five of them will be used to run the query and the others three cores will be available for other tasks.
ASKER
Is it not MAXDOP what you mean ?
Someone told me to put the costs to 50.
Someone told me to put the costs to 50.
Sorry, now I saw your question about the threshold. Where are you using it?
ASKER
The standard settings on my sql cluster are :
MAXDOP -> 0
Costs -> 5
But I get a lot of parallelism waits.
I have to change this.
My hardware is :
2 processors of INTEL XEON 5460 at 3.16 GHz
In total I see 8 CPUs in the task Manager.
MAXDOP -> 0
Costs -> 5
But I get a lot of parallelism waits.
I have to change this.
My hardware is :
2 processors of INTEL XEON 5460 at 3.16 GHz
In total I see 8 CPUs in the task Manager.
Try to change MAXDOP to 4. If you still having locks then reduce it to 1.
Can't see what's COSTS->5
Can't see what's COSTS->5
ASKER
Ok, when I understand the right way, I can choose MAXDOPS until 8.
But 1 is not logic, because this means just one CPU and then parallelism is off.
With MAXDOP=0 means they use default all processors and cores.
But 1 is not logic, because this means just one CPU and then parallelism is off.
With MAXDOP=0 means they use default all processors and cores.
ASKER
The costs are the field over the MAXDOP field : cost threshold for parallelism
This is set to 5 by default. This means 5 seconds.
This is set to 5 by default. This means 5 seconds.
ASKER
Do I have to reboot, when I change MAXDOP or THRESHOULD ?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
But I have to do something.
Always I have PARALLELISM WAITS, sometimes over 20 waits.
Always I have PARALLELISM WAITS, sometimes over 20 waits.
Did you try to run the query without the MAXDOP option?
ASKER
I cannot change anything in the query, because it comes from the application.
So MAXDOP is still default on my end = 0.
But I changed the THRESHOULD from 5 to 50.
So MAXDOP is still default on my end = 0.
But I changed the THRESHOULD from 5 to 50.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
What I want is -> no waits.
When the threshould was on 5 I had a lot of waits.
Now I have no waits anymore.
When the threshould was on 5 I had a lot of waits.
Now I have no waits anymore.
When the threshould was on 5 I had a lot of waits.Means that the engine isn't parallelize the query so it's the same as MAXDOP=1
Now I have no waits anymore.
Open in new window
Good luck.