blog

ASP.NET Developer’s Cookbook

On Saturday I received a copy of a book that I recently contributed to: ASP.NET Developer’s Cookbook. Kudos to Steve Smith, the main visionary/author, as well as the members of ASP Alliance who also contributed – the book is fantastic! 

I love the format of the book. Rather than attempting to be all encompassing, each receipe is a digestable ‘tip & trick’.

At work there is a set of about 8 books I keep close by, such as: a 1995 copy af Addison-Wesley’s SQL book, an IE 4.0 DHTML reference book from Wrox, Nikhil’s control book, Pro. ASP.NET 1.0, ASP.NET Unleashed, and Andrew’s ASP.NET in a nutshell.

This book is going to be #9. There’s already a ton of receipes I want to lift out and use on the www.asp.net site and in the ASP.NET Forums code base.

If you’re going to be at TechEd this week in Dallas, I think I’ll have some copies to give out at my ASP.NET Tips & Tricks talk.

Getting ready for TechEd 2003

I’m really looking foward to TechEd this year – mainly because it’s in my home town of Dallas, TX but also because TechEd is just a fun conference.

We’re also going to be trying a few new things at TechEd this year, including hosting a community lounge. I believe this is something only the Microsoft developer division is taking part in, but it will be great nonetheless.

The idea behind the community lounge is that MS people will just be hanging out to help answer questions, etc. Personally, I think it’s a great idea and intend to be there as much as possible (I get in on Tuesday evening).

See you there!

Post BillG Review

Last Wednesday at 9:30 AM we had our caching taskforce BillG review. I came into work at my normal time that morning, about 7:30AM, and did the usual email/spec. update/bug review/forum work. At 9:00 AM I decided that although I’m not presenting, it probably wouldn’t be a bad idea to print out copies of my caching related specs. I didn’t think I’d need them, but you never know. At 9:10 I headed out to the meeting.

You might have heard the Redmond Microsoft office described as a college campus. It couldn’t be more true, in some ways it’s probably bigger than a college campus. When I first started at Microsoft one of the most intimidating aspects was the sheer size of the place! The next amazing thing was that there was always (and I mean ALWAYS) some kind of construction going on. We’re either putting new buildings up, or tearing old buildings down to put new buildings up! As I write this I can see cranes swinging back-and-forth.

Anyhow… usually I like to walk to any meetings outside of my building, but that morning I decided to drive. I was parked and waiting for an elevator to the 5th floor by 9:20 and I was starting to get the same jitters I usually get at conferences presentations! For example, the meeting was at 9:30. Meetings at Microsoft NEVER start at the bottom of the hour. What if the meeting had been updated and I was walking in 30 minutes late!

I stepped off the elevator onto the 5th floor and slowly glanced – for about the 10th time- at my post-it note for the meeting room number. I headed down one of 4 possible hallways, hopefully in the right direction. On my left I first passed a conference room marked ‘the executive board room’ — if I could be a fly on that wall! — next I passed 2 other conference rooms: software design review room 1 and software design review room 2. Hmm… I’m participating in a software design review, but not in either of those rooms. 

After a few more steps I was at the end of the hall. Software design review room 2 on my left, offices on my right, and a glass door in front me. I again glance down at my post-it note … yup, still going the right direction, but now it appears that I need to pass through the glass doors. At this point I simultaneously hear two women in two separate offices ask me, ‘can I help you’? They direct me inside into what appears to be a private conference room in what appears to be Bill’s private office area. To make matters worse, I’m the first one there! I’m always one of those people that’s about 2-3 minutes late to meetings. At Microsoft a meeting might be scheduled to start at 10AM, but it seems like everyone is always 5-10 minutes late. Great, I hate being early.

