Sep 12

Let’s face it, no one can be trusted to update our computers

The problem with automatic updates is mostly known in Windows based systems when updates go bad and cause troubles, that can go from ad nauseam offerings of the same updates, no matter how many times you try to install them, to having your computer rendered unbootable.

Software manufacturers, though, seem to love them. Google is nice enough to install about 32723 versions of Google Update, purportedly to update whatever Google software you were not so wise to install. For some time now, Google Chrome started updating itself automatically, which obviously brings some unexpected surprises, at times. I have had to cleanup after Google’s updates, that rendered Chrome unusable, at least twice.

The recent problematic newcomer to the automatic update troublemakers list is Cubby. I must say I like Cubby. It allows me to keep my work files synchronized between my computers without me having to worry about it. It just works. Additionally, it keeps a copy of the files on Cubby’s servers, meaning I have a copy of my most valuable files off premises. This is a safety measure that anyone that cares about its files should implement.

Liking Cubby does not meant that I like the fact that cubby updates itself automatically because, well, things can go wrong. Today things went badly wrong with Cubby. Both my computers showed Cubby restarting itself early in the morning and a simple check allowed me to see, to my despair, that all my cubbies (all the folders that I use Cubby to keep synchronized) were syncing. They have been syncing all day (50 GB of files in each computer), taking 25% of my CPU time and wasting valuable bandwidth, while some files that actually needed immediate syncing, are just queued due to the huge overload of Cubby checking and syncing every single file.

The Cubby episode today closed the deal for me. I no longer want software that updates itself automatically. If Cubby does not provide an option to disable automatic updates, I will not renew Cubby, when my subscription is up for renewal next December. My time is too precious to be left to the mercy of any software manufacturer’s poor testing practices. I know software can have issues, but thorough testing is supposed to avoid scenarios such as the one I experienced today.

No one seems to be deserving confidence when providing automatic updates to your software. At the very least, you should be offered the option to accept an update and provided with the choice to go back to a working version, when the latest update fails, usually miserably. It’s just not acceptable that you have to waste precious time because someone who provides you with software, cannot test it properly.

I have Windows Update set not to install updates automatically. This allows me to backup before updating and to update only when I have the time to do it. I will get SysInternals autoruns and disable GoogleUpdate. As to Cubby, well, it’s decided, either the option to avoid automatic updates is added, or Cubby will be gone from my systems in December.

Mar 25

Is performance an issue with SQL Server on Azure?

pasturecloudsI inherited the development of a web app that was meant to run on Azure, using SQLAzure as the data store. Right from my first contact with the app, it was clear that it had performance issues. When running from a local SQL Server performance could be deemed as endurable, but it was totally unacceptable on Azure, where it took 3 times longer.  A performance analysis pointed out database access as the main factor, but there were other things that could be improved upon as well.

The identification of the performance issues coincided with some changes in requirements, that led to the decision to take a totally different approach, regarding the way data the app needed was to be handled. This new approach was motivated mainly by the need to support the new requirements, but it was also meant to see if it could help with the performance issues. A model to represent the data was developed and implemented on a SQL Server database. This model was tested and improved upon, up to a point where performance, in a worst case scenario, was deemed acceptable, when implementing it on a local database server. The model requires some calculations to be performed, and this is done through a stored procedure. Each of the stored procedure queries was optimized for performance, considering the overall goal of minimizing the time needed to execute the stored procedure and not the individual queries themselves. This involved, for example, leaving out some indexes that could improve individual queries, but contributed to the degradation of the overall performance. As stated before, we arrived at a point where performance in any of our local SQL Server 2012 databases was deemed good enough.

Having solved the performance issue with local instances of SQL Server 2012, we set to see how SQL Azure, the intended data store, handled the new way to process the data. We rebuilt the entire database, populated it with the exact same data we have in our local testing scenario and tested the new stored procedure. Performance was much worse – the time needed to complete the stored procedure in the worst case scenario was almost 3 times the time it took to execute it in any of our local servers. Let me be clear here – we are not even talking about time needed to retrieve data from the database – it’s just the time needed to process records inside the database and storing the results in a database table.

Trying to determine if SQL Azure was to blame for this, we decided to compare the performance in different hosting scenarios: Azure SQL VM, a standard hosting offering running SQL Server 2008 Web edition and Amazon RDS. The testing started with Azure SQL VM. Using the Azure Virtual Machine preview, we created several instances of a VM running SQL Server 2012 SP1 Evaluation edition, on Windows Server 2008 R2 SP1. To rule out the virtual machine size as a factor, we had a VM of each size – small, medium, large and extra large (an extra large machine offers 8 computing cores and 14 GB of memory). On all these VMs, used with their pre-configured settings, performance was pretty consistent and didn’t really change much, when compared with SQL Azure. The execution time for the stored procedure was very similar in all VM sizes – and too high in all of them.

We then tried the traditional hosting solution, a Windows 2K3 server running SQL Server 2008 Web edition on two Xeon processors with 4 GB of RAM. Surprisingly, or maybe not, performance was pretty similar to the one in SQL Azure and Azure SQL VM. Almost believing that somehow, hosted solutions of SQL Server were not up to the task, we decided to try Amazon RDS. We had never tried Amazon’s cloud solution before, so we had to check the options offered and create a new account. There are multiple options regarding VM features and size and we decided to test a Large DB Instance – a VM running SQL Server 2008 R2 with 7.5 GB of memory and 4 ECUs (2 virtual cores with 2 ECUs each – 1 ECU, according to Amazon Web Services is equivalent to a 1.0-1.2 GHz 2007 Opteron or Xeon processor). Setting up the VM was as easy as on Azure and a few minutes afterwards, I was creating the database and uploading the test data. Once this was completed, the test stored procedure was executed multiple times … and execution times were less than half, on average, than those from Azure and almost as good as with our local SQL Server instances.

All this testing was both reassuring and worrying. For one, it’s clear that there are cloud based offerings that can provide performance that is pretty similar to what can be obtained from in house SQL Server solutions. For our case, however, it seems that Azure is not one of those. We still need to decide what we will do, but the cost / performance factor for Azure based SQL Server solutions is not looking too good. Right now SQL Azure is the only non preview offer and its cost is rather high, for databases larger than 100 MB. Azure SQL VM won’t be a reality until this summer, but while it may provide a more cost effective solution, it’s not clear that it can be a competitive offer, performance wise. Of course, we are considering a rather specific use case, but the overall performance before we changed our model was not that good either and this experience, while not definitive in anyway, does seem to raise the question – are Azure based SQL Server solutions good enough, performance wise? The answer is not clear right now, but it is a bit unsettling to find a competitor’s cloud offerings a better choice than Microsoft’s, on a Microsoft product as relevant as SQL Server.