Saturday, July 7, 2012

Clonezilla, PostgreSQL and General Locking

This morning I got a support call, nothing amazing and perhaps expected.

One of my clients were reporting very slow behavior on adding data to the application. After jumping into my vehicle, deflecting incoming traffic, I saw that the situation was critical indeed.

The puzzle began with a piece of information revealed in the pg_stat_activity table, several queries were queuing up for no reason. Locks were held. Screams were yelled.

This particular client runs a mission critical system on a straighforward Apache/PHP/PostgreSQL 9.0 stack, and this system merrily did it's work until a recent clone and restore using Clonezilla. All was well when after system boot and several tests, until a few days later...

Symptoms for the problem were:

  1. Simple queries taking forever to complete (some of them 5 hours).
  2. Transactional locks were held due to these queries.
  3. Piling up of new queries.

To make a long battle opera short, the eventual desparate solution was to VACUUM the tables that caused the delay.

The dust eventually settled, and all was well.

My recommendation for anybody doing a bare-metal clone and restore of a system running a database, always perform a VACUUM/ANALYZE or equivalent on the database after a full system restore. I thus theorise that clone/restore does not place the data files in exactly the same position.

Thursday, June 9, 2011

The Easy Way to Install TeamViewer 6 on Fedora 15

Step 1: Download the TeamViewer RPM

This step is straight forward. Point your browser to the TeamViewer website, and click on the Download link. Click on the Linux link and you'll be presented with 4 options. Choose the Download rpm option.

TeamViewer Download - http://www.teamviewer.com/en/download/
For this article, I will assume it will be saved in your Downloads folder.

Step 2: Install Wine

TeamViewer is, technically, not a native Linux application. This version is wrapped around a Windows Emulator (wine). At the time of writing this, I had initial trouble installing TeamViewer, however this was fixed by simply installing the Wine from the Fedora repository.

To do this, open a new Terminal and type:

su -c "yum -y install wine"

Sit back, wait, and wait a little bit more for all the libraries to install.

Step 3: Install TeamViewer

Now for the final part, install TeamViewer. This is just as simple, do the following in your terminal:

su -c "yum localinstall /full/path/to/downloaded/teamviewer_linux.rpm"

Again, sit back while the package manager resolves all the dependencies and fetch additional libraries.

Step 4: Use it!

Type in "teamviewer" into your Gnome 3 shell, and viola!




Friday, May 27, 2011

Impressions on Ubuntu 11.04 and Unity

This is not an official review, more of a first impressions article.

After reading up on all the press coverage regarding Unity and Gnome 3, I looked at Linux Mint XFCE. The environment itself is good and functional, however it didn't have the necessary bling that I crave and left me feeling empty and loveless.

I then decided to return back to Ubuntu, a few weeks after the 11.04 release, all sparkle eyed and full of glee. These are my impressions on the latest incarnation of Ubuntu after a week's solid usage:

  1. Unity itself is "okay", and I do appreciate the fact the Canonical is moving away from the boring Gnome 2 desktop.
  2. I've grown accustomed to the new way of running apps. Just press the Super button (a.k.a. "Windows" key) and type the first few letters.
  3. Firefox 4.0 intermittently grinds to a halt on a 4GB system, and silently returns back to normal after a few seconds. Pretty annoying.
  4. I haven't personally used Software Center in ages, as I'm more of a command-line guy. I've come to appreciate the searching functionality within Software Center and using it more extensively to emulate "the common man user experience". I have to admit that it works well, even if it lacks an ETA indicator.
  5. Alt-Tab doesn't always bring up the application list but still works invisibly, so many times I have to guess the sequence of applications that's running.
  6. The theme and backgrounds are fine and suites the environment well.
  7. All the tools I need, e.g. Maven, Netbeans, OpenJDK, PHP, Apache, etc, are updated to very recent versions and runs without glitches.
In short, the new Ubuntu is kind of like a colourful purple version of a Mac, but without the fanboi status and slightly buggy.

Am I sticking to Ubuntu? Definitely not. For now, at least.

I'm now going to do some more distro-hopping and decide. Unity feels fine, Ubuntu runs solidly, and yet it leaves me with a slight fluffy aftertaste on my teeth after drinking too much Cola.