How can we help you today? How can we help you today?

Concerned about VHD file growth on clones

We started using SQL Clone exclusively for our lower environments and spec'd things out based off documentation provided by RedGate, discussions on various threads, etc...  We have seen a very large growth rate in the VHD file unfortunately and much greater than what we expected.  We are at a point now that the use of SQL Clone provides less value than what was sold to us initially.   Are there configurations or changes we can make overall to reduce the change rate in the VHD file to reduce overall disk consumption?
RandyBCD
0

Comments

5 comments

  • praveen_d
  • RandyBCD
    Unfortunately that link did not help, we don't have any maintenance plans running on this instance and have confirmed that.  We continue to see large VHD file growth where we see no benefit in using the SQL Clone product for any type of disk savings.
    RandyBCD
    0
  • owen.hall
    Hi Randy,

    As you'll know, clones are differencing disks, and will grow when something writes to their data files. The usual culprit is SQL Server, which makes its own decisions about what to write to attached data files, and when. That can make diagnosing these kinds of issues tricky.

    I've got a few diagnostic questions:
    • Do clones grow on their own if you don't write to them? (E.g. they're just created, with no modification template, and are left to sit there.)
    • Do clones grow on their own if they're made from images without any modifications?
    • If you've been seeing growth in clones based on an image from a live database, what about clones based on an image from a backup file? (Or vice versa if you've been making images from backup files?)
    • Do you have any clones that don't grow by themselves? Is there any pattern there?
    Thanks!

    Owen
    owen.hall
    0
  • John_Zabroski_wam
    The simplest way to diagnose this is to use DMVs and look at indexes with high write counts, since DMVs reset since last reboot or when the db was last created.  As long as you did not reboot between the time you created the clone, then the writes will lead you to exactly what you are doing to balloon the db size.
    John_Zabroski_wam
    0
  • johnzabroski

    To follow-up here, we've been experiencing this problem on our largest database. Anecdotally, the problem seems to occur once databases cross the 1 TB threshold.

    The other problem I see is that RedGate SQL Clone Agent does not log when the image is finished building, only when its creation started. In fact, for all my images, if I query the SqlClone_Config database directly, the State of the operation is 4 (Successful), but we don't know WHEN the Operation changed its state to Successful.

    SELECT * FROM dbo.Images i
        JOIN dbo.Operations o 
            ON i.Id = o.ImageId
    WHERE i.DeletedOn IS NULL

    Separately, if I reset a Clone, it starts off at 44.1 MB, then goes to 381 MB, then goes to 17.0 GB…. and then 38 GB… all without me doing anything? I can record a video of this happening.  I can also run SQL Profiler to demonstrate nothing is happening to the clone I reset.

    I also took my own suggestion to RandyBCD 6 years ago, and checked for index writes. There are none.

    johnzabroski
    0

Add comment

Please sign in to leave a comment.