An Unrivaled Windows Hosting Experience
1-888-313-9421  | webteam@orcsweb.com
  1. Does your SQL Server machine have enough RAM?

    Microsoft's SQL Server tends to lock up as much RAM on a server as possible. If you have 2GB of RAM, you'll notice it uses most of it. If you increase the RAM to 4GB, you'll notice it immediately starts to use most of the new RAM too. This is by design and due to SQL Server's goal of caching as much data (and SQL statements) as possible to minimize disk load and performance bottlenecks.

    How do you know if your SQL Server machine has enough RAM? Or if it would benefit from adding more RAM?

    Open Performance Monitor on the server and add the counter: SQLServer:Buffer Manager:Buffer Cache Hit Ratio.

    SQL Server Performance Counters for Memory (Cache)

    You really want the average to be as close to 100% as possible. If your numbers are tracking less than 95% you should consider adding more RAM to the server.

    A 100% cache hit ratio means that SQL Server is currently pulling 100% of the data requests from RAM rather than disk. Reading from RAM is always faster than reading from disk - even the new super-fast solid-state disk drives - so this is of course the preferred scenario. If you are getting 99%+ on your cache hit ratio counter, the server would likely not benefit from additional RAM right now. If performance gains are desired, you'd be better off looking at other areas (perhaps CPU or general query optimization).

     

     

    Wednesday, March 03 2010 by | 0 comment(s)
    Tagged as: , , , ,

  2. .Net 4's new IsNullOrWhiteSpace method

    .Net 4 (still in beta right now) has a handy new method that can analye a string and return where it is null or just whitespace versus other text. Here's a quick sample:

    ScratchPage.aspx

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="ScratchPage.aspx.cs" Inherits="ScratchPage" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:TextBox ID="textBox" runat="server"></asp:TextBox>
            <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
            <br />
            <asp:Label ID="Label1" runat="server"></asp:Label>
        </div>
        </form>
    </body>
    </html>

    ScratchPage.aspx.cs

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
     
    public partial class ScratchPage : System.Web.UI.Page
    {
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(textBox.Text))
            {
                Label1.Text = "The text box is null or has only white space.";
            }
            else
            {
                Label1.Text = "There is a non-null, non-white-space value in the text box";
            }
     
        }
    }

     

    Tuesday, February 23 2010 by | 0 comment(s)
    Tagged as: , , , ,

  3. How to enable .Net 3.5.1 on Windows Server 2008

    When Windows Server 2008 is installed and the IIS roles are enabled, it defaults to .Net 2.0.

    If you want to run .Net 3.5.1 on the server you might think the process is as easy as just downloading the bits from Microsoft and running the installation process. No, it isn't. It still isn't hard, but it can be frustrating for someone who isn't familiar with the required process.

    To enable .Net 3.5.1 on a Windows Server 2008 machine that already has the IIS role enabled...

    To get started, from within Server Manager you need to select Features in the left-hand tree and then Add Features in the right-hand pane.

    NOTE: I have the SMTP feature enabled on this test server but on your machine you likely won't see that listed.

    On the next screen select the ".Net Framework 3.5.1 Features" option from the list.

    As soon as you click that box, a pop-up window like the one below will be displayed.

    Clicking "Add Required Features" will then install the necessary dependencies and files required to support .Net 3.5.1 on the server.

     

    Wednesday, February 17 2010 by | 0 comment(s)
    Tagged as: , , , , ,

  4. Design Guidelines for Developing Class Libraries

    Someone pointed out my old-school VB naming conventions in a recent C# sample code post and provided some pointers and some suggested reading. I've named objects the same way for so long that I'm sure I'll struggle with the changes, but I took the pointers to heart and will work to adjust my naming conventions moving forward. I haven't read through the link provided yet, but figured I'd share it here (its from MSDN).

    He also mentioned that the comments button isn't currently working, which explains why comments have totally dropped off - someone here is looking into that issue to see why it broke and will hopefully have it working again shortly.

    Update: Here is another link I was just reading about Pascal Case and Camel Case use in C# programming:
    http://cplus.about.com/od/learnc/ss/csharpclasses_5.htm

     

    Wednesday, February 10 2010 by | 0 comment(s)
    Tagged as: , , , ,

  5. FREE eBook: .NET Performance Testing and Optimization

    Paul Glavich and Chris Farrell have written a book on performance testing and optimization for .Net and it's available as a free eBook download from the Red Gate website. The price cannot be beat - FREE! You should go check it out.

     

    Tuesday, February 09 2010 by | 0 comment(s)
    Tagged as: , , , ,