Quantcast
Channel: VMware Communities Syndication Feed
Viewing all articles
Browse latest Browse all 58

vCenter 4.x SQL DB: Defrag it!

$
0
0

 

My vCenter has been loading slow for as long as I can remember.   It finally got annoying enough to do something about.  "Certainly, they've made this better by now."

 

 

So I got a fresh drink, dug in, and starting searching for blog posts and articles on how to trick out vCenter performance, slow loading, etc.  I stumbled across this KB article from VMware titled:

 

 

Defragmenting VirtualCenter performance data indexes on a MS-SQL database

 

 

Overview of the KB:

 

 

Fragmentation of indexes occurs when the logical order of pages is different than the physical order on the disk. In VirtualCenter fragmentation occurs most noticeably due to the statistics collection and consolidation.    When the indexes are excessively fragmented, performance of queries to the VirtualCenter database is slow.

 

 

SWEET!  This could be it!   So I scrolled down to the bottom of the page for the section on VirtualCenter 4.x on SQL 2005, and ran the queries to check for fragmentation....

 

 

Use VirtualCenter

go

dbcc showcontig (VPX_HIST_STAT1)

dbcc showcontig (VPX_HIST_STAT2)

dbcc showcontig (VPX_HIST_STAT3)

dbcc showcontig (VPX_HIST_STAT4)

go

 

 

What it revealed was SHOCKING...

 

 

http://communities.vmware.com/servlet/JiveServlet/downloadImage/10738/vcenter.fragmentation1.jpg

 

 

Now, that's a lot of numbers, but look at the one's I've highlighted.  Per the KB article:

 

 

The key pieces of information to determine fragmentation are Scan Density and Logical Scan Fragmentation. In the example, scan density is 27.49%. In an ideal environment the closer this number is to 100% the better the database performs. For Logical Scan Fragmentation, the example shows 38.79%. The lower the percentage the better the system performs.

 

 

Holy crap!  My scan density was in the teens when it's supposed to be closer to 100%, and my fragmentation was 99% when it supposed to be closer to 0%!!!

 

 

Again, per the KB article, you can run the following optimization routines to "defrag" the indexes:

 

 

dbcc indexdefrag ('<database>', 'VPX_HIST_STAT1', 'PK_VPX_HIST_STAT1')

dbcc indexdefrag ('<database>', 'VPX_HIST_STAT2', 'PK_VPX_HIST_STAT2')

dbcc indexdefrag ('<database>', 'VPX_HIST_STAT3', 'PK_VPX_HIST_STAT3')

dbcc indexdefrag ('<database>', 'VPX_HIST_STAT4', 'PK_VPX_HIST_STAT4')

go

 

 

So off we went...

 

 

 

 

Crazy.  I had no idea this was going on in my database.  Maybe it's one of those set-it-and-forget-it things that typical admins don't pay that much attention to, because just about every mgmt app these days has a SQL DB backend requirement.

 

 

Here's what the numbers looked like after the defrag.  Only took ~5 minutes. Logical fragmentation went from 99% to 18%

 

 

 

 

While these aren't as good of results as I expected to see (notice some of the other tables are still 50% fragmented) I'm convinced that there are more methods to trick out vCenter so that it doesn't load so slow.  Every time I click on a different item in the column on the left, I want it to pop.  It's essentially a webpage.  It can be done.

 

 

I'm on a mission...

 

 

-Nick

 

 


Viewing all articles
Browse latest Browse all 58

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>