Big Picture
The bottom line when working with busy people is to preempt as much of the mental overhead of working with you as possible; all it really takes is some brevity and thoughtfulness on your part. If you form the eight behaviors I list below (and others I may be forgetting) into habits, you'll be much easier to work with and you'll get better results.
Define "Busy"
One of the transformational things my job at Microsoft has done for me is help me appreciate what it is like to be extremely busy and how hard it can be to work with other extremely busy people.
“Busy-ness” isn’t a measure of how much time someone spends working, although there’s typically a strong correlation; it’s really a measure of the total amount of concern a particular individual has to manage at any point in time. The busier you are, the greater the concern you are managing.
Each task / person / problem / thing you have to manage at any given time carries a non-zero amount mental and emotional overhead – dates, consequences, pressures, stakeholders, key facts and figures, costs, opportunities, sentiments, and so forth. All of this takes effort to remember, recall, manage, and act upon.
A person who has to manage 1,000 small things is extremely busy; a person who has had a parent or close relatively die recently is extremely busy. The number of items isn't what matters - it's the total sum of the mental and emotional overhead that drives busy-ness.
When you’re trying to do business with extremely busy people, you are effectively adding more stuff onto their already full plate. In order to effectively communicate and do business with them, you need to minimize the overhead of whatever it is you need said busy person to do for you.
So here are some ways you can make it easy for busy people to get back to you:
1. Always be the one to propose possible times for phone calls or meetings, and include more than one option.
When I ask to meet with the managing director of an accelerator or the CTO of an interesting startup (busy people,) I always end my emails with a sentence that reads something like this “do you have time for a quick phone call any time after 3:00pm on Tuesday or Wednesday?”
The effect here is subtle: what you do by proposing times yourself is you give the busy person the ability to focus on a small range of possible times, and the likelihood of getting a response back in-turn is drastically higher than if you left the scheduling completely open. The proposed times will either work for the busy person or they won’t, and they can give you a simple yes/no answer in return.
If you leave the scheduling for an appointment totally wide open, you are essentially forcing the busy person to do a scan of their entire calendar over the next couple of weeks and force them to find a time. This is overhead – busy people hate overhead, and they may defer responding to you indefinitely.
All of the other techniques I described here are derivatives of the following rule:
Everyone likes being responsive, even the extremely busy. When you the decrease need for busy people to think when considering any business opportunity or engagement you might have, you increase the likelihood that they will get back to you.
2. Keep it brief.
If you want to do business with the extremely busy, make certain that they can understand what it is you want to do in a matter of seconds – not minutes. If find yourself writing War and Peace emails, then you have failed.
Save your stories and background for when you talk in-person or over the phone – keep any requests you have in writing short and specific. One sentence for who you are and what you do. One sentence for what you need. One sentence for the value you can offer the busy person in return. One question on how to take the next steps. Done.
Anything beyond that and you’re using the wrong communication medium.
An even better technique than the Three Sentence Rule for emails is the EOM rule, where you fit the entire body (super short, obviously) of your email into the subject line and terminate it with [EOM] for “end of message.”
If you use the EOM rule, then busy people will read your entire message whether they want to or not given that they can see the entire body of the message in the subject line when they glance over their inbox.
3. Have a specific idea for what it is you want to do; articulate it clearly.
So let’s say you do a good job and manage to get a meeting with a busy person – what then? You should always have an objective for whatever it is you want from them, and you should make that objective as specific as possible.
The more specific your demands are of a busy person’s time, the less overhead for them (usually.)
When I meet with someone who asks me if I can get help their startup get started with a Windows Phone 7 version of their application, then that’s reasonably easy – if they ask me how to solve a specific engineering or design problem that they’ve run into, then that’s even easier.
The amount of information I have to extract from the requestor in order to actually help them is drastically smaller in the latter example and thus I can move from words to action much more quickly.
Contrast this with some meetings I’ve had where the people who requested the meeting open with “how can you help me?” There are hundreds of different ways I can answer that question, but since the meeting requestor hasn’t provided me with any context as to what’s important to them I’m going to do what any other busy person would do and go down the path of least resistance.
That path does not always lead to the results that either party wants, so make the path of least resistance the one that leads to you walking away with your goals met by eliminating the busy person’s need to craft your engagement plan for you.
4. Always include the contact information or address of meeting place in the calendar appointment (and start using calendar appointments if you aren't already.)
This is a no-brainer. If you have scheduled a meeting with a busy person, do one of the following:
- Specify who is calling whom and at what phone number;
- Specify a bridge line if it’s a conference call; or
- Specify the actual address of the place you’re meeting for in-person meetings.
If a busy person can’t figure out how they’re supposed to contact you or meet with you, they might just push or not show up. Make it clear for everyone and take the extra 2 seconds to add a little specificity to the meeting request.
5. Always include your contact information in your email signature.
Particularly important if you are doing in-person meetings – stuff comes up and people might run late or might get lost, in which case they need to be able to get back to you.
Always include a phone number where you can be reached in your email signature so they can contact you in the event that something goes wrong and they run late or need help finding you. If they haven’t had time to save your contact information, they can at least quickly look up your last email conversation and grab your contact information that way.
6. Do not, under any circumstances, go “favor-shopping.”
A surefire way to never hear from a busy person ever again is to shop them for favors. This happens when one person tries to extract as much value out of a busy person’s time as possible by stuffing the meeting full of requests for different and often unrelated favors.
I had a meeting where a person presented me with four unrelated projects and asked how I could help with each; I ultimately decided not to help with any of them, because it was clear that this person did not care what my interests were. It was all about their projects, not about building a mutual business relationship.
When you go favor shopping, you’re not offering any value in return – you’re openly using the other person and being a parasite in the process.
Favors don't come at a volume discount.
7. Be appropriately persistent.
Follow-up is good; busy people let stuff slide and can easily forget. Finding a way to stay on someone’s radar appropriately is necessary and good.
However, asking for read receipts for every single email you send is obnoxious and busy people will simply delete your messages.
In contrast, following up after 2-3 business days with a simple “just wanted to double check to see if you’re still available for lunch on these dates” is fine under most circumstances.
Here are my rules of thumb:
- Time-sensitive business emails: 2-3 days for people I don’t know, 1 day for people I do. Obviously this varies depending on just how time sensitive the matter is.
- Important but not urgent business emails: 1 business week.
- Anything else: why are you bothering this person?
Email is often a crappy medium for doing business anyway – pick up the phone and call the busy person’s office if you aren’t able to get ahold of them via email.
8. Be flexible.
Life happens; meetings get moved; and things come up. Be flexible enough to take these things in stride. You’ll get a lot more business done this way and will be thanked for it.
If you enjoyed this post, make sure you subscribe to my RSS feed!
1a3e37fa-5125-4ae2-b3f5-e38c47e0c20f|3|3.3
One thing that is a little dicey about the Windows Azure SDK for Node is that it by default it depends on being run inside of Azure itself or the compute emulator.
The Azure npm package looks for environment variables parsed from web.config and won’t find them if you run your node application via the node [entrypoint].js commandline.
So why would you want to run your Node application outside the Azure emulator if you’re utilizing the Azure npm package? If you’re using Cloud9 to develop and deploy Node applications to Windows Azure, then that’s one reason.
Another is that IIS eats any error messages your Node application throws by default and on some occasions errors don’t always get logged to server.js/logs/[n].txt, so occasionally you have to debug by running the stand-alone node server where you get verbose error messages to console.
To work around this, you can set your tableClient / storageClient / queueClient object to target a specific account directly.
//Emulator
var tableClient = azure.createTableService(ServiceClient.DEVSTORE_STORAGE_ACCOUNT, ServiceClient.DEVSTORE_STORAGE_ACCESS_KEY, ServiceClient.DEVSTORE_TABLE_HOST);
//Live account
var tableClient = azure.createTableService(‘aaronnodedemo’,’scary-looking-access-key’,’ [account].table.core.windows.net’);
When you do this you lose the ability to let Azure .config transforms enable you to switch between production and staging easily, but this can be a necessary evil for debugging tricky bugs ;)
If you enjoyed this post, make sure you subscribe to my RSS feed!
ebbd8b75-f6c0-464e-97d7-c7b1a20a197f|0|.0
This past weekend at SoCal Code Camp I gave two presentations back-to-back on Node.JS: “Intro to Node.JS” and “Building Web Apps with Express.”
I don’t have much to add on what I did at the sessions other than to mention just how surprised I was at how enthusiastic people were to see Microsoft involved with the Node effort and how eager everyone was to learn Node. I was thoroughly impressed.
Below are links to my slides and code samples for both talks – enjoy!
Intro to Node.JS
Source code: Github or Cloud9
Building Web Apps with Express
Let me know if you have any questions!
If you enjoyed this post, make sure you subscribe to my RSS feed!
0cb534d2-1e31-4851-9dd3-13834eeada5f|0|.0
One major advantage of developing Node applications for Windows Azure is the ability to have your Node apps managed directly by IIS via iisnode.
You can read more about the benefits of iisnode here, but I want to call out these two points specifically from the iisnode wiki:
Scalability on multi-core servers. Since node.exe is a single threaded process, it only scales to one CPU core. The iisnode module allows creation of multiple node.exe processes per application and load balances the HTTP traffic between them, therefore enabling full utilization of a server’s CPU capacity without requiring additional infrastructure code from an application developer.
Process management. The iisnode module takes care of lifetime management of node.exe processes making it simple to improve overall reliability. You don’t have to implement infrastructure to start, stop, and monitor the processes.
Scalability on multicore servers with Node typically requires developers to use the Node cluster module and write some code which spawns one node.exe process per available processor and write your own handlers for what to do in the event of a failed process and so forth.
Update: It occurred to me after I initially published this that many developers may not understand the need for multiple node.exe processes. If you read through my “Intro to Node.JS for .NET Developers“ you’ll get a better sense for how Node works under the hood – the gist of it is that Node handles all incoming HTTP requests on a single thread, and thus can only utilize a single core at any given time regardless of the number of available processors. Having multiple Node.exe processes handling HTTP requests allows for multiple event loop threads, all of which can be run in parallel across different processors. That’s why this technique is important for multicore systems.
IIS and iisnode can take care of this for you automatically without you having to write any code to do it (a good thing,) and on Windows Azure you can automate this via startup task (fork the source on Github:)
if "%EMULATED%"=="true" exit /b 0
REM Count the total number of available processors on this system
powershell -c "exit [System.Environment]::ProcessorCount"
REM set the default number of processes for our app pools in IIS equal to the
number of available processors
%windir%\system32\inetsrv\appcmd set config -section:applicationPools
-applicationPoolDefaults.processModel.maxProcesses:%ErrorLevel%
This startup task automatically determines the number of available processors on the CPU and tells IIS to set the number of worker processes in your Node application pools to use one process-per-core, thus allowing your Node applications to take advantage of every core on the system.
Adding Startup Tasks to Node Projects
If you want to use this startup task in your Node project, follow these steps:

To verify that the script worked:
- RDP into one of your Node + Azure instances;
- Go to IIS Manager from the Windows Menu;
- Go to Application Pools;
- Right click on the Application Pool for your Node application and select Advanced Settings – your application pool will be the one that has Applications = 1 on the far right of the table; and lastly
- Scroll down to Maximum Worker Processes and check the value – in the screenshot below I’m running on a pair of Medium Azure instances, which have two cores each and thus two processes.


And voila, you’re done.
Let me know if you have any questions!
If you enjoyed this post, make sure you subscribe to my RSS feed!
9d4a6d99-e3a3-4402-8a8c-1862353a1ac7|0|.0
On my primary development machine, where I have tweaked and prodded IIS multiple times for many projects over the past couple of years, I get the following 500 – Internal Server Error message when I try to fire up even the simplest “Hello World” Node.JS project included in the default template for each Windows Azure Node Web Role:

However, when I push the default “Hello World” Node.JS app to a production on Windows Azure, I have no issues whatsoever! So what’s the problem?
Cause
The issue is that the Windows Azure emulator:
- Creates integrated AppPools for your Node roles in IIS (hosted in iisnode), which is intended for ASP.NET applications that take advantage of the HTTP request processing pipeline in IIS 7+ and
- Runs the AppPools under an administrative process.
Under these settings, Windows thinks that each Node.exe process is trying to access the integrated IIS pipeline (which only .NET applications can do currently) under the process identity of the Windows Azure emulator (which has administrative rights), which is not supported. This issue comes up with other CGI / non-.NET applications run in IIS besides Node too.
Here are a few ways to fix the problem:
Fix #1: Set Identity.Impersonation=False in <system.web> in your web.config file
In this instance, simply change the web.config file in the root of your Node.JS application directory to set Identity.Impersonation=False, like this:
<system.web>
<identity impersonate="false"/>
</system.web>
Effectively this makes it such that your Node role doesn’t not assume the identity of the Windows Azure emulator (which runs in a process with administrative rights), so it runs under a local system process identity and no longer raises the error.
Remember that web.cloud.config affects your live settings on Windows Azure; you want to change just web.config which affects only your local settings when you run in the Windows Azure emulator.
Fix #2: Set validateIntegratedModeConfiguration=False in <system.webServer> in your web.config file
Another alternative is to simply tell IIS to suppress the error altogether, which you can do be editing the system.WebServer section of your web.config file:
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
Fix #3: Change the AppPool to Classic Mode
The final and preferred method is to change the AppPool to Classic Mode, which shuts off the application’s access to the integrated IIS processing pipeline regardless of process identity. You can do this via startup task:
%systemroot%\system32\inetsrv\APPCMD.EXE set app "Default Web Site/" /applicationPool:"Classic .NET AppPool"
Although this might be the most kosher method of fixing the issue in IIS, it also happens to be the most awkward to implement on Azure. I’d recommend using approach #1 or #2 instead given that this issue affects the local emulator only.
If you enjoyed this post, make sure you subscribe to my RSS feed!
a58369b5-e8ee-423c-878a-d48c2df436de|0|.0
Following Microsoft’s announcements regarding first-class Node.JS support on Windows Azure, I thought it would be helpful to walk newbie Node.JS and Windows Azure developers through the process of getting their Node.JS development environment set up, building their first simple Node.JS application, and then learning how to take advantage of popular NPM packages like Express to build actual web applications on Windows Azure.
If you need a primer on how Node.JS works and what Node is useful for, go ahead and check out my post from last week: “Intro to Node.JS for .NET Developers.”
Setting Up Your Node.JS + Windows Azure Environment
First, a big disclaimer: all of the Windows Azure deployment and packaging components require Windows in order to work. You will not be able to deploy your application to Windows Azure without a Windows Vista / 7 box.
That being said, the rest of the setup process is straight forward and all of the tools are free (with the exception of one possible text editor I am going to recommend.)
Step 1 – Install the Node.JS Tools for Windows Azure Tools via Web PI
The first thing you need to do is install the Node.JS tools for Windows Azure via Web Platform Installer – click here to install the tools.

This will install:
- Node.JS for Windows;
- Node Package Manager (NPM) for Windows; and
- Windows Azure Powershell for Node.
If you already have a previous version of Node.JS for Windows installed (anything before the latest version, currently v0.6.6), you should uninstall it before running Web PI.
If for whatever reason you need to install Node.JS for Windows manually, you can do it via NodeJS.org.
Once the installation is finished, you should see the following item appear on your Windows bar:

Click on it and you’ll see a PowerShell command window fire up – this command window supports a number of Node + Azure-specific commands you can use for creating new roles and services.

We’ll get around to playing with PowerShell for Node a little later – next we need to set up your Windows Azure account.
Step 2 – Get a Windows Azure Account
In order to take advantage of Node.JS for Windows Azure you’re going to need to have… a Windows Azure account.
If you’re looking for a way to try Windows Azure for free, I recommend signing up for the three-month Windows Azure free trial.
If you’re in a startup and want access to some longer-term Windows Azure benefits, sign up for BizSpark, activate your BizSpark Windows Azure benefits, and get access to some more substantial Windows Azure benefits.
Step 3 – Install a Text Editor with JavaScript Syntax Highlighting
When you step into the world of Node.JS, you’re no longer in a universe where Visual Studio can really help you. Thus, we need to pick up a text editor to use in our Node.JS development.
I recommend that you pick one of the following:
- Notepad++ – JavaScript syntax highlighting support, lightweight, simple formatting tools, and has a decent number of plug-ins. Cost: free.
- Sublime Text – this is the community favorite for doing Node.JS; it’s cross-platform so it works on OS X, Linux, and Windows. Cost: free trial, but $59 for a single seat.
Install one of these two text editors and start playing around with it… You’ll get used to it.
Step 4 – Create Your First Node.JS + Azure Project
Now that you have your development environment all set up, now it’s time to create your first Node.JS on Azure project. The official Node.JS for Windows Azure guide will walk you through a lot of the same steps in more detail if you wish to use that instead.
Inside the PowerShell for Node.JS command window, do the following:
- Create a directory for saving all of your Node.JS projects – if you want to use “C:\Repositories\Node\” then you can just type mkdir C:\Repositories\Node inside of PowerShell and it will create the directory for you.
- Change the current working directory to C:\Repositories\Node – type cd C:\Repositories\Node inside the PowerShell window.
- Create a new Windows Azure service by typing New-AzureService [projectname] – this will automatically create a new [projectname] subdirectory and set it to the current working directory.
- Create a new Node.JS Web Role (an Azure role that serves HTTP requests from within IIS) by typing Add-AzureNodeWebRole [rolename] – this will automatically create a set of folders under the [projectname]\[rolename] directory which contain everything you need to run your first Node.JS + Azure project.
Here’s what the output looks like in the command window:

Step 5 – Fire Up Your Node.JS Project in the Emulator
Just to make sure that our simple “Hello World” Node.JS project runs properly, we’re going to run it in the emulator before we do anything else with it.
Simply type “Start-AzureEmulator – launch” in the command line, and you’ll see a page like the one below:

Step 6 – Download and Import Your Windows Azure Publication Settings
In order to actually publish to Windows Azure, you have to download your .publishSettings file from the Windows Azure portal. Luckily, you can just do this using the Get-AzurePublishSettings command in the PowerShell window.
This will launch a new web browser window to this page on the Windows Azure portal, which will have you login to your Azure account and will then automatically ask you where you want to save your Windows Azure publication settings.

Save your Windows Azure publication settings to C:\Repositories\Node\[projectname].

Finally, you just need to import your publication settings in the Node.JS PowerShell Window like this:
Import-AzurePublishSettings C:\Repositories\[projectname]\[file-you-downloaded].publishSettings
You should see a message like this in the command window when the operation succeeds:

Step 7 – Publish (and then Take Down) Your “Hello World” Node.JS Project to Windows Azure
The last step before we start diving into Node.JS is getting some experience publishing Node.JS projects to Windows Azure – now that we’ve imported our .publishSettings file we can easily publish our little “Hello World” example directly to the Windows Azure account we set up earlier using the following command in the PowerShell terminal:
Publish-AzureService –name [NewServiceName] –location “North Central US” –launch
This will automatically publish the Windows Azure service in your current working directory (C:\Repositories\Node\[projectname]) to a new hosted service in the North Central United States Azure Data Center called “NewServiceName” with one small instance of the [rolename] Node.JS web role running. The –launch flag will automatically trigger the browser window to open to your service once it finishes deploying.
Here’s what the output window will look like in PowerShell upon a successful deployment:

And you’ll see this in your browser window once the deployment is complete:

If you’re using the Windows Azure free trial or a BizSpark Windows Azure account, you can leave up your Node.JS “Hello World” project if you wish as you’re not going to incur a bill.
However, it’s generally a good practice to take down Windows Azure instances that aren’t doing actual work because in the future you will be billed for the amount of time of the instance is deployed… So to take down an Azure deployment we can either delete it through the Windows Azure management portal or through the following command in the Node.JS PowerShell:
Remove-AzureService
That’s it for this tutorial – the next lesson will show you how to get your hands dirty with the Node Package Manager and Express.JS for doing MVC-style websites in Node!
If you enjoyed this post, make sure you subscribe to my RSS feed!
34974db1-87c0-4035-ad1f-beb7fd1b4912|0|.0
In addition to my regular work for Microsoft and the open source projects I create and contribute to on Github, I also like to ship the occasional app or website under my StannardLabs masthead.
My absolute favorite app that I shipped early in the summer is Lolcats Professional Pro Plus, a simple app that makes it a breeze to flip through pictures of Lolcats from ICanHasCheezburger.
I’ve since modified the app pretty drastically so that it now includes touch support, a clean minimalist UI, and a selection of 60,000 plus images to page through, with hundreds more being added every day.
Lolcats Professional Pro Plus is currently designed for Windows Phone 7.0, although a Mango version is on the way soon. Here’s what the app currently looks like:




Do me a favor and go download the app from the Windows Phone 7 app store – it’s free and is a great way to kill time when you need it.
If you enjoyed this post, make sure you subscribe to my RSS feed!
44f314ae-df84-4e93-a6ce-4f9dfaf7c44f|0|.0
Over the summer I went through Zed Shaw’s Learn Python the Hard Way in an effort to broaden my horizons and start learning languages beyond C#.
Learn Python the Hard Way is a book designed for people with no programming experience whatsoever, but even as an experienced software developer I got a lot of value out of it. Zed does a great job forcing the reader to develop Python muscle memory early, and he introduces concepts like unit testing in Python and package management from the beginning.
One of the really valuable lessons of Learn Python the Hard Way is in exercise #46, where Zed recommends a great generic folder and file structure for new Python projects, like this one:
/[projectname]/
/[projectname]/setup.py
/[projectname]/bin
/[projectname]/docs
/[projectname]/[projectname]
/[projectname]/[projectname]/__init__.py
/[projectname]/tests
/[projectname]/tests/__init__.py
/[projectname]/tests/[projectname]_tests.py
This is a great starting point for most Python projects, as it allows you to easily build a Python package with setuptools and to unit test it (using Nose in this case.)
However, I really didn’t like having to manually copy and rename folders / files constantly in order to work with this project structure, so I wrote my own Python package called “Scaffold” which allows you to automatically scaffold new projects with this structure directly from the Python command line, like this:
python -m scaffold -p "projectname" [-d {base directory}]
And with that, you’ll automatically generate the Python project structure I showed you previously, with Nose set up as the default unit testing framework.
Installing Scaffold
Scaffold is compatible with Python 2.7 – I haven’t tested it with Python 3.0+, but I’d be surprised if there were compatibility issues with it given Scaffold’s simplicity.
You can install Scaffold directly via Pip:
pip install scaffold
If you have more questions about Scaffold and its usage, please see the scaffold-py readme on Github.
Contributing to Scaffold
You can find the source to scaffold-py on my Github account. Patches are not only welcome, but strongly encouraged!
If you enjoyed this post, make sure you subscribe to my RSS feed!
8328fc7a-a201-4d5b-a2ba-147472fe96a7|0|.0
Microsoft announced out-of-the-box support for Node.JS on Windows Azure on Tuesday; we pushed both an official Node.JS SDK for Windows Azure services (table storage, blob storage, and queues) and some tools for creating and managing Node.JS roles on Windows Azure, both of which are available through the official Windows Azure page on Github.
I’ve been playing around with Node for a short while and have the pleasure of working with some great startups that utilize Node heavily in production, so I wanted an opportunity to explain to my fellow .NET developers why they should be excited about Node support on Azure and how they can put it to work for them.
Node at a Glance
If you want to spend 90 minutes and get a full 100-level understanding of Node, check out The Node Beginner Book. If you’re fine with the footnotes, keep reading.
Node is an asynchronous distributed programming platform built on top of Chrome’s V8 JavaScript engine (the same engine used to parse and execute client-side JavaScript inside Chrome.) Node is actually server-side JavaScript, but its syntax and prose are familiar to every web developer to some extent.
Node’s true innovation is its evented + asynchronous I/O model.
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end(myJavascriptObject.getSomeStatusInfo());
}).listen(1337, "127.0.0.1");
The primary method of any Node application runs a single-threaded continuous event loop (the .listen method of the HTTP server), which farms out long-running tasks to worker threads (the anonymous function) which callback the main event loop once they’re finished:

There are three major advantages to this model:
- The main event loop uses a single thread to handle multiple concurrent connections, which makes the overhead of Node.JS grow relatively slowly as the number of requests it has to serve increases as there’s no OS thread / process initialization overhead;
- All long-running tasks (network I/O, data access, etc…) are always executed asynchronously on top of worker threads which return the results via callback to the event loop thread; and
- JavaScript’s language features (functions as objects, closures, etc…) and Node’s programming model make this type of asynchronous / concurrent programming much easier to utilize – there’s no thread management, no synchronization mechanisms, and no message-passing nonsense. This eliminates a lot of pitfalls that most developers fall into when attempting to develop concurrent applications.
Using Node.JS with .NET
So, you’re a veteran ASP.NET MVC or WCF developer… Why should you be interested in taking a look at Node?
First, Node is fully supported in environments .NET developers are familiar with. Node runs on Windows; Node can be run as a managed module inside of IIS; and Node can now run on Windows Azure. There’s even a NPM package for having Node.JS interop with SQL Server.
Second, Node does a great job tackling vertical issues like real-time notifications, web sockets, and other scenarios that aren’t easily addressed through existing .NET technologies (although SignalR is pretty cool.)
Node isn’t a replacement for everything – frankly, it’s not a great solution for heavy web + database CRUD applications or for serving static content.
Here are some scenarios that I like for Node:
- Handling multiple concurrent connections (web sockets, handling events from real-time messaging systems [ZeroMQ / Azure Service Bus], anything with socket programming…)
- High-volume, small response-size systems – think of a real-time logging system where you have to write millions of messages an hour and only send small ACK response objects back to the caller – Node.JS is perfectly suited to handle this;
- Real-time Pub/Sub systems – if you have an application that is heavy on notifications and needs to do it in real-time, Node is a great choice given its penchant for getting in and out of requests quickly.
Need a pragmatic example?
Take a close look at Socket.IO, arguably the best solution for working with web sockets and long-polling available on any platform.
If you have an application where real-time notifications are important like a messaging application or a social game, then running Socket.IO alongside IIS on your boxes gives you a significantly simplified solution both on the client (the Socket.IO client is backwards compatible all the way to IE5.5) and the server for handling socket connections and routing, and it takes a minimal amount of resource overhead to do it.
I’m going to be doing some more work around Node.JS and Azure in the New Year, so if you have any questions or comments please feel free to hit me up in the comments here.
Want to get started with Node.JS and Windows Azure?
If you want to try out Node.JS on Azure, sign up for the Windows Azure free trial and install the Node.JS Azure SDK via Web Platform Installer.
If you enjoyed this post, make sure you subscribe to my RSS feed!
f48de8dc-becf-43ed-a8e0-267d45f08a42|3|3.7
Earlier this week I spent some time helping a company troubleshoot some performance issues with Windows Azure – their ASP.NET request queue was growing longer than the maximum amount of queued requests supported by default in IIS (5000) during bursts of high activity, so I had to help them find a way to empty the queue faster.
One way to do this is to modify the number of max/min IO and worker threads available to any web role instance, and these values can only be modified through machine.config settings.
As you know, Windows Azure VMs are not persistent so you can’t modify machine.config and save it to file system like how you might if you were hosting IIS on your own local box.
Thus, I crafted a solution using AppCmd and Windows Azure startup tasks.
Here’s some of the code below:
REM Increases the number of available IIS threads for high performance applications
REM Uses the recommended values from http://msdn.microsoft.com/en-us/library/ms998549.aspx#scalenetchapt06_topic8
REM Values may be subject to change depending on your needs
REM Assumes you're running on two cores (medium instance on Azure)
%windir%\system32\inetsrv\appcmd set config /commit:MACHINE -section:processModel -maxWorkerThreads:100 >> log.txt 2>> err.txt
%windir%\system32\inetsrv\appcmd set config /commit:MACHINE -section:processModel -minWorkerThreads:50 >> log.txt 2>> err.txt
%windir%\system32\inetsrv\appcmd set config /commit:MACHINE -section:processModel -minIoThreads:50 >> log.txt 2>> err.txt
%windir%\system32\inetsrv\appcmd set config /commit:MACHINE -section:processModel -maxIoThreads:100 >> log.txt 2>> err.txt
I’ve open-sourced the rest of my IIS machine.config / app pool scripts on Github. Take a look at them and let me know if you have any questions.
If you enjoyed this post, make sure you subscribe to my RSS feed!
899fa07c-6cdb-4dcc-b2d2-3e3852849c21|0|.0