Blog

The official blog of managed hosting provider OrcsWeb.

Auto-Format VS2010 Source Code

This nifty trick has apparently existed since at least VS2005 but I just learned it, and it is super-handy, so I'll share...

When in source code view of a page you can press control-K then control-D and the code will auto clean-up and format with standard indenting and nesting.

Being able to crank through code without much concern to the visual aesthetics and then auto-format it later is a huge time saver for me. Hopefully this tip helps you too.

Happy hosting!

Fun with PowerShell: Add ToolTips to a Windows Form

While working on a new scripting project I came across a need to add a tool tip to a button.  As all good scripters do I started by searching the internet to see is anyone had done the work for me; alas, the only person I found who had successfully added a ToolTip to a PowerShell form had cheated by using Visual Studio - I didn't even know Visual Studio had PowerShell editing capabilities - so off I went in search of a method of adding ToolTips to PowerShell.

http://msdn.microsoft.com/en-us/library/system.windows.forms.tooltip.aspx

ToolTip is the .NET term for those little informational balloons that pop-up when you hover the mouse over a button or icon or whatever.  They are used in far more than Windows Forms, but for the purposes of this article we'll stick to forms.  There are two kinds of ToolTip popup, a balloon and an OS default.

Read more...

High CPU on Cisco 4500 with MSFT NLB multicast cluster

Recently, we were alerted to higher than normal CPU on some of our core Cisco Catalyst 4507 switches running IOS 12.2. Using Cisco's CPU troubleshooting doc, I was able to narrow down the source to the Cat4K Mgmt LoPri process. From there, issuing a "sh platform health" command found it was the K2CpuMan Review process meaning packets are being forward by the CPU. To find out which queue, we issued the "sh platform cpu packet statistics" command. That showed the L3 Fwd Queue was much higher than normal.

By creating a CPU span and monitoring the traffic with Network Monitor 3.3, we could see that all of the traffic destined for VIP's in our 2008 NLB clusters was hitting the CPU. I checked the configuration to ensure it matched the Catalyst and MSFT NLB example on Cisco's site which it did. We were using multicast NLB configuration as explained in the document. I setup a test NLB cluster to play with the settings to figure out why cluster bound packets were hitting the CPU. What I found was in relation to this section:

However, since the incoming packets have a unicast destination IP address and multicast destination MAC the Cisco device ignores this entry and process-switches each cluster-bound packets. In order to avoid this process switching, insert a static mac-address-table entry as given below in order to switch cluster-bound packets in hardware.

mac-address-table static 0300.5e11.1111 vlan 200 interface fa2/3 fa2/4

Note: For Cisco Catalyst 6000/6500 series switches, you must add the disable-snopping parameter. For example:

mac-address-table static 0300.5e11.1111 vlan 200 interface fa2/3 fa2/4 disable-snooping

The disable-snooping parameter is essential and applicable only for Cisco Catalyst 6000/6500 series switches. Without this statement, the behavior is not affected.

I double and triple checked that our switches had the satic mac entry for the CAM tables and they did. So, I reconfigured my test cluster from the ground up and found that cluster bound packets only hit the cpu AFTER this command was entered. By removing this command from my switches for our production, CPU dropped 30-40% instantly. This seems to contradict what Cisco has posted in their example.

There was no adverse affect or downtime from removing this command. Both cluster nodes are connected locally to the switch however, and this command may be necessary if a NLB node is connected to a down-level swtich. Furthermore, a "sh int stats" is showing that no packets are switched by the "processor."

Cloud Servers Provide Greener Hosting

"Green Hosting" seems to have a variety of definitions that sometimes include using renewable energy sources but in general means being more environmentally friendly.

Cloud Servers have higher densities and better utilization of server resources - so much less overall waste. This translates to a much greener hosting model than standard physical dedicated server models.

Here are three reasons Cloud Servers equate to Greener Hosting:

Read more...

Hello web, meet the free video codec!

Today, May 19th, may just be a historic day.  Not in the same way the printing press, the steam engine or VE-day were, but in a more geeky, technology way.  In fact, you probably won’t even see this story on CNN or MSNBC.  You may not have even known this event happened today unless you frequent sites like Slashdot, TechCrunch or Digg.  What is this big news?  The WebM project, a royalty-free, open source video codec released today by Google.

You see, there is this thing called a patent… we all know what patents are so I’ll skip a bit.  Patents make the business world go round.  They are good for profits and jobs, bad for small businesses and hobbyists who can’t afford to pay royalties and licensing fees which affect a large chunk of the Internet.  One of the heaviest patented software applications are video codecs, and while the Internet has been relatively royalty free when video comes into play it won’t stay that way forever.

Read more...

IIS7 Redirects

IIS7 Redirects

There is often a need to redirect a domain name to another URL and there are a few ways to accomplish this.  One of the cleanest and simplest ways make this happen in IIS7 is to use a HTTP Redirect.  First you set up a site in IIS7 with the proper bindings to ensure only traffic that you want redirected will be served by this site and then configure a HTTP Redirect.   

On a side note, if you are looking to redirect more than just a domain name and need granular control over the redirect I suggest that you look at the URL Rewrite Module, http://www.iis.net/download/URLRewrite.  We have this module available on all of our IIS7 servers here at OrcsWeb.

Heading back to the discussion on HTTP Redirects, below is a screenshot of the HTTP Redirect screen that comes up when you choose that option in IIS.

What follows is a summary of the options on the screenshot.  You should note that IIS7 has a comprehensive online help where you can get additional information.

If you check the first box under Redirect Behavior, it will force all requests to redirect to the exact destination entered in the top box.  If you don’t check that box then requests will be relative to the destination entered.  For example, if you were redirecting http://www.orcsweb.com and the incoming request was http://www.orcsweb.com/service, based on the redirect entered above, requests would be redirected to http://test.orcsweb.com/testing with the box checked.  Without the box checked then requests would be redirected to http://test.orcsweb.com/testing/service.

If you check the second box under Redirect Behavior, it will redirect requests only to the subdirectory that you specified in the redirect destination.  For example, with the second box checked in the screenshot above, redirects would only be served from the /testing directory.

The status code drop-down box allows you to set one of three options: 

  • Found (302) – This will cause the web browser to issue a new request to the redirect destination.
  • Permanent(301) – This tells the web browser that the resource it requested has permanently changed to the redirect destination.  This is what you will want to select if you need to preserve your search engine ranking and the URL is changing permanently.
  • Temporary (307) – This prevents the browser from losing data when a HTTP POST request is issued and is a new option in IIS7.

The biggest reason I am writing this blog post is to mention the one caveat that I have run into when using a HTTP Redirect in IIS7.  There appears to be some dependency on the physical path set in the advanced settings of the site.  I know that sounds crazy but I have run into it a few times.  Here is a scenario to explain this further. 

Someone has more than one domain name pointing to a single website.  Down the road they need one or more of those domain names to redirect somewhere else.  The most convenient thing to do is set up a new site with the intention of using a HTTP Redirect once the site is setup.  For consistency’s sake you point that other site to the same location as the original site.  As soon as you setup the redirect it will set the redirect for every single site that is pointed to that same physical path in IIS.  The way to get around it is to set each site to point to a different location.

Tagged as: ,

Site Statistics - Free Enterprise Class Analytics

Here at OrcsWeb we've used many different types of site statistics solutions over the years. Each one has pros and cons. The list of cons grows large, and heavily weighted, when the website being tracked generates more than a minimal level of traffic. Very few of the server packages available scale well to handle sites whose traffic is measured in the millions of daily requests like some of the sites we manage.

Read more...

WCF RIA Services Hosting at OrcsWeb

WCF RIA Services were released today and I'm pleased to announce that we have the assemblies installed and supported on all of our shared hosting servers. Clients with managed Cloud Servers or managed Dedicated Servers can request installation and their support team will take care of it for you.

Happy hosting!

Box Selection and Multi-Line Editing with VS 2010

Here's a neat post by Scott Guthrie about Box Selection and Multi-Line Editing with Visual Studio 2010.

Additionally, you might want to check Scott's blog often for great tips, tricks, and announcements about ASP.Net, Visual Studio, and all things development related.

Determine All SQL Server Table Sizes

Here is a helpful post that Steve Smith wrote lately about determining the size of the SQL Server tables within your database.

David Penton also has some sample SQL code posted online to basically do the same thing with slightly different formatting results.