Navigation

Search

Categories

On this page

ASP.NET IHttpAsyncHandler vs IHttpHandler
Microsoft Azure Critique/Review
Why Managed Windows Services Hog Memory and Eventually Crash
Fix Outlook Access to Google-based Email Account
iPhone 3G Software Update Finally Working on Vista x64 with iTunes 8.
AT&T U-Verse Door-to-Door Sales People and Reality Are At Odds
AT&T U-Verse installer can wire your house with CAT5e Ethernet cable
How to Make iPhone 3G Check Email Automatically

Archive

Blogroll

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

RSS 2.0 | Atom 1.0 | CDF

Send mail to the author(s) E-mail

Total Posts: 55
This Year: 0
This Month: 0
This Week: 0
Comments: 9

Sign In
Pick a theme:

 Monday, November 10, 2008
Monday, November 10, 2008 3:52:23 PM (Eastern Standard Time, UTC-05:00) (  |  |  |  )

Since I use ASP.NET HTTP handlers quite often, I decided to figure out what advantages IHttpAsyncHandler has compared with IHttpHandler. As I looked at many people's claim that IHttpAsyncHandler somehow magically improves performance by shifting process handling on to another thread, I realized that MSDN documentation of IHttpAsyncHandler is laking in a fundamental way: it fails to mention that simply moving request rendering onto another thread does not yield any benefits. The doc fails even to mention the goal of IHttpAsyncHandler is pretty much just to manage ASP.NET request thread pool more efficiently. This means that your application using synchronous IHttpHandler will suffer performance penalty only when your application runs out of threads dedicated by ASP.NET to handling requests. This means that, first, it makes sense to consider switching to IHttpAsyncHandler only if your requests are high-latency. However, even then switching to IHttpAsyncHandler may not provide any performance gain unless bulk of requests processing (or waiting for conditions allowing processing to begin) occur on a thread other than one coming from ASP.NET thread pool!!

Creating your own thread does not make anything any more efficient, because releasing request processing thread to create your own has a zero net result. In this situation you can achieve better net result by increasing the size of ASP.NET thread pool by tweaking web.config. 

The benefit of using IHttpAsyncHandler, as I understand it, comes only when your request-processing thread is waiting for an I/O completion, like a web service call, for example. In this case, another thread, the IO thread, is created, and instead of waiting for the I/O port completion on the request-processing thread, it makes sense to release the processing thread and tell I/O thread to call you back when IO is completed, effectively finishing response processing on the I/O thread. In most cases this means that unless your BeginProcessRequest() implementation starts an async I/O operation that takes async callback as a parameter, the whole IHttpAsyncHandler business is a waste of time.

The rule of thumb should be this: if most of your request processing is done by a callback invoked in response to an I/O completion, and therefore on the IO thread, then usage of IHttpAsyncHandler is justified. Otherwise, I am sticking to good ole' IHttpHandler.

Comments [0] | | # 
 Friday, November 07, 2008
Friday, November 07, 2008 9:53:48 AM (Eastern Standard Time, UTC-05:00) (  |  |  |  )

Microsoft marketing folks are incorrigible. When explaining new technology they invariably fail to make anything any more clear. Case in point: Microsoft Azure. Parsing through the Azure site left an impression that MS don't really want anyone to find out what in the world they are really doing.

For those who don't have time to filter through MS marketing noise, consider reading this very concise, pretty funny even if somewhat crude-worded Windows Azure review:
http://www.theregister.co.uk/2008/11/03/dziuba_azure/print.html

Comments [0] | | # 
 Wednesday, October 29, 2008
Wednesday, October 29, 2008 9:52:59 PM (Eastern Standard Time, UTC-05:00) (  |  |  |  )

It's very easy to write a windows service using C# or VB.NET. Easy to write, easy to install, but for a price.

It's an often overlooked fact, but in .NET runtime, Garbage Collector does not merge together freed memory chunks, if they are larger than 85K. What does it mean? It means that if your managed windows service allocates and frees buffers larger than 85K on a continuous basis, your service will crash because it will eventually run of memory due to Large Object Heap (LOH) fragmentation. Again, it will only happen if your managed windows service allocates objects of 84,000+ (give or take) byte, but IT WILL HAPPEN!

There are workarounds, somewhat expensive, like wrapping your service logic in COM+ server-activated process, which can be set up to recycle - just like IIS AppPools are recycled. Or one could create a proprietary memory manager with a pool of large buffers, making of which, of course, would be kind of ironic since the whole point of having garbage-collected memory manager was to eliminate hassles of memory management.

Anyway, the purpose of this post is to raise awareness among fellow windows service developers. If your service is high-throughput, high memory usage, it will go down in flames even if your code is perfect. The choices are: a) ensure all your memory allocations do not take more than 84K, b) implement your own memory manager, or c) implement worker process recycling.

