Pacemaker/Corosync/OpenAIS/OCFS2 for Ubuntu 10.04

February 7th, 2010 Ante Karamatić

Couple of days/weeks ago I’ve issued call for testing of new cluster stack for Ubuntu 10.04. At that time, most of the stack was finished, but we lacked proper support for clustered file system. Now, I’ve modified ocfs2-tools package so that it compiles with support for libdlm (provided by redhat-cluster) and pacemaker. I’ve also modified redhat-cluster package so that it builds with support for pacemaker.

As a result, there is now a new test case which needs testing - cluster with drbd for underlying device and ocfs2 as a filesystem. So, please visit - https://wiki.ubuntu.com/ClusterStack/LucidTesting#Pacemaker, drbd8 and OCFS2 and give it a go.

After completing this milestone, only thing left for proper cluster stack in Ubuntu 10.04 is submitting MIRs (Main Inclusion Requests) for packages that are still in universe and demoting cman (and others) to universe.

For those that would like to test their own setups and are familiar with corosync/pacemaker/drbd8/ocfs2, ubuntu-ha’s PPA is located here: https://edge.launchpad.net/~ubuntu-ha/+archive/lucid-cluster/.

Is this for real?

January 12th, 2010 Ante Karamatić

When I was in high school, during IT classes we worked with DOS, WordPerfect for DOS and BASIC. When my sister showed me her school textbook ‘Information technologies for gymnasium’, I was expecting tons of Windows screenshots. But, I was surprised. Look at those:

Wow! Not only there are Ubuntu screenshots and big Wilber, no… The textbook explains what is Open Source, what are proprietary operating systems. You can even find words like FreeBSD, NetBSD, EXT2, EXT3, UFS :) They equally provide space for Microsoft Windows Vista, XP and Ubuntu Linux (no MacOSX). Granted, in the office section, they explain how to work with MS Office tools, but they acknowledge existence of OpenOffice.org, quoting ‘We were attracted by Microsoft Office 2007 and OpenOffice.org.’, providing links to OpenOffice.org (on each chapter about office tools) and manuals.

And that big Wilber isn’t just to fill in space - they actually have 10 pages long ‘manual’ on how to use basic GiMP tools! There’s no Photoshop section in the book. Only GiMP for bitmap editing - and it’s even provided on the DVD shipped with the book.

Gvozadnović, Ikica, Kos, Miljaš, Srnec, Sekulić-Štivčević, Zvonarek (authors of the textbook) - you really surprised me and kudos for this great textbook. If you can read Croatian, take a look at http://www.propyx.com/udzbenik/izbornik.

Call for testing: Cluster components of Ubuntu 10.04

January 11th, 2010 Ante Karamatić

There was a discussion, at the last UDS, about cluster stack in Ubuntu 10.04 and later. Blueprint is located here. According to that spec, I’ve created packages for cluster-glue, cluster-agents, heartbeat, corosync, openais, pacemaker, keepalived, drbd and redhat-cluster.

Some of these packages are based on stuff Martin Loschwitz did and some are merged from Debian. Most of them have serious changes in packaging, but all of them are latest upstream version (except keepalived).

Now that those are packaged, we need help with testing. So, please, help us test those components. Choose redhat-cluster or pacemaker as a cluster stack. Combine with DRBD, KVM or Xen and try to break them. In a day or two, I’ll set up a wiki page with configuration instructions for these tools, so anybody could test it. Input from upstream is also welcome.

Packages are located at ubuntu-ha PPA: https://edge.launchpad.net/~ubuntu-ha/+archive/ppa/+packages

Packages are created only for 10.04, Ubuntu Lucid Lynx.

UTF8 collation support for Croatian, Bosnian and Serbian (latin) in MariaDB/MySQL

November 29th, 2009 Ante Karamatić

There has been a long lasting problem of collation in MySQL for Croatian language - it was impossible. When, at that time, Yugoslavian keyboard layout was invented, it was designed to cover all the languages from all republics. It covered all Slovenian characters (plus couple of characters that they don’t have), but not all Croatian (it missed ‘nj’, ‘lj’ and ‘dž’). When Yugoslavia fall apart, all the republics just took already wide spread Yugoslav layout. For Slovenian layout, that was great, with exception of including characters they didn’t have. For Croatian and Serbian latin, well, not that great…

You see, now we type letter ‘nj’ as a combination of ‘n’ and ‘j’. Same thing with ‘lj’ and ‘dž’. That wouldn’t be that bad if every word, containing ‘l’ or ‘n’ and ‘j’ together would be pronounced as ‘lj’ or ‘nj’. For example, we have two words that we write the same (injekcija), but pronounce different. In one case with say it with ‘nj’, and in the other as ‘n’ and ‘j’. Talking about the bad choice of deciding to use ‘nj’ as a character for that letter. There are also examples of ‘dž’.

