Cleaning up your WSUS Server

The situation

I’ve a WSUS server that is up and running for last 2 years, it runs on a HP Proliant Microserver where I have a domain controller for my test lab. The purpose of WSUS Server is reducing download time for updates when I install test VMs. I’ve lots of Test VM, and the time needed to download updates is really great, so I’ve decided to configure a WSUS server to mitigate that problem.

Since I really do not need to do a fine grained management for a real production environment, I’ve setup my WSUS server to download almost every update, for 2 years I only approved updates without any further management, and one day my WSUS server became so slow that console crashes 90% of the time and I’m not able anymore to approve new updates.

Time to clean up!!

There are a lot of great articles in the internet on how to clean up a WSUS Server, I just want to share with you my experience to make you avoid my mistakes and have your WSUS server fully operational in the least time possible.

Move to a better hardware

My experience was: if your WSUS server is slowed down too much, there is no way you can recover it without moving to a new hardware.

To give you an extent of what I’m saying, launching standard cleanup on my WSUS Server, reached almost 20% in 24 hours, when moved on fast hardware the whole operation took 8 hours. If WSUS is virtualized, do a temporary move of the VM to a new hardware with faster cpu and SSD, but in reality you can simply move your DB to a faster hardware and you are ready to go.

The goal is: moving DB to fastest machine in your network, do maintenance, then move database back to original WSUS location. There are tons of resources on how to move your database on new hardware, this is the link I’ve followed and it is just a matter of installing SQL management studio, detatch your db, and re-attach on a new SQL Instance.

Be sure that your destination SQL Server is the Very Same Version of the one used by your original WSUS Installation

When you connect to your original WSUS Database (in Windows server 2012 R2 instance name is

\\.\pipe\Microsoft##WID\tsql\query issue a Select @@version to verify sql server version (in my situation is 2012). Since cleanup operations use at most one cpu on DB Server (at least in my situation) I moved db on an i7 2600K overclocked to 4.2 GHz with a Samsung 840 SSD Disk. During cleanup operations sqlserver.exe used only a single core, so I suggest you to move your db to a machine with poweful CPU.

Be sure that the machine with temporary SQL Server installation is joined to the domain or you will not be able to access the database from WSUS Machine.

In order to be 100% sure that WSUS machine is able to access database, configure the machine where WSUS is running as admin of temporary SQL Server.

User configuration for WSUS Server in Sql SErver.

Figure 1: Neuromancer is the computer running WSUS and is added as a login identity to SQL Server to make WSUS Service (that is running as network service) being able to reach SQL Running in another machine of the domain

Rebuild your indexes

You can find instruction at this address on how to rebuild all of your indexes of your WSUS DB. With 11 GB db the whole operation on a SSD took no more than 15 minutes. This operation is really important, because if some index is greatly fragmented, all cleanup operations will be really slow.

What to cleanup

The very first and fundamental technique is avoiding download drivers update.

There is absolutely no need to let WSUS manage drivers update, in my system, after I removed drivers updates, my total number of updates dropped from 62000 to 12000.

If you read articles in the internet, you can believe that there is no way to really delete an update from WSUS, you can only decline it, but it will remain on database. This is true if you are using the user interface with MMC, but if you use powershell you can run a little script that remove all the updates of type drivers from your system. In that article the describe a technique to remove update directly from database; I absolutely discourage you to use this technique because you can potentially destroy everything. At the end of the article you can find a simple Powershell Script that is capable of removing updates from WSUS in a supported way.

[reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration")
$wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer();
$wsus.GetUpdates() | Where {$_.UpdateClassificationTitle -eq 'Drivers'} | ForEach-Object {$wsus.DeleteUpdate($_.Id.UpdateId.ToString()); Write-Host $_.Title removed }

This script can require days to run in a standard machine. Thanks to fast CPU and SSD, my 40000 drivers where deleted in almost 9 hours. This will certify the need to temporary move DB to a really fast machine.

This script is useful also to remove updates related to removed classifications. As an example, now that Windows XP is out of support, if you do not have any Windows XP machine in your lab, you can remove XP from classification and can run the script to remove all updates that refers to windows XP. So please review all of your classifications to reduce the number of approved updates.

Finally, you can also use the script to delete all the updates that are declined and superseded by other updates . Once you finish removing all unnecessary updates, your WSUS Server should be really faster.

Final cleanup

After you removed all unnecessary updates, you should do a standard WSUS Cleanup Wizard, followed by another full rebuild of all indexes, then everything is ok.

Another suggested option is defragmenting the drive where WSUS DB is located, an operation that can be done after you stopped the instance that is using DB. If you followed my suggestion of moving your DB to a better hardware, I suggest to move the database to a drive with plenty of space in your WSUS Server.

In my situation C: Drive is 120 GB of space and has 50 GB free. After all cleanup operation are finished, I detatched DB from temporary location and decided to move the file on a 2 TB drive that has 1 TB Free. With that amount of free space, after the copy database files are completely defragmented.

Now my WSUS Server is operational again.

Gian Maria

Windows Server 2012 R2 switching to AHCI after installation

I’ve installed some weeks ago a new server, and at the time of installation I did the really bad error of not fully checking BIOS settings. This week I moved a couple of SSD to that server, because it will be used for virtualization, and I did noticed that my Vertex 4 is performing really slower respect the original system, so I immediately checked and verified that I forgot to enable AHCI in the BIOS.

SHAME ON ME!!!!!

If you ever had this problem in the past, you knows that if you simply reboot your machine, enable AHCI in the BIOS and reboot again in Windows you will be welcomed with a beautiful Blue Screen telling you that the system is not able to boot.

With windows server 2012 I found that a reboot in Safe Mode is enough. Just reboot the machine, enter in the BIOS, then enable AHCI for my motherboard then reboot again. Now press F8 to open windows boot menu and choose Safe Mode, the system should boot correctly.

Now simply reboot in standard mode and everything should work correctly. At least it worked in my system.

Gian Maria.

Samsung EVO 840 500GB VS OCZ Vertex 4 256GB

I’ve decided to move to a 500 GB SSD to have plenty of space to store my virtual machines. At the time of the decision, Samsung EVO was the better option. I’ve posted in the past benchmarks for my Vertex4 256 GB

And I was really curious about performance of Samsung EVO. Vertex 4 has a real impressive write speed, even if after one year of use if you test it again you can find a decrease in performance. Running test on the Evo gave me these results.

image

Actually it seems to outperform the Vertex 4 and this makes me really happy, because I feared that the Evo would have been a little slower in writes than Vertex 4, but it seems to be surely comparable. This test was also done with a 500MB file size while the original Vertex 4 test has 100MB file size, for the sake of comparison I decided to run another test with the same 100MB setting, but the result is substantially the same (little standard fluctuation of numbers)

Samsung has also a nice feature in his Magician software for Evo SSD, that can actually use system RAM to further improve performance of SSD. Magician software has also a nice feature to upgrade firmware of the SSD directly from your Windows operating system even if it is system disk. Creating a bootable CD or Usb stick with firmware update program is not a big problem, but pressing a button and having your firmware update is a nice facility.

After updating firmware and some OS optimization suggested by magician software I re-run the test again, just to see if there is anything changed (I’m not expecting any substantial changes). Here is the result if you are curious.

image

As expected the data are substantially the same, some little fluctuation are quite standard. Then I decided to enable Rapid mode, a technique that uses computer RAM to accelerate disk operations. I perfectly know that such kind of optimization should be tested in everyday use, but I decided to have another run of CrystalDiskMark to understand what happened. Here is the result

image

I really must admit that I found difficult to really squeeze something out of this numbers, the increment in the diskmark is probably due to how the test is performed and I doubt that this is a “real” improvement in the everyday use, but I’ll leave it enabled just to understand if I’ll perceive some “change” respect having it not activated.

Gian Maria.

Upgrade HP Proliant Microserver N54L Gen7 to Windows Server 2012 troubleshoot

Sadly enough if you try to upgrade your Proliant Microserver N54L (or N40L) to Windows Server 2012 R2 you probably got stuck after the third reboot at 84% when it is time to install computer devices. The problem is caused by the NIC firmare that is not compatible with Server 2012 R2. Luckly enough, HP just released a patch of the firmware to address this problem, you can find more info in the last post of this thread.

Actually the new bios is this one.

SOFTPAQ NUMBER:  SP64420
PART NUMBER: N/A
FILE NAME:  SP64420.EXE
TITLE:  System ROMPaq Firmware Upgrade for HP ProLiant MicroServer Servers (For USB Key-Media).
VERSION:  2013.10.01A
LANGUAGE:  English
ROM FAMILY: O41
REVISION: A

And it fixes the incompatibilities with R2 version of Windows Server, if you are interested the direct link of the download is here. The cool part is that the upgrade is really simple, the download contains an utility that will create a bootable usb stick that will do the automatic upgrade for you, just create the usb key, reboot the server with the usb stick installed and you will see upgrade routine that will automatically flash your bios. When you reboot you should see the new date of the bios

2013.10.01 (A) 15 Nov 2013

Now you should insert your Windows Server R2 disk or iso image and you can proceed with a standard installation, everything should go smooth and you can enjoy latest version of MS Server operating system.

Gian Maria.

Really impressed by AspNix web hosting

I needed to move my blog on another hosting quickly, and I was puzzled on what hosting to choose. Since I had no much time to evaluate a series of alternative, I asked to some friends for an hosting that have monthly billing and they directed me towards aspnix. Since I had no time to evaluate alternatives my plan was to move the blog on a cheap monthly plan then evaluate alternatives. I choose  the Windows Starter Web Hosting, it costs $3.00 at each month but I had also a discount coupon so I paid $2.20 for each month.

Since the host was really really cheap and it is a shared hosting, I expected performances to degrade, but I was really surprised that my blog responded really fast, it seemed faster than previous hosting (a dedicated VM). After one month I was really surprised looking at Google Webmaster tools, because the decrease in response time was really huge and not only my impression.

image

You can surely notice that the time needed to download a page decreased when I moved to aspnix. I’m so happy with it that I’ve decided not to spent time evaluating anything else, and for $2.20 month I can host multiple domains, amazing. I never expected that a cheap and shared hosting would give me better performance than a dedicated VM.

I must admit that AspNix really Rocks!!!!!

Gian Maria.