Saturday, 27 July 2013

Virtualization might be answer for PC overloaded by software?

If you are any kind of developer, software or system engineer or just some sort of computer geek, then you have probably found yourself many times with PC so heavily overloaded with many installed apps that you actually do not use. At least not on daily basis. Well, so far, I have been one of those guys. I won't bother you with a list of software installed on my machine but it is certainly really long one.

Well, in cases such as this, there are many inherent drawbacks on system stability and performance. Firstly, and most obviously, you use up lot's of disk space. Secondly, many of those apps, even if you're not actively using them, still might be running in background (fully or partially) thus eating up valuable resources such as CPU and RAM. Then, each new app brings new libraries which are registered in system and which may collide or replace ones that you are actually using in another software...Moreover, if you decide to remove app there is high chance that you will remove some of the libraries needed by other apps (if you're not paying enough attention, of course). Then, today most apps are requesting some sort of update checks, by themselves or by operating system, thus enlarging Internet traffic. Or, should I say unwanted / unnecessary traffic. Moreover, not all applications are perfectly suited for same OS. For example, some apps run better and faster on Linux platform while others run better on Windows machines (not many but...).  Finally, there is myriad of security issues since each new peace of software inherently brings new security vulnerabilities.

What do we then usually do in such cases? Well, most of us will simply try to make a list of apps that we actually use and then perform system re-installation followed by installation and setup of apps from the previously mentioned list. But, wait.... I'm missing one part... Ah, yes.... backup. Come on, who in right mind would simply delete old system, format entire HDD and perform clean installation? So, we create backup which is usually comprehensive one containing all the things we really do and really do not need... Since whole process is really tedious, time consuming and error prone, it is most likely that we will keep multiple backups containing multiple versions... So, as I can testify, we usually end up with huge mess....

I'm in similar situation right now. I have so many projects I'm currently working on so I really do need lot's of stuff. For example, I do need both MySQL db server and Oracle db server, I do need couple of different development tools for different programming languages and technologies and so on.... When I first installed OS on my current machine I really paid attention and tried to install only apps that I really needed. Solution for this was very simple - I would only install app once I needed to actually use it. However, over long period of time (2 years, I'd say) my machine again and inevitably got congested with too many apps... Worst of all, most of them I still do need  and use. And all this lead to huge impact on PC performance.

So, while I was doing my regular mitigation process - configuring system startup processes ensuring that only basic processes are being started automatically while all others require manual startup, I came up with one idea. Certainly not new one but...still... I realized, firstly, that manually starting and than later stopping processes is not something I favor doing on daily basis. But, more importantly, I realized that I actually use only few apps / services together at any given time. For example, if I need to develop some feature for one client, I'm using only NetBeans and Oracle... In other case, it is Eclipse and MySQL... In third one it is something else... Hm.... So, I figured out new policy that I'm putting to the test. Instead of installing all apps on single system, and then switching them on and off depending on the current needs, I'm planing to create one virtual machine for each environment I need. Services, like database servers, that I use in several different environments, will have separate virtual machines... Now, instead of using apps directly on base OS, I will use base OS only to host different environments and services I need. Host OS will be basic and will contain only appropriate VM server runing VMs. There are many free virtualization engines out there (VirtualBox, free VMware Player and so on) so it should be free, easy and straight forward process.

So, what should I gain with this? Yes, virtualization brings some overhead but I have found several benefits in this approach. Firstly, now I'm able to clearly segregate different environments and processes that I use and tune them up individually without effecting other environments and processes. Each VM can be individually and separately tuned to have best possible performance for that specific environment - without a single unnecessary app / service. And, even more important, I won't have to change them or install anything temporary on them ever again unless I really need to. Let's say that I will have to start using PostgreSQL in the future because new client uses it. With single OS, I would have to install it along side other 3 DBs I already have. With VMs strategy, it is no longer a problem - I will simply create new virtual machine for it. Secondly, testing various options becomes easier still - I can use VM cloning to duplicate environment I wish to test with different settings / features and still have original one for comparison as well as for clean backup purposes if new one turns out to be dead-end. Then, there is migration. Once my current PC gets to old and I wish to replace it with a new one, I can easily migrate all VMs in a matter of literally minutes. Moreover, this partially solves scalability problems as well. If needs of any of the environments grow up above capabilities of my current machine I can easily move single service or environment to different hardware quite easily.

So, there you have it. Simple theory why I strongly believe that virtualization might be answer for persons like me.

Well, I guess, after explaining it all, I'd better go now and create and configure all those environments and services I need... And, if everything goes according to plan, I might get back again with some new tips and experience...







No comments: