Archive for the ‘Linux’ Category

Moving Blog to Home Server

Sunday, February 3rd, 2008

I have been running this blog on a slicehost VPS with excellent results so far. However, I am at the point where I need a bit more flexibility and I can’t justify the $20 monthly fee to my home CFO. So, I did setup myself to move the server back home this weekend, where funny enough, I used to host this blog.

The first choice came down to choice of OS. I had been running Gentoo, but I have found this distribution bad for very low spec hardware. I am running on a fanless and rather exotic VIA C3 533Mhz chip, and compiling packages isn’t particularly a fast thing on this box. I tried Gentoo a couple of years back on it, and getting gcc to compile would take a couple of days. Plus at some point it stopped working because of not sufficient memory.

Going through the choices I hesitated for a while with FreeBSD, but lack of good references for my CPU made me look at the Linux side, where I considered CentOS5, Debian and Ubuntu. I did not like CentOS RPMs - I don’t any value-added on top of RHEL, and it feels odd to go free beer, but not free speech. That left Debian vs Ubuntu.

Whereas I have been relatively happy with Ubuntu as my laptop’s OS for the last three years, I don’t think Ubuntu has the necessary levels of testing required to “certify” a server OS. So I picked Debian, but instead of running stable (etch), I decided to go for test (lenny). Not as aggressive as Ubuntu, which is based on unstable (sid). Additionally, some packages I need (e.g. gmp for php) were not available in Etch.

So far, setting up the box to replicate the slicehost configuration has been relatively easy, with the exception of the MTA/IMAP which is always a pain. Have I had more memory and CPU I would have installed Zimbra. But since I am not sure my home CFO is going to be very impressed with me asking for yet another computer, I think I’ll pass on Zimbra for now.

The initial install out of a bootable USB went without complications picking a basic setup, after which I added MySQL, Apache, PHP, Postfix and Cyrus. I prefer to add the stack by hand, to control exactly what gets installed. Finally, the upgrade to lenny was also extremely smooth.

I have now finished reconfiguring all DNS records to point to my public static IP (ADSL), which works great from the outside, but mixes things up while trying to access servers from the home network. I have figured out I’ll have to setup a DNS server and overwrite the domains I serve and forward up to the ISPs everything else, but I wish there was an easier way of doing this. Yes, I could hack /etc/hosts, but I won’t. The other downside of running at home is lack of reverse DNS lookups, but I think I can live with it.

In conclusion, I am overall extremely pleased with Debian, like I was with Ubuntu. I hope a few months of service, and I’ll still be happy with it.

Will Nokia change Trolltech’s Qt GPL licensing?

Tuesday, January 29th, 2008

It seems like it’s open source buying season, with now Nokia buying Trolltech. I feel very happy for the Trolltech folks. We already talked about it, that Trolltech needed some fresh funding to change its business model.

Since my first EPOC apps on a then Nokia Communicator prototype phone back in 2000, I have never been a Symbian fan (Symbian’s SDK custom half-baked toolchain, the libraries solving C++ problems that should be left to the compiler, and most importantly, not running on Linux have always put me back from Symbian). Qt, is by far, the best UI toolkit, but Qt has not grown to its full potential because of it being GPL.

And, the question to me really is, will Nokia change the licensing of Qtopia? I certainly hope so, otherwise it will be really hard for mobile app developers to invest on this platform, especially in light of the competition from Symbian, .NET and Java platforms.

Why Trolltech’s Qt GPL license is hurting the Linux desktop

Monday, August 20th, 2007

After my move away from Gnome and Evolution, I have now been running KDE for three weeks straight and still going. I have found KDE to be a surprisingly stable and reliable platform. It’s hard to find something to criticize in KDE. It’s a really nice desktop setup: well oiled machinery where everything seems to run smoothly. Inter-application communication and integration of all the KDE applications is simply superb, and I don’t think there is any other desktop out there, proprietary or open source, where you can see such tight integration of its parts. And this is mainly thanks to Trolltech’s fantastic toolkit, Qt

Qt is a first class toolkit which has turned to be be a fantastic choice for KDE. Qt is probably the best graphical and utilities programming toolkit that truly looks like a native application on any target desktop: OS X, Windows or KDE. Developer productivity is probably as good as you can get with a C++ toolkit. However, Qt is GPL, and a GPL toolkit library is not a good thing if you are looking for mass adoption.

Qt’s commercial non-GPL license fee is actually not high at all, and most professional developers and software houses should be able to buy the licenses. The problem however is that if you start using the GPL version and then you figure out you want to go proprietary, you simply can’t. You must buy the Qt commercial license upfront. The problem lies with the grassroot developers: they won’t pay for the commercial license since the prospect of revenue is non-existent in the beginning.  When individual developers are faced with writing an application, many will avoid Qt because of its viral licensing nature. As a developer you want to have the choice of whether to make your app GPL or not, you don’t want your choice to be restricted by a license. Some of those grassroot developers turn to be writting the most popular applications for Linux, such as Mozilla Firefox, Gaim/Pidgin, OpenOffice, Evolution, etc. Guess what, the leading office, personal information management and groupware applications don’t run on Qt. And that’s where the users (and the money) is.

Many open source software houses sell software that is not GPL, and derive their revenues from support contracts and some professional services. It’s surprising that to date Trolltech has not moved in this direction and introduced a more commercially friendly license for Qt. This would be a complete change to Trolltech’s business model, and the dramatic increase in developers entering into support contracts for Qt would quickly offset any short-term loss of revenue from traditional licensing fees.

Sadly, it might be almost too late for Qt: Gtk+ has matured to become a good-enough toolkit, and although not yet as stable and tightly integrated as Qt, Gtk+ is sufficiently portable and usable. We have today because of that two opposed Linux desktop communities, with neither having sufficient momentum to be competitive with Aqua or Aero. It’s sad to see how and why Linux has lost the desktop war. The community had a unique chance to make Linux a valid choice for the desktop OS, especially with Microsoft leaving such a big gap between Windows XP and Windows Vista. Linux missed it and Apple took it to its advantage. If the Linux desktop had united forces years ago, Trolltech might had become the next Apple.

Perhaps it’s not too late. I am challenging Trolltech to license Qt on a royalty free commercially friendly license. I am challening the Gnome community to consider a radical merge onto Qt and KDE. I am challening the KDE community to open its arms towards the Gnome developers and the Gnome software. We can still make GKNOME a success.

Three Weeks of KDE, Too Much Configuration

Monday, August 20th, 2007

After moving to KDE three weeks ago now, I am staying. At least for now. If I had to pick on something, my main point for feedback would be that the graphical user interface feels crowded, and its usage metaphors, albeit consistent, are rather complicated.

In KDE, configuration options are scattered all around the place. KDE is a great platform for the power user, familiar with tweaking and working with plenty of configuration options, but for the rest of us who just want to get on using the applications and not waste our time fighting with configuration options, a simpler paradigm for desktop and programs alike would be more useful. That simplicity is one of the design goals of Gnome: sane defaults, clean UI and few configuration options. Unfortunately Gnome has gone too far, and makes it sometimes either impossible or very hard for the power user to configure the desktop or an application to its own liking. While preserving for KDE’s power users the current ability to configure practically anything, the majority of users would however benefit from a cleaner and more modern user interface metaphor.

A week of KDE (killall evolution-data-server)

Friday, August 3rd, 2007

See, I can live with Evolution crashing once in a while. Hell, it’s software, it’s meant to fail. But another thing is when the whole damn thing fails silently and in consequence kills your productivity. Evolution has managed to randomly delete part of my calendars, appointments here and there, and multiple appointments moved in time. End result, missing meetings and looking like a complete idiot. The top of the iceberg happened on Monday when Evolution corrupted one of IMAP folders. Ouch! Pain, I know, I hear you.

I am off Evolution. evolution-data-server is just waaaaaaaaay too buggy. Sometimes I wonder if Novell buying Ximian was actually such a good thing … but anyway that’s another story.

What I am using now? Shh, don’t tell anyone! Kontact, KAnything, KThis, KThat, KSomethingElse … KDE!

Being a Mono/GNOME fanboy, I have set myself a challenge: only use KDE and stick to native KDE apps for a week. Well … I really meant to stick to Konqueror, but after 10 min I had to give up on that - I had forgotten the web does not run on standards - or does it?.

For the good news, I am feeling (surprisingly) productive. KDE apps are extremely well integrated with each other. There is a continous flow of information, your data is easily shared. I actually feel good. Call it Productivity Pr0n.

One thing I am missing badly is something like Tomboy, the Gtk#/Mono personal Wiki. I am trying Basket instead, which happens to be tighly integrated into KOffice. Unfortunately I have not managed to get beagle to index basket notes. I actually tried strigi instead of beagle, but it failed to index 50% of my docs because they were not UTF-8 or latin1. Plus strigi had no stemming. Oh, and that it core dumped at 120k docs … Guys, better fix that for KDE4!

