Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

High value of work files and Work table Expand / Collapse
Author
Message
Posted Monday, August 18, 2014 11:07 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, December 4, 2014 9:08 PM
Points: 136, Visits: 328
Hi All,

I monitor my sql server 2008 performance via Solarwind and I got a high number of work files and Worktable ...( worktable is created 865/sec )...

I wonder What should I do to lower the value down ?

Post #1604745
Posted Tuesday, August 19, 2014 2:23 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 8:20 AM
Points: 40,630, Visits: 37,093
Firstly, is that value a problem? Is it higher than usual? Is it causing problems?


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1604789
Posted Tuesday, August 19, 2014 5:43 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, December 4, 2014 9:08 PM
Points: 136, Visits: 328
GilaMonster (8/19/2014)
Firstly, is that value a problem? Is it higher than usual? Is it causing problems?


Thanks for your response! appreciate it !

Yes I use SOLARWIND to monitor SQL Performance and It shows that Workfiles Created/Sec and Worktables created /sec are in CRITICAL status.

There is some information from SOLARWIND aboout workfiles :

"Work files could be used to store temporary results for hash joins and hash aggregates. The returned value should be less than 20. Tempdb work files are used in processing hash operations when the amount of data being processed is too large to fit into the available memory."

Possible problems: High values can indicate thrash in the tempdb file as well as poorly coded queries.

and This is some information from SOLARWIND aboout worktables (at the moment, the value is : 739/sec)

"Work tables could be used to store temporary results for query spool, lob variables, XML variables, and cursors. The returned value should be less than 20. Worktables are used for queries that use various spools (table spool, index spool, and so on."

Possible problems: High values could cause general slowdown.

I wonder what should I do ?
Post #1605247
Posted Tuesday, August 19, 2014 8:41 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 6:23 AM
Points: 35,772, Visits: 32,445
WhiteLotus (8/19/2014)
GilaMonster (8/19/2014)
Firstly, is that value a problem? Is it higher than usual? Is it causing problems?


Thanks for your response! appreciate it !

Yes I use SOLARWIND to monitor SQL Performance and It shows that Workfiles Created/Sec and Worktables created /sec are in CRITICAL status.

There is some information from SOLARWIND aboout workfiles :

"Work files could be used to store temporary results for hash joins and hash aggregates. The returned value should be less than 20. Tempdb work files are used in processing hash operations when the amount of data being processed is too large to fit into the available memory."

Possible problems: High values can indicate thrash in the tempdb file as well as poorly coded queries.

and This is some information from SOLARWIND aboout worktables (at the moment, the value is : 739/sec)

"Work tables could be used to store temporary results for query spool, lob variables, XML variables, and cursors. The returned value should be less than 20. Worktables are used for queries that use various spools (table spool, index spool, and so on."

Possible problems: High values could cause general slowdown.

I wonder what should I do ?


Start looking for "crap code" and fix it.

To be honest, though, if you have a lot of batch jobs or reporting requests on a busy machine, 20 seems like a low number especially in this day and age with all the bloody XML flying around.

I'd still check for performance challenged code, though.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1605265
Posted Sunday, August 24, 2014 7:11 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, December 4, 2014 9:08 PM
Points: 136, Visits: 328
Jeff Moden (8/19/2014)
WhiteLotus (8/19/2014)
GilaMonster (8/19/2014)
Firstly, is that value a problem? Is it higher than usual? Is it causing problems?


Thanks for your response! appreciate it !

Yes I use SOLARWIND to monitor SQL Performance and It shows that Workfiles Created/Sec and Worktables created /sec are in CRITICAL status.

There is some information from SOLARWIND aboout workfiles :

"Work files could be used to store temporary results for hash joins and hash aggregates. The returned value should be less than 20. Tempdb work files are used in processing hash operations when the amount of data being processed is too large to fit into the available memory."

Possible problems: High values can indicate thrash in the tempdb file as well as poorly coded queries.

and This is some information from SOLARWIND aboout worktables (at the moment, the value is : 739/sec)

"Work tables could be used to store temporary results for query spool, lob variables, XML variables, and cursors. The returned value should be less than 20. Worktables are used for queries that use various spools (table spool, index spool, and so on."

