An Unrivaled Windows Hosting Experience
1-888-313-9421  | webteam@orcsweb.com
  1. Partition Alignment

    Squeezing every ounce of performance out of your disk array is critical in IO intensive applications. Most times, this is simply an after-thought. However, doing a little leg-work during the implementation phase can go a long way to increasing the performance of your application. Aligning partitions is a great idea for SQL and virtualized environments - these are the places you will see the most benefit.

    The concept of aligning partitions is actually quite simple and applies to SAN's and really any disk array alike. If you are using RAID in any capacity, then aligning disk partitions will help increase performance. It is best illustrated by the following graphics, borrowed from http://www.vmware.com/pdf/esx3_partition_align.pdf (This is a great read, but specific to VMWare environments, however, the same concepts apply).

    Using unaligned partitions in a virtual environment, you can see that a read could ultimately result in 3 disks accesses to the underlying disk subsystem:

     

    By aligning partitions properly, that same read results in just 1 disk access:

    While these graphics are Virtual Machine and VMWare specific, the same is true for Hyper-V and SQL (except remove the middle layer for SQL). In order for partition alignment to work properly, you need to ensure that the lowest level of the disk sub-system has the highest segment size (also referred to as stripe size). Depending upon your RAID controller or SAN, this could default to as low as 4K or as high as 1024K. I won't cover what differences in segment sizes mean for performance, that's an entirely difference discussion, but generally speaking defaults are usually 64K or 128K. The basic idea behind a proper stripe size is that you want to size it so that most of your reads/writes can happen in 1 operation.

    From there, you need to ensure that your block or file allocation unit size is set properly - ideally smaller or the same size as the segment size and that it is a multiple of the segment size. Lastly, you should then set the offset to the same as the segment size. By default, Windows 2003 will offset by 31.5K, Windows 2008 by 1024K, and VMWare VMFS default's to 128.

    Setting the segment size may or may not be an online operation - that depends entirely on your RAID controller or SAN as to whether this can be done to an already configured array or if it has to be done during the initial configuration. Changing the offset and/or block size of a partition however is NOT an online operation. This means that all data will have to be removed from the partition, the offset configured, and the partition recreated. Prior to Windows 2008, this cannot be done to system partitions so for Windows 2003, you would have to attach the virtual hard disk to another system, set the offset and format the partition, and then perform the windows installation.

    The following links provide detailed information about aligning partitions in both VMWare and Windows. Consult your SAN or RAID controller documentation for setting or finding out the segment size.

    Recommendations for Aligning VMFS Partitions

    Disk Partition Alignment Best Practices for SQL Server

    Monday, September 14 2009 by | 0 comment(s)
    Tagged as: , , , , ,

  2. Five years ago I had my head in the clouds...

    Five years ago I had my head in the clouds and wrote a short introductory article about highly-available and highly-scalable hosting.

     http://www.orcsweb.com/articles/web_cluster.aspx

    Yes, in February of 2004 I was trying to help people understand and appreciate the benefit of cloud hosting. I didn't have the marketing powerhouse of Microsoft or Google, nor was the term "cloud" being used in the industry, but the technology was available and at ORCS Web we had already been supporting clients of various sizes on cloud platforms with great success.

    I continue to be a huge fan of cloud hosting and believe it deserves consideration from anyone who takes their web application hosting seriously. Success on the platform takes a lot more than just throwing a few servers online though so clients should be looking for a host with years of experience and proven successes. There is also more to hosting than just the infrastructure. Strong technical support and excellence in customer service are also key to successful hosting solutions so clients should read reviews and check references before entering into a hosting relationship.

    We'd love to help your web solutions be successful so let us know if you have any questions or if there is anything we can do for you.

    Happy hosting!

    Brad

     

     

    Sunday, February 01 2009 by | 0 comment(s)
    Tagged as: , , , , , , ,

  3. Dividision Within a SQL Statement With Decimal Results

    I was surprised to find that this SQL statement does not return .36 as I had expected:

    select 36/100 as ShowPercent

    From some online searching I found a post which commented that a decimal result from a division operation would not display properly if both of the values were integers. I have no idea why, but that does seem to be true. The change I made to get the correct result was:

    select 36/cast(100 as float) as ShowPercent

    ~Brad

    Tuesday, December 23 2008 by | 1 comment(s)
    Tagged as: , , , ,

  4. Access Report Viewer DLL Files for your Application

    If an application requires the use of Report Viewer Redistributable and needs access to specific .dlls for the application to run, you’ll find this post helpful, http://drowningintechnicaldebt.com/blogs/dennisbottjer/archive/2006/10/16/Hacking-Report-Viewer-Redistributable.aspx.

     

    It explains how to extract the necessary .dll files so you can reference them in your application and avoid GAC security errors (e.g., Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The module was expected to contain an assembly manifest.)

     

    I will outline the steps below to avoid another click. ;) I have also added links for the most recent versions of Report Viewer.

     

    1. Download Report Viewer Redistributable
      1. Report Viewer 2005 - http://www.microsoft.com/downloads/details.aspx?familyid=8a166cac-758d-45c8-b637-dd7726e61367&displaylang=en
      2. Report Viewer 2008 - http://www.microsoft.com/downloads/details.aspx?familyid=CC96C246-61E5-4D9E-BB5F-416D75A1B9EF&displaylang=en
      3. Report Viewer 2008 SP1 - http://www.microsoft.com/downloads/details.aspx?familyid=BB196D5D-76C2-4A0E-9458-267D22B6AAC6&displaylang=en
    2. Use favorite Zip Utility to extract the MSI.exe to a folder of your choice
    3. Find the file ReportV1.cab in extract folder from step #2
    4. Use favorite Zip Utility to extract ReportV1.cab to a folder of your choice
    5. Open the new folder from step 4 and find 4 files
    6. Rename: FL_Microsoft_ReportViewer_Common_dll_117718_____X86.3643236F_FC70_11D3_A536_0090278A1BB8 To Microsoft.ReportViewer.Common.dll
    7. Rename: FL_Microsoft_ReportViewer_ProcessingObject_125592_____X86.3643236F_FC70_11D3_A536_0090278A1BB8 To Microsoft.ReportViewer.ProcessingObjectModel.dll
    8. Rename: FL_Microsoft_ReportViewer_WebForms_dll_117720_____X86.3643236F_FC70_11D3_A536_0090278A1BB8 To Microsoft.ReportViewer.WebForms.dll
    9. Rename: FL_Microsoft_ReportViewer_WinForms_dll_117722_____X86.3643236F_FC70_11D3_A536_0090278A1BB8 To Microsoft.ReportViewer.WinForms.dll
    10. Copy these dlls to your smart client project and reference them
    11. Now they will be part of the Smart Client's Build Output and Click Once Deployment

     

    I hope this makes someone’s life a little easier!

    Tuesday, November 25 2008 by | 0 comment(s)
    Tagged as: , ,

  5. SQL Server 2008: Truncate Log While Maintaining the Database Recovery Model

    Hi,

     

    Here is a script that will truncate the database log while maintaining the database recovery model. 

     

    --Notes: Be sure to update the variable @sDbName to the
    --correct database name.

     

    DECLARE @sDbName VarChar(40)
    SET @sDbName = 'DB_Name' --Add database name here

     

    DECLARE @sDbRecovery varchar(40)
    DECLARE @sLogName varchar(40)
    DECLARE @sDBIsSimple_Shrink varchar(4000)
    DECLARE @sSetRecoverySimple varchar(4000)
    DECLARE @sShrinkDBLog varchar(4000)
    DECLARE @sReSetRecovery varchar(4000)
    DECLARE @sGetLogName varchar(4000)

     

    -- the @dbrecovery variable is set to the recovery
    -- model of the database

    Set @sDbRecovery = CAST(DATABASEPROPERTYEX(@sDbName, 'Recovery') AS varchar(40))

     

    -- this variable is used to get the logical log file
    -- name of the database
    set @sGetLogName =('USE ' + @sDbName + '
                      select name from sys.database_files where type = 1
                      ')

     

    -- a temporary table is created to hold the logical
    -- file name of the database and then sets the @LogName
    -- variable to that value. The table is then dropped.

    -- Drop the table if it exists
    IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ResultSet]') AND type in (N'U'))
    DROP TABLE [dbo].[ResultSet]

     

    -- create table and set the @LogName varable
    CREATE TABLE ResultSet (SetLogName VarChar(400))
    INSERT INTO ResultSet EXEC(@sGetLogName)
    SET @sLogName = (select SetLogName from ResultSet)
    Drop Table ResultSet

     

    -- the next set of statements truncate the log,
    -- but also ensures the recovery model of the
    -- database is maintained.
    IF @sDbRecovery = 'Simple'
          BEGIN
                set @sDBIsSimple_Shrink ='USE ' + @sDbName + '
                DBCC SHRINKFILE (' + @sLogName + ', 1)
                '
                EXEC(@sDBIsSimple_Shrink)
          END
    ELSE IF @sDbRecovery = 'BULK_LOGGED'
          BEGIN       

    -- Truncate the log by changing the
    -- database recovery model to SIMPLE.
                set @SsetRecoverySimple = 'ALTER DATABASE ' + @sDbName + '
              SET RECOVERY SIMPLE'
                EXEC (@sSetRecoverySimple)
                -- Shrink the truncated log file to 1 MB.
                set @sShrinkDBLog ='USE ' + @sDbName + '
                DBCC SHRINKFILE (' + @sLogName + ', 1)
                '
                EXEC(@sShrinkDBLog)
                -- Reset the database recovery model.
                set @sReSetRecovery = 'ALTER DATABASE ' + @sDbName + '
              SET RECOVERY BULK_LOGGED'
                EXEC (@sReSetRecovery)
          END
    ElSE
          BEGIN

    -- Truncate the log by changing the database
    -- recovery model to SIMPLE.
                set @sSetRecoverySimple = 'ALTER DATABASE ' + @sDbName + '
                SET RECOVERY SIMPLE'
                EXEC (@sSetRecoverySimple)
                -- Shrink the truncated log file to 1 MB.
                set @sShrinkDBLog ='USE ' + @sDbName + '
                DBCC SHRINKFILE (' + @sLogName + ', 1)
                '
                EXEC(@sShrinkDBLog)           
                -- Reset the database recovery model.
                set @sReSetRecovery = 'ALTER DATABASE ' + @sDbName + '
              SET RECOVERY FULL'
                EXEC (@sReSetRecovery)
          END

     

    Friday, October 31 2008 by | 0 comment(s)
    Tagged as: , ,