Saturday, 3 October 2009

Windows 7 Feature #3 – Small Memory Footprint

Windows Vista was a dog, but it never so obvious until it was compared side by side to Windows 7. Vista was slow and a memory hog. Microsoft has done lot of work on getting Windows 7 right and it was obvious right from the beta.

imageMy scenario is a common case. My main laptop, a ThinkPad T60, Core 2 Duo, 2gb, is fairly a fairly new computer in the Vista lifecycle.

On this computer, a fresh install of Windows Vista would use approx 1.5gb of RAM after booting up.

A fresh install of Windows 7 (beta) would only take 640mb. Huge Improvement, that can be seen in almost all aspects of computer use.

Friday, 2 October 2009

Setup PowerShell/.NET on Server Core

I had a bit of a whinge when Windows 2008 Server Core was released due to its lack of .NET support. Which also meant a server core couldn’t support ASP.NET or even PowerShell. Espically when you could run TOMCAT on server core.

Fast forward to 2008 (R2) :) and .NET is now supported.

After doing a basic install of Windows Server Core 2008 R2, you are presented with a command prompt, to install ASP.NET you can install using the following

dism /online /enable-feature /featurename:NetFx2-ServerCore /featurename:NetFx3-ServerCore /featurename:MicrosoftWindowsPowerShell /featurename:IIS-WebServerRole /featurename:IIS-WebServer /featurename:IIS-ASPNET /featurename:IIS-WebServerManagementTools /featurename:IIS-ManagementScriptingTools /featurename:IIS-ManagementService /featurename:IIS-IIS6ManagementCompatibility /featurename:IIS-Metabase /featurename:IIS-WMICompatibility /featurename:IIS-LegacyScripts /featurename:Microsoft-Windows-Web-Services-for-Management-IIS-Extension

To install PowerShell and .NET you need to run the following commands (they are case sensitive)

dism /online /enable-feature:NetFx2-ServerCore
dism /online /enable-feature:MicrosoftWindowsPowerShell

If you need 32bit support (because 2008 R2 is 64bit only) you need to add the following features

dism /online /enable-feature:NetFx2-ServerCore-WOW64
dism /online /enable-feature:MicrosoftWindowsPowerShell-WOW64

Don’t forget to install all the wonderful .NET features, such as LINQ and WCF

dism /online /enable-feature:NetFx3-ServerCore

I’ll do another post shortly on how to do remote access to your Server Core shortly, because you don’t really need a monitor connected to a command prompt anymore.

Windows 7 Feature #2 – UI Refresh

Lets get the easy bits over and done with quick. Windows 7 UI refresh is the most obvious feature users will notice. the 

imageThe new Task Bar stacks applications windows, this together cleans things up a lot, especially for me, where I’m know for having over 30 windows open at once. Hovering your mouse over the application icons preview window which is really good for finding *that* Internet Explorer tab you have lost.

image

Clean System Tray, I think every 2nd app in past 10 years had decided that putting itself in the system tray was a good idea. Printer/Wireless/Aircard status watches, IM client and even my Notepad program has tray icon. Which meant that the system tray usually was almost up to the start menu. Microsoft has cleaned the start menu, given *us* the user, control of the tray back… And it just works. :)

Start Menu, okay this came from Vista, but it doesn’t mean its bad. Searching for anything in the start menu is just awesome. Being able to press the Windows Key and type “Word” Enter. Is so much easier than trying to find Word in the in the XP Start menu.

imageThemes make customising Windows so easy. This basically brings all the UI customization features of XP/Vista into one nice screen while adding the ability to download or share themes with the social. One cool new feature of themes is the ability to have a slide show as your background, where Windows automatically cycles your background from a collection of images. The best part is that collection can be an RSS feed.

Aero Shake is a cool feature that I should mention, while dragging/moving a window Shake it from side to side to minimize all other windows. It doesn’t meant much until use it for the first time.

Other features in Windows 7 such as Aero Glass, Peek, Switch are nice additions, but they don't mean much to me as i don't really use them.

Wednesday, 30 September 2009

Windows 7 available this Month…

So I’ve been told that having a Windows 7 House party just isn’t cool. So to show my excitement for Windows 7 (which comes out in just 22 days) I’m going to blog (until its officially available) on the features that I think make Windows 7 so great. :)

Feature 1… Installation. (from USB)

The install process is so simple, boot, select install, name the pc, create a password, start using.

A clean install of Windows 7 from the DVD, installation takes about 30 mins. However if you boot from USB, it takes about 10 minutes. Okay so making the Windows 7 installation USB took a little longer than 20 minutes, although it’s a required step if your installing on a Netbook. I’ve installed Windows 7 about 5 times since it has been RTM’ed and I've definitely made back the time.

Upgrading from XP is not supported, I think this could possibly be feature #2. I never recommend upgrading your OS and forcing people do a clean (or partial clean) install will just lead to more stable systems (and a better reputation for Windows 7).

Monday, 28 September 2009

Windows Workflow in .NET 3.5

In .NET 3.0, Microsoft introduced Windows Workflow Foundations (WF); providing a framework for developing and executing workflows in .NET applications. WF consists of workflow designer tools (visual studio & others), predefined activities (tasks), a rules engine, the workflow runtime (workflow engine) and auxiliary services (e.g. transactions, persistence and tracking services).

 

Types of Workflows

WF provides two types of workflows for different scenarios, Sequential and State Machine. image

Sequential workflows are best suited for tasks where this is clear process that can be defined; such as delivering a package to a customer. Sequential workflows have defined path of activities that is followed from top to bottom. Once a sequential workflow has started, the workflow remains in control, moving between itself between the tasks of the workflow.

State machines are best suited for more complex business processes where the process can move randomly between defined states; for example a DVD player, which can be in one of a possible many different states, such as Playing DVD, DVD Menu, Tray Open, No Disc. Unlike sequential workflows, state machine workflows do not have a defined path, rather a set of states and transitions between states. State machines are event driven and rely on external events to transition the workflow between states.

 

Activities

Workflow activities are the building blocks of workflows. These building blocks are put together in the Workflow designer, to create a workflow model. Each workflow activity is a standalone component which, within the scope of the workflow, can perform an action, control the flow (of the workflow), communicate (external of the workflow), check conditions or handle errors.

Microsoft has provided a collection of activities with Windows Foundation. Some of the basic activities you should familiarise yourself with are; CodeActivity, WhileActivity, IfElseActivity, DelayActivity.

 

Custom Activities

Although Microsoft has included a large selection of activities within Windows Workflow, the need will arise where you will need to develop your own custom activities. Anything you can do in custom code can be created presented as a custom workflow activity. A benefit of using custom activities is that the Analyst using the custom activity doesn’t need to understand the internal workings of your activity, just that they drag where they need it and wire up the properties.

Your custom activity will inherit from the either of the following base classes SequenceActivity or Activity from the System.Workflow.ComponentModel namespace. Using a Sequence Activity you can use the drag and drop designer of the Workflow designer using CodeActivities to add custom code. The Activity class requires that you implement your custom code by overriding the ActivityExecutionStatus method.

Activity Properties are used to pass parameters into your custom activity. It is recommended that you use a Dependency Property which allows other activities to bind to your properties. Visual Studio 2008 implements a propdp code snippet to allow easy implementation of Dependency Properties.

 

Workflow Runtime

The workflow runtime is responsible for executing the workflow models. Like the WCF runtime, the Workflow runtime can be run in any type of host application and runs in a separate thread.

The runtime engine is indifferent to the workflows that it is executing, meaning that same workflow engine will execute many different workflows such as CarOrder or MakeCar workflows.

The following piece of code loads the workflow runtime in a console application. The code also creates an instance of a Workflow and waits for the workflow to complete. As the runtime runs in a different thread to the application, this code uses a waitHandle (AutoResetEvent, lines 5, 6 & 11) to stop the console application closing before the completion of (one) workflow instance.

image

Parameters can be provided to your workflow when creating the workflow instance. First you must create the parameters as Properties within your workflow class. The CreateWorkflow() method can take a Dictionary object containing the parameters you require.

 

Communicating with the workflow.

You will notice in the runtime code above, on line 8, the new workflow instance (in this case CarOrder) is created by the Runtime. The workflow instance is created and excuted within the Workflow Runtime, to be able to communicate between the host application and the running workflow, you must use the CallExternalMethod and HandleExternalEvent activities within your workflow.

The activities use a Interface with ExternalDataExchange attributed to communicate through. Any method listed on the interface can be called from CallExternalMethod activities with method parameters being provided via using the properties window of the activity (Illustrated to the right). The HandleExternalEvent activitys will respond to events on an interface that have an Event Argument type derived from ExternalDataEventArgs.

An implementation of your communications Interface is required to provide the gateway between your host application and the Windows Workflow instances. To accomplish this, you assign a ExternalDataExchangeService (part of WF), to the WorkflowRuntime, and then assign your communications implementation as a service to the ExternalDataExchangeService.

image

 

Persistence

One of the benefits of WF is the ability to handle long running business processes out of the box. WF provides the ability to persist your workflows to a store using the extendable WorkflowPersistenceService class. An SQL server based implementation of the WorkflowPersistenceService, SqlWorkflowPersistenceService is provided by WF.

Another benefit of adding persistence to the runtime is the ability to scale. If your application is dealing with many workflow instances, the runtime must maintain memory for each instance. By using persistence services, the runtime can unload a data store to free up memory

Thursday, 13 August 2009

Where default Settings are not set to scale…

I was reading about the a new feature in Windows Communication Foundation (WCF) 4.0 on the following blog. The feature in question is a change to the default throttling settings, where the original WCF settings where set statically, and extremely conservative.

For example, here are the default settings in 3.0:

  • MaxConcurrentSessions (default: 10)
  • MaxConcurrentCalls (default: 16)
  • MaxConcurrentInstances (default: 26)

In my infrastructure role, when I hear about performance issues, it an application owner blaming the hardware. I often hear comments like “We need more CPUs”. “We need more memory”. “We need more servers”. “Virtual Servers are SH#T, I want a physical”.

Only problem (in WCF 3), without changing the above settings, throwing more hardware at the problem won’t improve anything. WCF 4 fixes this issue by making the settings a multipliers of the CPU count (and less conservative).

I’m wondering…

  • How many other infrastructure components (WCF, TomCat, PHP, IIS, Apache) are built with default conservative settings that don't scale or are conservative?
  • How well these settings are documented?
  • How are recommended settings communicated from app developer, implementer and business app owner during life cycle of dependant applications?

Automated IT

I twitted about going to the HP Software users group the other day, hoping it would be of value. I wasn’t disappointed.

One idea I've been throwing about in my head for ages; is a free (to me because i would write it) IT monitoring system. Similar to Nagios, but running on Windows (because I love .NET). However it would have a powerful workflow engine behind it so when an internet connection goes down, it wouldn't just send me a TXT, but log a call with the ISP, add it to the internal Case management system and close the case when “Telstra” do their magic.. Or similarly automatically build a new VM when a server becomes overloaded, shut them down when they are no longer required.

It would appear that amongst HP’s portfolio of software, they have this stuff already. They integrate into everything, detect a new Windows server on the network, install/configure monitoring agents automatically. When the server throws a low disk alert, automatically connect to the SAN and allocate more disk space and then alert service desk, there was a disk space issue, but I've dealt with it…

Only problem, we’re not using it.. and its not Free.. (also, i didn't write it.. :( )

True Cost of BPOS

I’ve been playing with Microsoft Online Business Productivity Online Suite for the past 3 months now.. Playing is definitely not the right word; in comparison to Lotus Notes, I've been “Productive”. :) “It just works.”

For those of you who don’t know what BPOS is.. BPOS is a Cloud hosted version of Microsoft Exchange, SharePoint, Office Communication Server (instant messaging) and Live Meeting (MS WebEX competitor).

The next challenge is find out if BPOS was really the right solution.

Microsoft quote on their website that the complete BPOS solution is $15 a user per month. However there are some things you still need to consider.

  • Internet Bandwidth increase (in Australia, per MB download rates are relatively high) – as the service is in the Cloud, you are not paying just to receive emails from the internet, your bandwidth is used for internal emails as well. (Although this is still very quick)
  • Level 1 Helpdesk – Microsoft only supply level 2 & 3, web/phone support, so you still nee somebody to do the level 1 monkey work. “Did you turn it off and on again, yet?”, “The power button is the big one in the middle.”
  • Migration Costs – Microsoft offer some free tools to do the migration, so if you are on a supported platform these may be low. If your not, or if you need to get a partner to help, these costs should be added to a per user calculation. (If you can try and spread these costs out over a larger period say 36 months)
  • Archiving – If your in a regulated sector, you may be required to have legal archiving. (Microsoft Offer this at an extra cost)
  • Excess Storage – for when a user goes over their mailbox limit, although this is relatively easy to bill back to the abuses users Business Unit (if your company allows that)

In my calculations these costs added approx another $5 per user.

To understand the finical benefit of BPOS, try and get a baseline of your current email environment determine the monthly cost for the following items (these should be similar for most companies.)

  • Software
    • OS Software
    • Email Software
    • Gateway Protection (Anti Virus/Spam)
  • Server Hardware - try to work out a monthly cost over the life time of the hardware – either leased or deprecated
  • Storage Hardware – (include the continued risk as email capacities increase)
  • Backup – Hardware / Media / Software / Monkeys.. Operators

(The next items are monthly staff costs if you are not outsourced IT shop)

  • Monthly Mailbox Management cost (per user?)
  • Monthly Server Management cost (per server?)
  • Monthly Storage Management cost (per TB?)
  • Monthly Service Desk cost (people who answer the phone :) )

Add all these costs up and divide by the number of users on the system to get a baseline per user $ figure.

I’m not sure what an industry standard is for a Per Mailbox Per Month fee (if somebody know, please fill me in), but most calculations I’ve done, its been less than $30.

The REAL benefit of BPOS (especially the way the economy is these days) is the ability to scale up or down but keep the same per mailbox per month fee. Consider the following for an in house solution, (where they budget per user).

  • A company has 1000 employees and it’s fixed costs (servers, storage, gateway, etc) are $15000 per month – which works out the per user cost is $15.
  • If the company grows to 1200 users, the per user cost goes from $15 to $12.50pm. (should your system be able to scale)
  • If the company downsizes to just 800 people, the per user cost will increase to $18.75pm

BPOS on the other hand, stays the same no matter the number of users on the system. (its Microsoft’s problem, not yours).

I hope this helps in determining if BPOS is of benefit to you.