Possible problems: High values could cause general slowdown.

I wonder what should I do ?


Start looking for "crap code" and fix it.

To be honest, though, if you have a lot of batch jobs or reporting requests on a busy machine, 20 seems like a low number especially in this day and age with all the bloody XML flying around.

I'd still check for performance challenged code, though.


Hi jeff,

Thanks!

How do I know which query or StoreProc that has crap code because there are hundreds of StoreProc?

Post #1606940
Posted Monday, August 25, 2014 1:01 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 8:20 AM
Points: 40,630, Visits: 37,093
WhiteLotus (8/24/2014)
How do I know which query or StoreProc that has crap code because there are hundreds of StoreProc?


You don't.

This is one of the flaws at looking at just perfmon counters. Sure, work tables are 'high', but you haven't said if they're higher than normal or if they're causing problems (don't use the tools blindly).
Performance analysis is never about one counter. There's no one counter or value that tells you everything. It's about looking at the whole system, perfmon counters, wait stats, query execution statistics and drawing conclusions from all of them together.

The perfmon counters, with very few exceptions don't have good or bad thresholds. They have 'normal' and 'not normal' for your server. The wait stats tell you what, in general, SQL is spending time waiting for during query executions and the query stats tell you which are your most resource-intensive queries overall.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1606971
Posted Monday, August 25, 2014 1:14 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 8:39 AM
Points: 2,533, Visits: 7,113
WhiteLotus (8/19/2014)

Yes I use SOLARWIND to monitor SQL Performance and It shows that Workfiles Created/Sec and Worktables created /sec are in CRITICAL status.


I guess the threshold is a configured value within SOLARWIND and my suspicion is that hasn't been specifically set for your environment. This "high" number of Workfiles may be normal depending on the activity, not necessarily a result of crap code either.
Post #1606974
Posted Monday, August 25, 2014 9:49 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, December 4, 2014 9:08 PM
Points: 136, Visits: 328
Eirikur Eiriksson (8/25/2014)
WhiteLotus (8/19/2014)

Yes I use SOLARWIND to monitor SQL Performance and It shows that Workfiles Created/Sec and Worktables created /sec are in CRITICAL status.


I guess the threshold is a configured value within SOLARWIND and my suspicion is that hasn't been specifically set for your environment. This "high" number of Workfiles may be normal depending on the activity, not necessarily a result of crap code either.


Hmm I believe that it has been set in my environment ... cause when i check the fragmentation of indexes it is identical ....
Moreover It also show the high number of pagesplit and page write ... I hv configured the fill factor in some indexes that get fragmented quickly but it seems the number of pagesplit is still high ..from 12 am -5 am it is relatively slow ( around 20/sec) but it becomes so high at 7 pm - now (around 90/sec)

I wonder how to lower it down .... Any idea ?

Thankss
Post #1607321
Posted Tuesday, August 26, 2014 12:58 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 8:20 AM
Points: 40,630, Visits: 37,093
I will repeat what I said earlier

GilaMonster (8/25/2014)
This is one of the flaws at looking at just perfmon counters. Sure, work tables are 'high', but you haven't said if they're higher than normal or if they're causing problems (don't use the tools blindly).
Performance analysis is never about one counter. There's no one counter or value that tells you everything. It's about looking at the whole system, perfmon counters, wait stats, query execution statistics and drawing conclusions from all of them together.

The perfmon counters, with very few exceptions don't have good or bad thresholds. They have 'normal' and 'not normal' for your server. The wait stats tell you what, in general, SQL is spending time waiting for during query executions and the query stats tell you which are your most resource-intensive queries overall.


Page splits/sec are NOT just the mid-index splits which cause fragmentation. As for how to reduce both it and the page writes/sec, maybe ask the users not to use the system?

Yes, that was a silly suggestion, but it'll do what you want (reduce the counter values).

Stop looking at individual counter values with a desire to reduce them (you can reduce them by decreasing the workload, but that would be counterproductive). Look at the overall server health. Look for changes (high not, wasn't high last week), look for things which are causing problems and fix those.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1607349
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse