Wednesday, May 25, 2011

Why did the turtle cross the road?

This morning, I was prepping a camera for my wife to take on our daughter’s field trip. This meant that I was surrounded by camera bodies, lenses, and a big cup of coffee.

I just happened to look out the front window, as I saw two cars stop in front of my house. I saw what looked like a black, flattened basketball sitting in the middle of the road. A basketball with a head sticking out.

Reaching for the nearest camera+lens combo (and almost knocking my coffee cup over), I bolted outside to get a closer look:

 

IMG_0386

Its shell looked to be about 15 inches long, along with some nails in need of a mani-pedi.

IMG_0391

I had time for one more close-up before another car drove up:

IMG_0393 (1)

So… why did the turtle cross the road? To remind me that there’s an entire world around me that doesn’t involve staring at a computer screen.

Time to go back to work now, staring at the computer screen…

Tuesday, May 17, 2011

Windows Azure Tip: Go Beyond 5 Endpoints per Role, beyond 25 per Deployment

A few months ago, I blogged about the impact Remote Desktop has on your Windows Azure Deployment. The basic premise was simple: Remote Desktop consumes one endpoint on each of your roles. And, if you only had one role in your deployment, you’d actually lose two endpoints on your role, because of the Remote Desktop Forwarder. Given the restriction of 5 endpoints per role, having only three usable endpoints could be limiting if, say, you were trying to host a public-facing website (port 80), secure website (port 443), and a few WCF services (port 8000, and then… what???), all in a single role.

This brings me to today’s tip: Go beyond 5 endpoints in a role

The way deployments are set up, there was a maximum of 25 total endpoints:

  • Five total roles per deployment
  • Five endpoints per role

While there’s still an endpoint total in effect, there’s been a subtle change to role definitions, which went into effect some time in March. In fact, if you look at the What’s New in Windows Azure MSDN Library page, you’ll see the subtle change mentioned, under the March 31, 2011 update summary:

A recent update has changed the manner in which endpoints can be distributed among roles in a hosted service. A service can now have a total of 25 input endpoints which can be allocated across the 5 roles allowed in a service. For example, you can allocate 5 input endpoints per role or you can allocate 25 input endpoints to a single role. Internal endpoints are limited to 5 per role. Input and Internal endpoints are allocated separately.

For internal endpoints (meaning inter-role communication only), nothing changes – only five per role. However, with input endpoints (meaning public-facing ports), you can divide the 25 up any way you want across your roles.

Just for fun, I wanted to see what would happen if I went with all 25 input endpoints, along with five internal endpoints per role, across 5 roles.

Here’s part of my web role’s endpoint definition, with 25 input endpoints and 5 internal endpoints.

30endpoints

I added 4 more roles (all worker roles), with 5 internal endpoints apiece:

worker-role-5-endpoints

I published this to Windows Azure, and was able to see my website on each port. The default.aspx page shows the total endpoint count for my webrole, along with the port number for Endpoint15, which is read from the role environment with this simple code:

txtInstanceCount.Text = RoleEnvironment.CurrentRoleInstance.InstanceEndpoints.Count.ToString();
txtEndpoint15.Text =
RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["Endpoint15"].IPEndpoint.Port.ToString();




I also enumerated the total endpoint count across the entire deployment.



The output shows that these ports, indeed, exist and are active. Take a good look at my total endpoint count!



lotsofports-webpage


What this shows is:




  • 25 input endpoints on my web role, plus 5 internal endpoints on the same role


  • 5 internal endpoints each on the 4 worker roles, adding another 20 endpoints.


  • A grand total of 50 endpoints in my deployment!



If anyone’s ever tried publishing to Windows Azure in the past, with more than 5 endpoints per role, you received a deployment error. This app published with no issues. Here’s a snapshot of the portal, with everything humming along:



lotsofports-portal



Disclaimer: I did not wire up all the endpoints to services. I’m assuming everything will work, since it published with no errors. Feel free to disprove this.



So, as you’re planning your Windows Azure role usage, you can breathe a bit easier if you were bumping into endpoint limitations. Enjoy!