The worse side of KDE so far is configuring anything K related - it is an authentic nightmare! I know it’s intentional, but, really, it’s not my metaphore. I would be happier with sane defaults and not seeing all those other 3 zillion configuration options. I love to have them, but hidden. On KDE’s behalf, KDE actually let’s you configure stuff that you just can’t in Gnome (a good thing). The problem is that you need to be the developer to know which combination of options gets you what you want!

Anyway, I am quite happy so far. Some of the KDE apps, kick ass big time. And my calendar events are not silently flying off all around the place.

Oh, and remember:

$ evolution --force-shutdown

Memory-lean nginx on a VPS

Tuesday, May 8th, 2007

I spent this weekend testing and installing nginx and I have said Adios to Apache! Let me tell you why I have done that.

I am running this blog on a slicehost.com 256Mb Xen VPS, using WordPress. I have been using Apache 2.2 for almost a year now without any problems. But recently I deployed a little Ruby on Rails application using mongrel for my wife’s business, and then suddenly I ran out of memory. Each Apache worker was easily taking 15 to 20Mb, even with a really cut-down configuration and built on Gentoo. With three Mongrel backends and the MySQL server I was starting to swap to disk.

I tried FastCGI instead of Mongrel, but it only cut down from about 50Mb to 40Mb for each process, not enough really to make a difference. I had to trim the fat out of the web server.

So about dropping Apache. First I considered Pound as a load balancer, but given that I would also still need a web server for static content in Rails (not wanting to serve that with Mongrel) I decided to look for alternatives.

Lighty and FastCGI tests did not even complete, so I gave up on Lighty. The FastCGI processes were becoming Zombie for some unknown reason.

Then I tried nginx. I have 5 workers, each consuming around 3Mb. Wow … I call that Spring savings.

nginx is sending all blog traffic to a couple of php-cgi handlers. I tried both TCP and Unix sockets, but went for TCP since I was getting dropped requests and stalling processes for Unix sockets. php-cgi is not very fast, but it’s stable and it has a reduced memory footprint.

Then nginx is acting as a reverse proxy and balancing across 3 Mongrels. I tried also FastCGI, but again it’s not stable.

And man is this thing flying or what!? I have enough memory spare to make MySQL happy. Plus I am caching a lot of Rails generated content that nginx serves happily.

Now, some numbers from Apache Benchmark (running on Linux 2.6.16.29-xen #3 SMP, x86_64 Dual Core AMD Opteron(tm) Processor 265 AuthenticAMD GNU/Linux, Xen host with 256Mb):
nginx + pure HTML content:


Concurrency Level: 50
Time taken for tests: 0.96657 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Requests per second: 10345.86 [#/sec] (mean)
Time per request: 4.833 [ms] (mean)
Time per request: 0.097 [ms] (mean, across all concurrent requests)

nginx + php Wordpress home page (not cached, no APC):

Concurrency Level: 50
Time taken for tests: 192.387414 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Requests per second: 5.20 [#/sec] (mean)
Time per request: 9619.371 [ms] (mean)
Time per request: 192.387 [ms] (mean, across all concurrent requests)

nginx + mongrel (not cached):

Concurrency Level: 50
Time taken for tests: 8.290116 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Requests per second: 120.63 [#/sec] (mean)
Time per request: 414.506 [ms] (mean)
Time per request: 8.290 [ms] (mean, across all concurrent requests)

Sure, it’s not a scientific test by any means, but it tells you something. And so far, no complains. If I ever outgrow the server, I can always get Pound on front of a couple of nginx web servers.

Gnome Hack Idea: FreeMind, Tomboy and EDS

Friday, April 27th, 2007

I take notes in meetings using FreeMind. Every time I identify a task I mark the node down using an icon and after the meeting I follow up creating the necessary tasks in Evolution. I would like to be able to link my mindmaps to tasks in Evolution. Hopefully it can be done using FreeMind, or perhaps we need to invest in Psycho or something similar tighter to the Gnome desktop. If we decide not to use FreeMind, the tool of choice should use FreeMind’s XML schema to ensure interoperability with folks running other desktops.

Sometimes there is a node in the mindmap I would like to expand into a Tomboy desktop wiki page. Right now, I have to create the node on Tomboy and write down a reference in the mindmap with the URL to the wiki page.

Sometimes I am writing in Tomboy and I identify tasks required to follow up the note. I would like to create a wiki link to the task in EDS.

And of course, I would like to see my tasks in EDS, and be able to link back to FreeMind and Tomboy.

Microsoft Office has a similar feature.

How do we do that for the Gnome world?