It’s now 9:27. I’m still the only one in the room. Finally at exactly 9:30, Mike Pizzo, the guy presenting shows up. He has his own funny story to tell: Apparently he came in at 4:00 AM that morning to prepare for the meeting — can’t say I blame him, I’d probably do this same if I was presenting — he said he drove straight to this building, came up to the 5th floor and attempting to get into the conference room to ensure his network connection worked, etc. Turns out the glass doors were locked and he sat outside (by design review room 2) and worked on the demos. About 5 minutes after arriving a security guard showed up and started asking him why he was waiting outside Bill’s office at 4:30 AM in the morning!

9:35, a few more people show up. A woman, who said she was from MSR (Microsoft Research) asked me why we were meeting in this conference room vs. the usual executive board room. She obviously thought that I was commonly involved in meetings that occur with executives. I pulled a sly: ‘Yeah, I think it might have been booked – besides this room is smaller.’ She bought it 🙂 … what did she think I was, some usual board room attendee or something!

A few seconds later, Bill walks in the room; minutes later Jim Alchin, and Paul Flessner join us too. There are now about 14 people in the room so we start the meeting with introductions. I watch a couple other folks from the caching task force somewhat nervously introduce themselves — and notice that Bill kind of smiles/smirks with a couple of the more nervous exchanges. The kind of smirk you give someone when you can tell they are nervous, but there isn’t a reason to be. Either way, it’s both intimidating and exhilarating to sit in the room with Bill.

The first thing I notice as the meeting starts is that Bill is left-handed. He also didn’t bring a computer in with him, but instead is taking notes on a yellow pad of paper. I had heard this before – Bill takes amazingly detailed notes during meetings. I image he has to, given all the information directed at him. The other thing I noticed during the course of the meeting is how he takes his notes. He doesn’t take notes from top-to-bottom, but rather logically divides the page into quadrants, each reserved for a different thought. For example, it appeared that all his questions were placed at the bottom of the page.

The meeting ran for about 2 hours. During which we discussed all kinds of different technologies, competitors, strategy, research, etc. We got a lot of positive feedback on what we had done. I got the chance to answer many of Bill’s direct questions about ASP.NET caching and brainstorm some of the new ideas we were tinkering with. We talked about optimization differences in various algorithms too; the ASP.NET cache implements a least recently used algorithm (LRU), Bill, Jim, and one of the research guys debated LRU vs. memory management in early versions of Windows NT and how Windows memory management was now so much better.

The meeting ended about 15 minutes late. Overall it went really well. We had some new work items and some areas to investigate, but he was pleased with the results we had.

Looking back, it was a really fun meeting. I thought it was going to be more overview and less detail, but instead what it reminded me of was a feature team meeting. A feature team is a virtual team composed of the developers, program managers, and QA people directly responsible for a given feature within a product team. For example, we have a feature team within ASP.NET for caching. Feature team meetings are usually where the rubber meets the road for technical design. The feature is debated, designed, improved, etc. The BillG review was like a feature team meeting: filled with debate, ideas, changes, etc. but at a slightly higher level!

Scott Watermasysk emailed me after my pre-BillG review blog entry and told me he had a blog ready for Bill. Too bad I didn’t get a chance to let Bill know 😉

Bill Gates Review

For the last several years I’ve participated on an internal Microsoft task force with the single goal of getting a consistent caching strategy across various groups. We’ve made a tremendous amount of progress, much of which will show up in the next version of the .NET Framework (version 2.0).

Tomorrow we’re reviewing our progress with Bill Gates in what’s known (and feared/dreaded by some) as a ‘BillG Review’. A BillG review usually consists of 2 hours with the top executives from various teams, e.g. Developer tools, Windows, and/or SQL Server where you get to present work that they are interested in. Usually this is either new projects or projects that affect many other teams across the company, such as caching.

It’s not my first meeting that I’ve had with BillG — everyone goes by their alias in MSFT 🙂 — but it will be the first time he’ll be critiquing much of my work (caching in ASP.NET) directly. Frankly, I’m kind of looking forwad to it. We’ve done a tremendous amount of work in ASP.NET to enable some fantastic caching scenarios and with the new stuff — to be disclosed at a date in the not so distant future — we’re really going to once again change the way devleopers think about caching in their applications.