Good luck to all of us.

Comments [0] | | # 
 Tuesday, September 30, 2008
Tuesday, September 30, 2008 10:23:05 AM (Eastern Standard Time, UTC-05:00) (  |  )

If you are hosting your business email with Google and access it using an email client like Outlook, chances are Google will freak out once in a while and put your Outlook in the endless loop of asking for your username and password, and rejecting them even if they are correct. It seems to happen after credentials provided by your email client fail to get you authenticated. I used to have this problem a lot when I checked my business email using Windows Mobile (Cingular 3125) smartphone. Since I switched to iPhone the problem went away, or so I thought. Since the information on how to fix this issue is not that easy to find, I made a simple page where you just enter your domain name and it will take you to the Google credentials unlock page, specific to your site.

Comments [0] | | # 
 Tuesday, September 23, 2008
Tuesday, September 23, 2008 8:53:57 AM (Eastern Standard Time, UTC-05:00) (  |  |  |  )

Twice I tried to update iPhone 3G firmware using iTunes 7.7 running on 64-bit Windows Vista, and both times I was getting cryptic error with code (-1) somewhere in the middle of the process. Oddly, firmware would seemingly get upgraded before the crash, but I would still have to restore the iPhone from the backup - a process (was buggy on its own) that would not restore the applications I installed from Apple app store.

Thankfully, after I got iTunes 8, my latest upgrade to 2.1 version of iPhone software went without a problem. 2.1 was worthy upgrade: the most obvious change was improved battery life.

Comments [0] | | # 
 Wednesday, August 27, 2008
Wednesday, August 27, 2008 11:33:55 AM (Eastern Standard Time, UTC-05:00) ( )

Updated Jan 1, 2009.

Here's what I didn't get from U-Verse despite sales woman's promise:

  • Static IP address: Salesperson said they can do it, then tech support people said don't do it at all and the best they could do is to setup 28 day (instead of 24 hour) DHCP lease for my IP address. Despite the contradiction of statements, I still have the same IP address. I guess, talk to them, you may get one too.

  • Free receivers/STBs with U-Verse TV U100 package: Was charged for each additional receiver and had to negotiate with AT&T. Got credit to the current bill and six month promotional discount to bring the price close to the initially stated. What happens after 6 months - don't want to think about it right now.

  • Price lock-in: I was promised that price won't go up. Not the case - AT&T rep on the phone said there is no such commitment.

The bottom line: videotape or at least record what your sales person commits to, including your services and amount you are going to pay in recurring charges, plus make her state discounts and rebates you will receive.

Comments [0] | | # 
 Monday, August 18, 2008
Monday, August 18, 2008 3:37:49 PM (Eastern Standard Time, UTC-05:00) ( )

Update:
Just to make it clear: you won't have to wire your house yourself before U-Verse is installed - AT&T tech will do it for you. The most important things to realize is that AT&T tech can use either coaxial cable (adding to existing TV cable in your house), or wire your house with cat5e Ethernet cable. I am just letting you know that it is apparently up to you to ask the tech to use Ethernet cable instead of coax. If you don't ask, the technician is likely to simply add coax cable because it's less work, but if you ask for Ethernet, you should be able to get it. And since (at least in my case) they wire up to 10 locations in your house for free (up to 4 TV sets and 6 computers - they will wire only existing TVs and computers/game consoles, not planned or desired one), you can upgrade your house by getting Ethernet cabling for free when you sign up for AT&T U-Verse.

Original post:
I asked U-Verse installation tech to use CAT5 Ethernet wiring instead of coax, and he didn't mind. He wired all rooms where I have TVs or computers with Ethernet CAT5e cable, and hooked them up using RG ports and a Netgear Gigabit switch AT&T provided. Needless to say, you can add any number of computers later if you deploy your own switches, preferably Gigabit ones to ensure there is plenty of bandwidth to carry multiple TV streams along with regular network traffic. Wiring up your house for Ethernet is a good freebie from AT&T. Be sure to tell your U-Verse sales person how many rooms you want to wire. Also make it clear to the installer tech which rooms with TVs and computers you want to wire BEFORE he starts. If you change your mind or remember you left out a room with a TV or PC, AT&T will charge you for added wiring.

Comments [0] | | # 
 Monday, August 04, 2008
Monday, August 04, 2008 12:33:05 PM (Eastern Standard Time, UTC-05:00) (  |  )

By default iPhone 3G is configured to check emails only manually. To make it check email regularly the change in the settings needs to be made. Since I spent more time than I expected finding out how to make iPhone 3G check email periodically, I decided that it's worthy a post. I was looking all over Settings | Email, Calendar and Contacts, where I thought the setting would be, and could not find it. Instead it turned out to be Settings | Fetch New Data. That what drives frequency of email checks:

Comments [0] | | #