Tuesday, November 24, 2009

Multiprocessing vs. Network I/O

I've been reading up on Python's (v2.6 and above) multiprocessing module. While multiprocessing has been around for a long time, simplified libraries like this multiprocessing module may spur even casual programmers to consider parallelism in their programs. My feeling is that if issues like inter-process communication, synchronization among processes, and deadlock avoidance are dealt with painlessly, then many non-professional programmers would feel confident enough to load up CPUs with programs with multiple processes to speed things up. Moreover, given that multiple CPU cores are becoming the norm rather than the exception on commodity hardware, there is a real incentive to eventually switch to multiprocessing.

What will this switch in program design mean for network data I/O? Will average users end up opening and using more network connections on average? Web browser tabs are a good example of multiple threads or processes. When modern browsers fire up they often connect to several websites saved from the previous session. I conjecture that multiple tabs fill up the network's queue faster than was possible with single core CPUs. Although Network I/O is much slower than CPU bandwidth (data rate at which CPUs process say, HTML), there is a point beyond which a single core CPU becomes the bottle-neck (e.g. firing a dozen browser tabs). But multiple cores remove this limitation and drive network I/O to its physical (or traffic-shaped) limits. I plan to measure this interplay between multiprocessing and network I/O. Watch this space!

Thursday, November 12, 2009

Free airport Wifi as a marketing tool

Google is offering free Wifi in 47 US airports during the holiday season The idea is to flash a few web pages marketing Google's software and services to users in return for free Wifi service. According to this CNN article, Google is not the only company to do so - apparently Lexus and Ebay have also implemented similar ideas, or intend do so in the near future.

Free service is probably going to bring a torrent of airport Wifi users online - probably many more than the current number of (paying) users. Given that Wifi Internet channel space is a shared resource, it will be interesting to see how airport Wifi scales with the up-tick in usage. I just hope that the service doesn't deteriorate so much that the sponsoring companys' well-meaning message is lost to disgruntled users. And I do hope that engineers running these Wifi access points have done the networking provisioning Math beforehand.

Now the economics. The sponsoring company (Google) is probably going to pay a lot less than the retail price of airport Wifi connectivity. Why? Because the sheer volume of users will be much higher than when users have to pay individually. I think that the payment will include a fixed component depending on the number of access points participating in the service, and a variable component depending on the number of users accessing the service.

Lets assume that an average airport has about 20 accessible Wifi access points. Each access point can support (with any reasonable quality of service) about 10 concurrent users. If the airport is busy for, say, 12 hours in a day, and further say that we assume an average utilization of 50% of the total capacity of the access points, then we have (per day)

10 * 20 * 12 * 0.5 = 1200 hours of usage per day per airport.

I would assume that the sponsoring company (Google) would pay about $5000 per day as a fixed cost and then about $1 per hour usage. This brings the daily total cost per airport for the sponsoring company to $5000+$1200 = $6200.

So for 47 airports and 50 holiday season days, we are looking at a bill of about

6200 * 47 * 50 = $14.57m

That's not a bad deal for a big company like Google, considering the number of eyeballs they will capture. Lets say a user uses the free Wifi for 30 minutes on average. So, we are looking at about 12*10*20/(1/2) = 4800 users per airport, per day. That works out to over 11m users in the 47 airports over the 50 day holiday period. Even if we assume that most people make round trips and therefore use the Wifi connection 2 times, Google can still reach about 5.5 million unique users! No too bad for the $15 million spent.

And I haven't even started counting the goodwill ROI bonus for playing Santa during holiday season! Nifty nifty marketing.

Friday, November 6, 2009

Call for action! Powering down PCs

I've been playing with the idea of building a PC application that measures a computer's idle time. The idea is to gently convince users to suspend or power-down their PCs when they are not being utilised. I strongly believe that if PCs are optimally powered down, then many users could cut energy consumption (and hence also save on energy bills). Powering down battery-powered laptops will also increase the longevity of batteries and thereby decrease toxic battery waste in landfills.

As an example of where the possible savings may be, above is a pie chart showing my own PC usage over the past few working days. As you can see, there is ample scope to power down/suspend PCs when they are idle.

If you want to contribute time to this project (coding/web page/translation into other languages/spreading the word), feel free to contact me. If not, then do suspend your PC every time you are away for more than a few minutes :-).