As you can see, until we put ‘lj’ and ‘nj’ characters on the keyboard, we will never have correct sorting in any database. Good news is that those characters exists in Unicode and that’s why we have ‘hr unicode’ layout in Xorg. Too bad nobody uses it.

Until that’s sorted out, I’m happy to announce that MariaDB/MySQL just accepted a patch that makes possible contracting non-ascii characters, meaning that we can now have sorting rules for ‘dž’ (more about that at http://www.collation-charts.org/articles/croatian.htm). As a result, utf8_croatian_ci and ucs2_croatian_ci collations were created and added to MariaDB 5.1 and MySQL 5.6. Since Alexander Barkov was so kind and provided a patch for MySQL 5.1, I’ve created packages for Ubuntu. I’ve also modified that patch so that it works with MySQL 5.0. If you need this feature, go add my PPA to your sources.list:

https://edge.launchpad.net/~ivoks/+archive/mysql-hr/

It’s important to realize that this patch contains very intrusive change in collation mechanism, so it’s not just a patch for Croatian collation. People from Bosnia and Herzegovina, Monte Negro and Serbia (latin) can also use this collation for their languages. It does not cover all problems (’injekcija’ and ‘injekcija’ for example), but at least words starting with dž won’t be at the end of the sort :)

Big thanks to MariaDB community!

10 seconds boot is already here!

June 3rd, 2009 Ante Karamatić

Hardware: Lenovo X200s with Mushkin Europe 2 120GB SSD instead of default Seagate 5000rpm disk. Boot to fully functional (default) Jaunty desktop from cold start (powered off) is less than 30 seconds. If BIOS, grub and kernel/initrd loading are excluded, boot time is less than 10 seconds.

Video:

http://www.init.hr/dev/fast-boot.mp4

Except the automatic login in gdm there were *no* other changes in Ubuntu.

UDS so far…

May 27th, 2009 Ante Karamatić

There were lots of great sessions so far. Much more than on previous UDS and I think this approach of multiple sessions from same track is actually working quite well. There’s also a bit ‘human’ feeling cause we don’t have all the guards watching our every move, as we had at Mountain View. Bottom line, I really like it. Hopefully, there’ll be even more results after it, than it was after previous ones.

But, the best move Canonical did this time was bringing design team. It’s very important to actually be able to get into contact with people that do design for a living. That way they can see our usability problems and we can get advice how to solve them. Having design teams as part of community is major step for open source. After all, we all have the same goal.

Congratulations everyone!

April 23rd, 2009 Ante Karamatić

Looking forward

April 17th, 2009 Ante Karamatić

Step by step, with 9.04 Ubuntu conquered another peek. It finally went up into the clouds. We could stop here and enjoy our glory, but there are higher peeks to conquer. Achieving higher goals is harder, more dangerous, but also provides more glory, and what’s more important, it gives us more satisfaction.

looking-forward

If we are going to tackle higher goals, we’ll need you and your ideas. Only together we can go even higher. So, visit http://brainstorm.ubuntu.com/server/ and give us some ideas, let’s push 9.10 above the clouds!

Let’s clear some FUD :)

April 14th, 2009 Ante Karamatić

Ronald McCarty wrote an article ‘Your Distro is Insecure: Ubuntu’.

This is an answer to some of claims he stated.

Ronald starts with some valid points about default directory permissions. Right, we choosed 0755. There are valid use cases for 0700 and 0755. It’s impossible to set up a fit-for-all solution.

Next claim is that Ubuntu supports IMAP2 and POP2. Too bad Ronald can’t read netstat’s output correctly. Ubuntu (it’s actually dovecot we talking about here) doesn’t support POP2 and IMAP2. What Ubuntu/deovecot supports are IMAP4rev1 and POP3.

Before making this claims, author should know that IMAP4 is an extension of IMAP2, so it uses the same port as imap2. As you can’t define multiple names to one port in /etc/services, sane practice is to put imap2 there. netstat reads /etc/services and then claims that protocol is imap2.

Following this is claim that Ubuntu opens bootpc and bootps UDP ports when there’s a static network configuration. bootpc is clear sign that you have a running dhclient, Ronald. If you configured your network to a static IP during installation, you won’t have dhclient running. bootps, on the other hand, is a clear sign someone is running dhcp server.

So, while there are some valid points in that article, author should know better before writing articles like this one.

Why was(is) lighttpd slower?

March 10th, 2009 Ante Karamatić