Should be fun … we’ll see if I still think that after the meeting! …hopefully I’ll remember and add a blog entry too!

As a side note, we upgraded the www.asp.net site to new hardware last week. We went from:

2 dual-processor 750MHZ 500MB RAM Windows 2000 web servers

1 single-processor 750MHZ 1GB RAM Windows 2000 database server

to

2 dual-processor 2.2 GHZ 1GB RAM Windows 2003 web servers

1 dual-processor 2.8GHZ 2GB RAM Windows 2000 database server

Our CPU utilization on our database server went from about 60-85% utilization to about 2-5% utilization — one of the other big changes we made with the database server was moving the logs and data to a separate raid controllers.

Shipping ASP.NET 1.1

Last night we updated the ASP.NET site with the links to the download to ASP.NET 1.1 — YEA!!! We RTW’d (Released to Web) 🙂

If you haven’t had a chance to check out ASP.NET 1.1 yet, you can now download the final version. We also wrote some whitepapers/FAQs to help people with some things that you might run into:

I’m working on another one that discusses setting up ASP.NET 1.1 and IIS 6.0 – it should be on the site tomorrow or Monday — just waiting for a final edit pass by our documentation team and some more details from our development team.

Shipping software at Microsoft
… is definitely fun:

There’s the ‘beer bashes’ where everyone gets together Fridays at 4PM — but usually not many people show up because they’re too busy — or they only make a pitstop for a beer and some chips! For ASP.NET 1.1 there was also the big ‘Windows Server 2003’ party in one of the parking garages (due to lovely Seattle weather). And then finally there is the ‘Everett’ (code name for .NET Framework 1.1) ship party.

The ‘Everett’ ship party, which will just be for the people responsible for .NET Framework and VS .NET is being held in, you guessed it: Everett (actually it’s at the ‘Everett Ranch’ — one has to assume…)

For those of you that don’t know, Everett is a small city just north of Seattle. Everett is home of Everett Naval Station – home to the USS Abraham Lincoln – a Nimitz Class nuclear powered aircraft carrier. For those of you that remember ‘Top Gun’ it’s the same boat, er, ship.

I’m not complaing, it’s just that the ship party for .NET Framework 1.0 was in Las Vegas, which I had to miss it due to the recent birth of my son. I guess maybe I am kind of complaing 🙂 … I mean, why can’t someone choose a code nam like ‘Fiji’ or ‘Baja’!

ASP.NET Forums
I’ve had some free time, i.e. ignoring other work/email, the last couple of weeks and focused on the forums. Below are some screen shots:

I’ve done a bunch of other UI and database related work. The screen-shots above are about 2 weeks old now. More about the forums v 1.5 later.

Enough rambling 🙂

When good hardware goes bad

Nothing is more frustrating when you’re working and poof – your monitor goes black and your system stops responding.

I had the joy of that experience today with my primary email and ASP.NET 1.1 development machine. The same machine that has the last 10 days of code updates to the ASP.NET forums (for the new search functionality), the last several months of email, and chapters from both a SAMs and an MSPress book I’m working on. So began 2 hours of my day trying to figure out what the heck happened.

Was it a problem with Windows – seemed to be since I got a couple bluescreens while trying to bring the machine back online – or was it a problem with the hardware? Turns out it was a hardware problem. One of the processor fans – it is a dual proc. – was broken and the processor was overheating.

The odd thing is that this is the second hardware problem I’ve had in the last 2 days. Yesterday one of our web servers for www.asp.net decided to go belly up. So last night and today I’ve had the joy of rebuilding the server and fixing all the bugs that got reintroduced: forgot to turn off request validation and to set the <machineKey /> values.

Is it coincidence or have I somehow angered the hardware gods 🙂

Getting to 0 bugs, Performance Tuning the Forums, and TechEd 2003

Getting to 0 bugs…
If any of you read Scott’s blog, you know that we’ve hit ‘code complete’ on the second milestone of ASP.NET v2 development. The current push is to get the program management (PM) team to 0 bugs.

Getting to 0 bugs for the PM team really doesn’t have a lot to do with actual coding, but more to do with ensuring that the implementation of the feature actually follows the specification. I left yesterday at 5:30 PM with 1 bug (yeah!) only to come in this morning with 7 new bugs (boo!). Luckily most are ‘resolved’, i.e. bugs that I’ve opened and the person it was assigned to has decided that it was ‘fixed’.

One of the workitems I’ve focused on is making our exception messages better. We’ve gone through all the exception messages and tried to make the meaning a little more clear and actionable. Here’s a simple example of the exception message that we currently display (ASP.NET 1.1) when attempting to get process metrics about the ASP.NET worker process with ASP.NET running in an IIS 6.0 worker process.

From this:
Process information is available only when the ASP.NET process model is enabled.

To this:
Process metrics are available only when the ASP.NET process model is enabled. When running on versions of IIS 6 or newer in worker process isolation mode, this feature is not supported.

As you can see it’s not a huge change, but when you consider how many exception messages we have in the system….

Performance tuning the forums
I’ve finally had a few more free cycles this morning to focus on the www.asp.net site. If any of you have noticed, we’ve actually re-enabled the online versions of the new starter kits. I also made some changes to the Control Gallery and IBuySpy tabs so that the forum contents displayed on those tabs is always served from cache.

We love statistics on the www.asp.net/forums site, i.e. total posts, total users, total new users in past 24 hours, etc. The larger our database grows the more costly it was to dynamically calculate this data. I’ve created 3 new tables and modified several procedures so that rather than performing dynamic lookups the lookups can be done in a single table. A great example is the way we used to calculate the total number of users online. We used to select from the Users table all users who’s ‘LastActivityDate’ was (current time – 30 minutes). Turns out the more data we got, the slower this was (imagine that!). So we created a new table forums_OnlineUsers table, and whenever a user performs an activity we update both the Users and forums_OnlineUsers table. But, when we need to get the users currently online … we can just select from the forums_OnlineUsers table (sounds trivial, but it makes a big difference in the number of physical reads SQL has to do — especially since we can index on LastActivityDate in the forums_OnlineUsers table).

Tech-Ed 2003
We just finallized the ASP.NET talks for Tech-Ed 2003 (June, in Dallas, TX — back to my hometown, woo hoo!). We asked for 25 talks and got an astonishing 20 accepted. So far I’m signed up for the following 5:

  • Best Practices and Techniques for Improving Application Performance – Performance best practices talk.
  • Designing and Developing the Community Starter Kit – Overview of the new community starter kit.
  • Tips and Tricks – Cool tips and tricks for ASP.NET developers
  • Deploying and Operating the www.asp.net web site – Discussion of what we do to run www.asp.net
  • What’s new in ASP.NET 1.1 – Overview on the new features in ASP.NET 1.1.

ASP.NET Forums

Last night we updated the ASP.NET Website to ASP.NET 1.1. So far so good, we found a couple of bugs in the forums that we had to patch this morning, but overall the site seems to run faster! Today we got even more good news, we should have our new dual-processor SQL box online by-end-of-week. It’s somewhat amazing that our little SQL Server (single-proc. 750 MHZ 1GB RAM) has handled the load of (we’re serving about 100K unique users / day on the site right now.):

  • All the content from www.asp.net (all content is stored in the DB)
  • All the interactive content from www.asp.net/ControlGallery/
  • All the interactive content from www.asp.net/Forums/ (requires the most database utilization)
  • All the interactive online versions of the starter kits (such as IBuySpy Store, Portal, etc.)

Unfortunately the search functionality of the forums is killing CPU utilization on the SQL Server. Once we get the new DB in place we’ll dedicate it to the forums — should definitley speed up the site even more!