In my last blog post I wrote about problems with common web server stress tests. Even though I wanted to talk about KVM vs. hardware setups, it seams that most of that post is related to comparing apache and lighttpd. Since I didn’t do proper testing of lighttpd and apache, I’ve decided to do that now. I’ve tested performance of these two when delivering static content (html, jpegs, gifs, docs, etc…).

For start, let me introduce you to a hardware and software used. It’s a Dell PowerEdge T300 with Intel Xeon Quad Core X3323 processor and 6GB of RAM. Disks are in software mirror, but that’s not relevant for this test. Operating system used is Ubuntu 9.04 (still unreleased), 64bit version. Version of lighttpd in Ubuntu 9.04 is 1.4.19, while apache is 2.2.11. Tools used for testing were ab and siege. All software was acquired from Ubuntu repositories for 9.04, with no configuration changes (other than those mentioned in text). I did 6 tests with siege for every setup, removed the worst and the best score and calculated average on remaining four. With ab I did just one test, since those tests are, IMO, flawed anyway (ab by it self isn’t flawed, it’s just misued by lots of people).

AB

For my first test, I disabled three cores, so that I could simulate tests which most people do. In my last blog I explained why I consider them flawed. Seriously flawed. So, for first test I started ‘ab -n 10000 -c 25 http://localhost/index.htm’. index.htm is very simple file, size of 4KB. I used plain default configuration for lighttpd and apache2-mpm-prefork. Results are favoring lighttpd:

ab test against apache prefork and lighttpdWhile these tests, IMO, don’t mean a thing, I went with a flow and did the same test with all four cores. For that test, I had to tweak lighttpd’s configuration. As mentioned at lighttpd’s wiki, lighttpd doesn’t like SMP very much. Among problems mentioned on this site, idea of corrupting access logs was horrible. Since this was testing anyway, I didn’t care about that, and access logs weren’t corrupted in the end. I’ve also did more tweaking, according to performance docs. So, finally, I added:

server.max-keep-alive-requests = 4
server.max-keep-alive-idle = 4
server.event-handler = “linux-sysepoll”
server.network-backend = “linux-sendfile”
server.max-fds = 2048
server.stat-cache-engine = “simple”
server.max-worker = 8

to lighttpd’s configuration. Next, for Apache, I’ve enabled disk_cache module, just to level it with lighttpd, which does caching by default. Since Apache scales on SMP by default, no other changes were made to its configuration. I’ve also tested Apache Worker MPM. The test again showed that lighttpd is faster in serving 10000 copies of the same file:

ab test against lighttpd and apache MPMs

SIEGE

When you are noticing problems with your current web server setup, it’s wise to have some statistical data of most visited sites. With that data you can create a list of URLs which you’ll use for testing your new setup. So, if index.htm is 20% of requests on your site, you’ll create a file that will have index.htm as 20% of its content. It’s also good to have some tool for testing which will randomize requests - I use siege for that. URLs in these file, in my test, were from couple of bytes to 0,25MB). In the absence of the gigabit switch, I used localhost for testing (most people do tests that way, even though that’s wrong, but let’s go with a flow). Again I removed three cores from my system and removed SMP tweaking in lighttpd. Results are:

siege against lighttpd and apacheAs you can see, Apache worker with cache in memory is slower then lighttpd and Apache worker with cache on disk. I must admit, I wasn’t expecting that. Even Apache worker (without cache at all) is faster than Apache worker with cache in memory. But, let’s leave worker/mem in the dust, where it belongs. Even the fact that Apache delivered more requests per second than lighttpd isn’t quite important here. What’s really important isn’t shown in this graph, but in a ODS with raw data. Lighttpd didn’t finish single test. After ~40 seconds it just gave up serving content. I still haven’t figured out why this happens. But, anyway, I used the data collected while it was serving content.

Now, the same test with all four cores. I’ve again added support for SMP to lighttpd and again haven’t changed a thing in Apache’s configuration (except enabling cache). Results are similar to those of one core:

siege against lighttpd and apacheIt’s noticeable that Apache worker with cache in memory scaled much better than lighttpd and even Apache worker with cache on disk. That was expected, since I even raised a bar of having 100 concurrent connections, instead of just 25 on single core. One could probably squize more req/s from Apache with tweaking of ThreadsPerChild and MaxClients.

In no way this blog was written to claim that one is better than another. It’s just that I’ll be needing static web server on new hardware and I wanted to have a solid data. At the moment, in my case, Apache seams better tool for the job. I might test cherokee and ngix too, just to be sure I’ve chosen the right tool.

Right, and still haven’t figured out why my virtualized provide so much worse results than hardware servers. :)

Raw data: raw-data.ods