Search Results: "dom"

1 August 2007

Lars Wirzenius: Obnam: Generating backup data sets

Sometimes in programming one gets to concentrate for a bit on a single, simple, pure program. A command line utility which is completely in batch mode, does not handle any kind of complicated data, does not need to deal with other programs, or the network, or anything nasty like that. Something where one can just look at the one or two interesting parts and not have to worry about anything else. This is the story of one such program. I need a program to generate test data sets for backup performance testing. The program needs to be reasonably efficient, since the simulated backups may be rather large. My first attempt was not fast enough. There were two reasons for this: the way I was generating random binary data, and the way I was generating filenames. The program generates random binary data to simulate large files, such as image, audio, or video files, and thus it needs to be uncompressible with the usual compression algorithms. My first attempt was to generate each output byte with the Python pseudo-random number generator (random.randint). This only results in about 0.1 megabyte/s (on my laptop), so I needed to improve it. After some iteration and advice, I landed on the following: I generate random bytes with the Python PRNG (random.getrandbits), and feed these to an MD5 checksum. After each byte, I get the current digest and append it to the output. This way, for each random byte, I get 16 bytes of output. It isn't completely random, but it satisfies the uncompressibility requirement. This resulted in about 2.5 MB/s. I then tweaked the code a bit, doing things like avoiding unnecessary arithmetic. I further decided to only feed the first few dozen bytes from the PRNG, and the rest as the same constant byte. The initial run of randomness is enough to make sure the output is unique for different files, so that compression doesn't find lots of duplicates of the big files. This resulted in a speed of about 6.6 MB/s on my laptop and about 13 MB/s on my server. This still didn't make the program fast enough, but the remaining problem was not that writing the contents of one file was too slow, but operations on directories were very, very slow. After benchmarking with zero-byte files, turns out that at the slowest, with file counts in the millions, it would create only a few tens of files per second. That's empty files, so only requiring an update of indoes and the creation of a new directory entry. Obviously, the problem was that I was putting too many files in directories, causing the filesystem to spend a lot time scanning them. I was creating up to 250 files per sub-directory, and then creating a new sub-directory. All of these sub-directories were going directly under the user's chosen output directory. To measure what the optimal size of a directory was, and whether to create two levels of sub-directories, I wrote a little benchmark program.
Graph, 0-byte files Graph, 4096-byte files Graph, 8196-byte files Graph, 16384-byte files Some graphs from the benchamrks: for 0, 4, 8, and 16 KiB files, for up to one million files of each size. onedir puts all files in the same directory, subdirsofN puts N files per directory, and subsubdirsofN has two levels of directories, the leaf directories getting N files each.
From the graphs I deduced that overall, having two levels of directories and up to 1000 files per sub-directory was the best option of those tested. On the other hand, the bigger the files, the less it mattered what the directory structure was. Perhaps the obvious reason for the slowness wasn't that, after all. Then I realized my code was slow because I was doing an os.listdir (listing all files in a directory) for every directory every time I creted a file. Fixing that idiocy made the code so fast that any overhead from the directory operations was no longer relevant. But at least I had some nice graphs. On the server I will be generating my test data the program is now happily generating just over 11 MB/s of test data. I wouldn't mind having it be a lot faster, but it's fast enough. It will take hours to generate hundreds of gigabytes, but I hopefully won't need to do that very often. Thus, further optimization isn't worth my time, right now. The program is genbackupdata, in case anyone else cares about it.

31 July 2007

Russell Coker: Praising Children vs Praising Programmers

In a comment on my blog post titled Childhood, Don Marti refers to an earlier blog post he wrote which refers to a New York Magazine article about the effects of praising children. The article does in some depth to describe scientific research into the issue of praising children for being “smart” vs praising them for working hard - with the conclusion being that it’s significantly better to praise them for working hard! One quote from that article that I find very significant is “Baumeister has come to believe the continued appeal of self-esteem is largely tied to parents pride in their children s achievements: It s so strong that ‘when they praise their kids, it s not that far from praising themselves’“. This matches my theory about people who subject their children to TV documentaries about gifted children. The conclusions regarding children seem quite clear and the article provides direct advice to parents and teachers as to how to avoid the problems. One issue I am wondering about after reading the NYM article is whether being exposed to smarter children hurts a child’s learning ability. The fact that there is no correlation between high self-esteem and learning ability has been proven, but the reports do not indicate whether there might be a correlation between a decreases in self-esteem and a decrease in learning ability. I recall pointing out to one the few good teachers at high-school that having some of the most capable and some of the least capable students in the same class was inefficient and led to excessive boredom for the more capable students and excessive difficulty in keeping up for the less capable students. I was told that “streaming” was considered bad because it was bad for the less capable students to know their status. I was also refused access to my results of the Westpac Maths contest for the same reason - which seems particularly strange, I was in the training program for the International Mathematical Olympiad so I doubt that releasing my score from one maths contest would change anyone’s opinion of my ability. I am also wondering about how this effects adults (apart from their education history). Should we try to praise work colleagues for their effort instead of being smart? Are adults discouraged from trying hard at their work when they see others succeeding with little apparent effort? One data point for this seems to be kernel coders in the Linux community. Everyone sees super-star Linux kernel coders on stage (on a pedestal) at conferences and it’s easy to believe that such people are significantly more intelligent than others (the well-known programmers are indeed very smart - but they also work a lot harder than most people believe) and that being so smart is a necessary pre-condition for submitting Linux kernel patches. I have met many people who appear to have the ability to be good at any type of coding but seem intimidated by kernel coding it for these reasons. Statements such as “I’ve been doing Linux coding for 10 years but I’m not a kernel coder” are often heard at Linux conferences. Also people who’s skills are respected are often regarded as kernel coders without any real reason. The Linux kernel is a large C program with limited options for a debugger, if you are good at C coding you should do OK! I know that I am trivialising the issues related to kernel coding, there are some tasks such as reverse-engineering device-drivers and debugging some of the tricky race conditions that require special skills - but no-one is born with such skills! I would not suggest that someone try a significant kernel coding task on their first attempt - as with all areas of programming it’s best to start with the easy things first. The web site kernelnewbies.org is a good source of information for people who are getting into kernel coding. I wonder whether a change in the attitudes towards such things could encourage more people to write free software, and more of the current programmers to attempt new challenges (such as kernel coding).

30 July 2007

Steve Kemp: That I can't show you how

Russell Coker has recently started posting random tech-tips and recipes in his blog :
To improve things in this regard I plan to increase the number of posts I write with solutions to random technical problems that I encounter with the aim of providing a resource for google searches and to randomly inform people who read my blog.
This is nice to see on Planet Debian - although I hope we continue to see the personal entries. For anybody else who is considering posting things like this I would be delighted if you'd copy them to the Debian Administration website. There have been numerous times when I've been just about to write something on a topic, seen it posted elsewhere and figured I shouldn't do so: (Notable examples off the top of my head: Introduction to OpenVZ, Introduction to GIT, several Xen pieces.) I don't get many submissions, which I'm getting resigned to, but it is easy and people really really are greatful for new posts. In other news linuxlinks.com are a bunch of spammers and will be reported as such. I utterly fail to care that they've added "my software" to their list; if I cared I'd join their site and agree to receive emails from them..

29 July 2007

Russell Coker: Blogs and Conversation (or Lack Therof)

I recently received an email from RSA inviting me to read their blog (after having requested an evaluation copy of one of their products). They invited me to “join the conversation“. Often blogs are described as a “conversation” and I’ve been considering whether that analogy is appropriate. The Collaborative International Dictionary of English v.0.48 has the following definition: Usage: Conversation , Talk . There is a looser sense of these words, in which they are synonymous; there is a stricter sense, in which they differ. Talk is usually broken, familiar, and versatile. Conversation is more continuous and sustained, and turns ordinarily upon topics or higher interest. Children talk to their parents or to their companions; men converse together in mixed assemblies. There are instances of blogging that can approximate conversation when bloggers cite each other’s articles in turn and leave comments on each other’s blogs. But it’s usually not that continuous and sustained. An occasional patterin is that blogger A writes a post, blogger B writes a post disagreeing with it, blogger A comments on blogger B’s post, and that’s usually the end of it. Usually it’s just a case of multiple bloggers writing posts representing their own opinions with occasional references to other blogs and no sustained interaction. The blogging interaction seems to more closely resemble academics presenting papers with alternate solutions to a problem than a conversation. One factor that I believe defines conversation but which isn’t mentioned in the dictionary is that the parties involved have an equal standing. The comments section of a blog is not such a forum, the blogger has a significantly more powerful voice (at least in connection with their own blog) than the people who comment. Someone who posts a comment may have it deleted, and it if is left then a rebuttal in another post will be seen by a significantly larger number of people (the number of people who read comments on a post is a tiny minority of the people who read the post). This doesn’t preclude conversation between bloggers who are of equal popularity in a community, for example most readers of my blog come from Planet Linux Australia and Planet Debian so any blogger who is also syndicated on those sites has an equal voice to me. Another factor in conversation is whether responses are even read. Many blogs don’t accept comments and it’s never certain that a blogger will see a track-back from a blog that references one of their posts. When one party ignores the other (or appears to do so) then there is no conversation. I’m not aware of whether a conversation with RSA people would be possible. While their blog refuses to send content to my Planet installation I guess I’m not going to find out… Is the lack of conversation a bad thing? One problem with conversation is that it often degenerates into what GCIDE defines as talk, while that is good for a friendly mailing list (EG your local LUG) it isn’t so good for the exchange of technical information. A compounding problem for mailing lists is the number of posts that can not be interpreted without the context of a thread of discussion. This often makes mailing lists unreasonably difficult to use in the search for answers to technical problems. When reading google search results I will usually read blog URLs before mailing list posts as a blog post will usually stand alone and either give me an answer or be obviously not related to my problem - sometimes I have to read a dozen messages in a list discussion to determine that it’s not going to help me! To improve things in this regard I plan to increase the number of posts I write with solutions to random technical problems that I encounter with the aim of providing a resource for google searches and to randomly inform people who read my blog. I find such posts by other people quite useful, I often get inspired to implement a technology after reading a blog post about it - there are many things that have a low priority in my todo list because they seem difficult, a blog post that reveals them to be easier than expected and advises how to avoid common problems can really make a difference!

Jose Carlos Garcia Sogo: Cyber Revolution in Chile

From two sources I have read today about the almost secret deal signed by Chile Goverment with Microsoft. The deal, in most pure Orwell style, means that all kind of computer driven activity in the administration will be held with MS software. Even, education will be only made with their software, with no posibility of teaching any other alternative. This obviously will make very child in Chile captive of MS software. Against this deal, a movement has arisen: Movimiento de Liberaci n Digital. We should ask governments only the freedom of choice. This doesn't mean that they have to support every OS out there so any citizen can interact with administration with the format he just developed some ours ago, but they should be using open standards that anyone could implement in their software. We have to teach them that using the most common used standard is not the same than using an open standard.

Evan Prodromou: 10 Thermidor CCXV

I'm getting myself ready to take off for Taipei for Wikimania 2007. It's going to be an exciting event -- my first time in Taiwan, too. I've been ambiguous about Wikimania each year, but I seem to keep going. The stated purpose of the conference is to be solely for Wikipedia and other Wikimedia projects, but people seem to keep coming who don't have anything to do with Wikimedia projects, so I figure I might as well go, too. I like finding out what other people are doing with MediaWiki, and I like getting pumped up about Open Content, the Wiki Way, and freedom of information around the world. I hope that eventually more general-purpose wiki conferences like RecentChangesCamp and WikiSym will get more public attention, and participation by Wikimedians, in the future. It would relieve some pressure on Wikimania to be something it doesn't seem to want to be. I'm going to be speaking about Extending wikis with social networking tools. We've done some interesting work with this on Wikitravel Extra, and I plan on using the same technique for other wiki sites in the future. I think it's a powerful way to enhance the unity of consensus knowledge with a multiplicity of varying opinions. I'm also looking forward to the Debian Birthday Party 2007, thrown by local Debianistas. It should be a lot of fun! There's also a Creative Commons conference happening during Wikimania, which will be pretty interesting. Lots to do in Taiwan this year. tags:

WYSIWYG and MediaWiki I've been an advocate of WYSIWYG editing in MediaWiki for 3 years now. So I'm interested to see that the core dev group for FCKeditor have gone the distance to make a real, working WYSIWYG plugin for MediaWiki. The extension has just about everything that I'd want from a WYSIWYG mode for MW:
  • It stores articles as Wikitext. Since in-browser editors generate HTML, plugins often try to store HTML in the wiki database, but this conflicts so much with other parts of the site, it's unworkable.
  • It's implemented as a MediaWiki extension. This makes it possible for MW installations to experiment with the tool and remove it if they don't like it. It also shows that the tool isn't too invasive and should work with other extensions.
  • It supports templates, tables, images, and citations. A lot of the advanced syntax for MediaWiki is supported.
  • It's optional for users. Users can switch to Wikitext any time they're editing a page, and users who don't like WYSIWYG at all can turn it off with a user preference toggle.
I think that this tool has the capability to be the WYSIWYG editor for MediaWiki. The previous effort using Wikiwyg didn't handle most of these points. Jimmy Wales gave an impassioned keynote at Wikimania 2006 about the need for WYSIWYG editing on Wikipedia and elsewhere, and I hope we can use the FCKeditor MediaWiki extension to meet that need. tags:

28 July 2007

Patrick Winnertz: debian-edu 3.0 terra finally released

Hey folks, we released some minutes ago finally Debian-Edu/Skolelinux 3.0r0 ?Terra? which is based on Debian 4.0 with some modifications to work out-of-the box. Here are the releasenotes: Oslo - July 22., 2007 Skolelinux 3.0 is ready. This is an community release with comprehensive support from regional and national projects in Germany, Spain, France, Greece and Norway. The Skolelinux project is now a part of Debian under the name Debian-Edu. Several other projects have made additional functionality to Skolelinux tailored for national needs. Skolelinux now supports more than 50 countries. whats new in skolelinux 3.0: based on Debian 4.0 ?etch? and therefore compatible to LSB 3.1, using kernel 2.6.18 and KDE 3.5.5 Full support for networked Thin clients, ?LowFat (diskless) clients, Workstations and Laptops. With the ?LowFat clients users got full PC functionality with extremely low maintenance cost. The use of ?LowFat clients gives full support for sound, video, USB memory stick?s and DVDs without the need for a local installation. Skolelinux now got more than 80 applications selected for pedagogic uses, supporting more than 50 languages. Many new applications are introduced in addition to popular classic as GCompris, KDE-Edu, Iceweasel (unbranded version of Firefox) and ?OpenOffice.org. Installation is a breeze: Both the installation and source code for all software are now distributed on a single DVD now supporting three different processor platforms as i386, PowerPC and AMD64. This makes it more easy to choose hardware, and to study the recipes behind the software. Those interested can exercise their freedom to learn, participate and share knowledge more easily. Installation CDs are also available, but requires a working Internet connection for installation. about skolelinux Skolelinux is a complete tailored software solution for the needs of any educational institution or school. It is a ready computer system were the school does not need to piece together the components. Skolelinux is the result of the work of the Debian Edu project and Debian Edu is an official Debian subproject. It is installed in a great number of schools in Norway, Germany, France and other countries. Municipalities and Commercial Service Providers run Skolelinux across multiple schools, operated and maintained centrally. Service providers report that the ?lowfat clients? require half the maintenance cost of other desktop alternatives. The next milestone of Skolelinux development will be to merge the Debian-based ?LinEx distro into Debian Edu. Currently ?LinEx is used by more than 250,000 students and public employees in the region of Extremadura in Spain. in depth Lowfat clients is also known as Diskless workstations. They run applications locally on the client. All software comes from the server instead of locally from the client hard drive. Recommended minimum requirement for client machines is > 256 MB RAM and 800 MHz CPU. Skolelinux now got improved tools for system surveillance and maintenance. Roadmap for next merging of ?LinEx and Debian-Edu: * http://wiki.debian.org/DebianEdu/LinEx2DebianEdu-Roadmap Please note that the documentation for the 3.0 Terra release is only available in English at the moment and contains some rough edges. We have considered releasing before the end of the summer holidays more important and we will fix those rough edges in the coming weeks, when we also expect more translations to show up. Those fixes will be included in the upcoming 3.0 r1 release.

Christian Perrier: Bhutan: another step towards democracy

Some people reading this blog know that I'm growing a special link with the isolated kingdom of Bhutan in the Himalayas. This link is born with the DzongkhaLinux lanuch back in 2006 and the connections that were established then with the people working over there on their national Linux distribution at the Department of Information Technology. And more particularly with their lead developer in this, Pema Geyleg. In parallel to this, I developed a good "vibration" with that country and I realy plan to come back there in the future and visit it more deeply, including all friends I made there in very few days. The country is currently not what we, in the so-called western world, would call democratic. This is a monarchy and not, yet, a constitutional one. However, the former king, Jigme Singye Wangchuck, (who has been ranked among the 100 people who have more influence in the world, last year, by Time magazine) decided long ago that he would bring the country to democracy by following a long but probably needed process. He first resigned last year, surprising everybody in the country, in the favor of his son, Jigme Khesar Namgyel Wangchuck, who is currently the youngest head of state in the world. Democratic parliament elections are programmed for 2008. And, yesterday, as another step in this democratic process, the Prime Minister resigned along with 6 other ministers, to "enter politics" in preparation of these national elections in February/March 2008. Again, it's very interesting to watch this process from far and see whether the country will succeed in achieving this transition (Pema told me several times that, indeed, the majority of people in Bhutan are not particularly eager waiting for this transition, given the very special relation they have with the king (the buddhist religion playing of course a great role there). And, well, let's anyway hope that the future government and parliament will keep the push they're giving to the development of free software, currently.

27 July 2007

Russell Coker: Red Hat virt-install and Partitions

I have recently been using virt-install on CentOS 5 to install some virtual machines (I previously posted a summary of the experience). One problem I had is the inability to do an install of Fedora to /dev/hda - it insisted on partitioning the disk and installing it on a partition. I have filed Red Hat Bugzilla #249837 about this problem. # n=1
# while true ; do dd if=/dev/vg0/orig of=/dev/vg0/dest bs=512 skip=$n count=1000 ; echo $n ; file -sL /dev/vg0/dest ; n=$(($n+1)) ; done After doing a CentOS or Fedora install I then have to fix things so that my desired option (of using a single unpartitioned virtual disk) is used. To do this I first needed to determine how many sectors at the start of the filesystem were used for the partition table. I used the above shell commands to test skipping different numbers of sectors and using file -sL to determine whether the result was recognised as an Ext2/3 filesystem. Below is part of the output: 62
/dev/vg0/dest: data
1000+0 records in
1000+0 records out
512000 bytes (512 kB) copied, 0.018812 seconds, 27.2 MB/s
63
/dev/vg0/dest: Linux rev 1.0 ext3 filesystem data (large files)
1000+0 records in
1000+0 records out
512000 bytes (512 kB) copied, 0.115528 seconds, 4.4 MB/s
64
/dev/vg0/dest: data
1000+0 records in
1000+0 records out
512000 bytes (512 kB) copied, 0.018623 seconds, 27.5 MB/s As you can see 63 sectors are used for the partition table and other boot blocks at the start of the disk. So I used the below command to fix it:
dd if=/dev/vg0/orig of=/dev/vg0/dest bs=512 skip=63 The next problem after this was booting. The pygrub program that is used by the CentOS Xen installation to boot DomU’s only works with partitioned block devices. This however is quite easy to solve, I merely had to copy the kernel and initrd from the Xen image to the Dom0 filesystem and use the files for booting. Of course every time I upgrade the kernel I will need to copy the files, but that’s not such a great inconvenience. I usually end up running multiple DomU’s with the same distribution so I can copy the kernel and initrd once and use it for all instances.

Michael Prokop: Setting up your own jabber server: ejabberd

It was on my todo list since ages, finally I took some minutes to set up my own jabber server (reach me at mika@jabber.grml.org). I’m using ejabberd, a free and open source instant messaging server written in Erlang. Reference system: Debian etch (current stable), ejabberd version 1.1.2-6, installed via a simple:
# aptitude install ejabberd
Adjust the hostname in /etc/ejabberd/ejabberd.cfg (I suggest to use something like ‘jabber.$YOURDOMAIN’ so you can update jabber’s DNS SRV according on upgrades, downtimes, moves,…):
 hosts, ["jabber.yourdomain"] .
Register an account:
# /etc/init.d/ejabberd restart
# ejabberdctl register username jabber.yourdomain password
You might want to give your username admin permissions, so adjust /etc/ejabberd/ejabberd.cfg according:
 acl, admin,  user, "username" .
That’s it. If you want to disable registration of users just use (instead of the ‘allow’ line):
 access, register, [ deny, all ] .
Restart the server and make sure you have a running server:
# /etc/init.d/ejabberd restart
# ejabberdctl status
Now you should be able to point your browser to http://yourdomain:5280/admin/ and set up your new jabber account inside your jabber client.

Wouter Verhelst: Dear lazyweb,

When learning some code I didn't know before, my usual way to get familiar with it is to first find some documentation or a kind spirit to help me understand the big picture, and then to run the code in a debugger or to do something like '/bin/sh -x', or some such, so that I can understand how it actually flows. That works pretty well with most software. One of the things with which it does not work, however, is gcc's .md files. As far as I know, there are no debuggers for those files; and even though Simon helped me understand a few things about it at Debconf, I'm still not confident enough to just start editing stuff. Additionally, just randomly editing a 7k+ LOC file and expecting those edits to magically work is not something I consider very likely to succeed. So, dear lazyweb: how does one debug gcc's .md files?

Russell Coker: Childhood

Recently there has been some discussion and controversy about a 15yo boy being allowed to perform a Caesarian operation on a woman (without her consent). Don Marti seems to think it’s OK and gives some examples of what 15 year old people used to do in past times. However he misses a couple of significant points, one is that the knowledge of surgery was much lower a few hundred years ago and the expectations of the patient were a lot lower, the other is that the patient in this case did not consent to being operated on by a 15yo. If the boy’s mother thought that he was capable of doing the job correctly then she could have allowed him to deliver a younger sibling… Given a choice I would rather have someone like Doogie Howser operate on me than a random surgeon - but I would be extremely unhappy to discover after an operation that it had been performed by a different surgeon than planned who didn’t have a medical license and who’s motivation was to invade my privacy by making a movie of the event! Don cites the interesting essay Against School by John Taylor Gatto which makes some really good points about the state of the education system in most first-world countries. An interesting point that John Gatto doesn’t mention is that in Japan school-boys wear uniforms that are based on Prussian military uniforms. From all the evidence that I have seen the Japanese school system is more Prussian (IE worse by many objective measures) than most countries. The Sydney Morning Herald has an interesting article comparing education systems which claims that a major cause in lack of academic performance is unjustified praise. I first became aware of the extent of this problem when discussing education with a misguided university lecturer. He told me that he felt that his purpose was to make the students believe that they had achieved something and that this was much more important than actually teaching them. My response was to point out that heroin and cocaine are both good options for people who would rather feel successful than succeed and to enquire as to whether he thought that they should be advocated for children. The conversation ended soon after that and he requested that I not name him or his university when blogging about it. I take this as an admission of guilt, if you act decently in public then you should not be afraid of appearing on a blog - decent actions will either be too boring for a blog entry or things that you are proud of.

Jeff Bailey: Whirlwind trip

So this is it, I've actually finished at Canonical! For most of the past week, I've been in Portland, OR at Ubuntu Live. I gave two talks (Ubuntu Technical Demonstration and Bringing your software to Ubuntu users) and one tutorial (packaging for Ubuntu and Debian derived distributions). I had a great time, and was glad to get a chance to see my former coworkers one last time. I'm happy to be leaving on great terms with my former employers, and hope to be at UbuntuLive again next year.

This conference was a whirlwind of meeting people. JP, Teri, Jim, Andy and MaryBeth are people I'm really looking forward to seeing in the bay area when I get there; I got to see Steve and Patty in the Debian booth; I managed to go for dinner with Chris and Leslie; A going away party that included many of the above plus Matt, Steve, Etienne and Torsten; I had lunch with Katie, whom I haven't seen since my wedding; I had another lunch with Mermaid, whom I thought had fallen off the face of the earth; my final lunch at Veganopolous included MaryBeth again and Rob. I did miss seeing Kamaya, which is sad, though. I got *almost* everyone I wanted to see.

It's a crazy list. Some of these people will be random business contacts. Some of these are folks that I feel like remeeting them after several years was like only missing a day. Some of these are people I miss already.

Sabrina and I are making the trek up north to Kit and Hannah's wedding. We're staying at Miriam's and had lovely Ethiopian food.

Time to sleep. 7am is going to come too early.

26 July 2007

Russell Coker: A Support Guide for Xen

Here’s a guide to supporting Xen servers for people who are not Linux experts. If your job means that you have root access to a Xen server that someone else installed for the purpose of fixing problems when they are not available then this will help you solve some common problems. Xen is a virtualization system that is primarily used for running Linux virtual machines under a Linux host. It is mostly used as a Paravirtualization system in that the virtual machine knows that it is running in a virtual environment - this allows some performance benefits. The host environment is known as Dom0 and root in that domain has the ability to control the other domains (which are known as DomU domains). If you perform an orderly shutdown of the Dom0 (via the shutdown or reboot commands or notification from the UPS of an impending power failure) then when the machine is booted again the DomU’s will be automatically restarted (if the on_reboot setting has the value restart - a common configuration). If you run the command shutdown in a DomU then the domain will be destroyed, and the command reboot will restart the DomU with the same settings - if you want to change the settings for a DomU you need to shut it down and create a new instance. The main sys-admin command related to Xen is xm. Here are the main xm options that are useful in support:

  1. xm list provides a list of running domains. For each domain it gives the name of the domain, the ID number, the memory allocated to it, the number of virtual CPUs allocated to it, the state, and the amount of CPU time used in execution. The ID numbers are allocated sequentially, if you reboot a DomU by running the command “reboot” inside it then it will get a new ID number when it re-starts. Many xm operations that may take the name of a domain will also take a Domain ID number. Generally you never use an ID number and ignore it - the only relevant thing about an ID is whether it is 0.
Here is a sample of the output of xm list:
# xm list
Name        ID Mem(MiB) VCPUs State  Time(s)
Domain-0    0    1236    4 r---–  14116.3
wind        13    2999    3 -b----  60114.1
wind-f7    52      519    1 -b----  3329.9 You can see from this output that the domain named wind has 2999M of RAM, 3 virtual CPUs (out of 4 physical CPUs in the machine) and has 60,114 seconds of CPU time used (that is 114 minutes of CPU use - the equivalent of almost two hours for a single CPU). Here are the values you might see in the state field (from the man page xm(1)):

If you see domains that are running which normally aren’t busy then make a note of this. If you see domains that are paused, crashed, or dying then contact the sys-admin. Also know which domains are expected to be running so that if a domain is missing then you will recognise it as a problem!

  • xm top is similar to the top command in Unix but displays Xen data, by default it displays the same information as xm list but also includes the amount of data read and written from network devices and disks. If your terminal is less than about 145 columns wide the lines will wrap and it will be confusing - stretch the width of your xterm before running it.
  • If you have multiple network interfaces then you can see the transfer counts for each of them separately by pressing the N key. If you have multiple network interfaces in DomU’s then this can help diagnose some network problems (although you may find that tcpdump is more useful). If you have multiple disk devices in a DomU then you can see their transfer counts separately by pressing the B key. One problem that can be partially diagnosed through this is excessively poor performance. If a DomU is running extremely slowly then it may be impossible to login to diagnose and/or fix the problem (it could take tens of minutes to login), in that case seeing where the disk access is going from outside the DomU can shed some light on the problem. VBD  768 [ 3: 0]
    VBD  832 [ 3:40]
    VBD 5632 [16: 0]
    VBD 5696 [16:40] Above is the identification of the virtual devices /dev/hda and /dev/hdb in a DomU. The numbers inside the brackets are the device node numbers in hexadecimal, so 16:40 means the device 22,64 as a pair of decimal numbers (22*256+64=5696). # ls -l /dev/hd?
    brw-r---– 1 root disk  3,  0 Jul 23 17:24 /dev/hda
    brw-r---– 1 root disk  3, 64 Jul 23 17:24 /dev/hdb
    brw-r---– 1 root disk 22,  0 Jul 23 17:24 /dev/hdc
    brw-r---– 1 root disk 22, 64 Jul 23 17:24 /dev/hdd Above is the result of a ls -l on the devices in question from inside the DomU. When I set up a Xen DomU I generally use /dev/hda for the root filesystem and /dev/hdb for swap. So if the machine is performing poorly and /dev/hdb ([3:40]) is being accessed excessively then it indicates that the machine has some memory hungry programs running and is paging heavily.
  • xm list –long [domain] gives detailed information on all domains, or it can be run with the name of a domain such as xm list –long wind to give the detailed information on only one domain. Generally this is something that you will log to a disk file before restarting domains, in the short-term there is little use for this.

  • xm console <domain> gives you the console of a domain. If a domain is not working correctly and it is impossible to login via ssh (either due to a network problem or a problem with ssh) then you can access the console (equivalent to a serial-port login on physical hardware) to diagnose the problem. Often the kernel will log messages to the console, such messages will be stored by the Xen system until they are read. If you suspect that there may be many such messages then use script(1) to log the output to disk, if you are unsure then use script to make sure that you don’t miss any data. Even if you don’t understand it the sys-admin probably will!
  • If the system is half-working then you can login as root to investigate problems. You can escape from the console by pressing CTRL-].
  • xm dmesg gives Xen logging data comparable to the dmesg command in Linux. If you ever have to reboot the machine (run reboot from Dom0) due to a problem with Xen then you MUST save the output of xm dmesg to a file for later review by the sys-admin.

  • xm destroy <domain> will kill a specified domain. It’s a last resort for stopping a domain that is not working correctly - it is greatly preferrable to login to the domain via ssh or xm console and give an orderly shutdown.

  • xm create [-c] <domain> creates a new domain. The configuration for the domain will be taken from a file of the same name in the current directory or in the /etc/xen directory - if /etc/xen is not the current directory when you run xm create then make sure that there is no file-name conflict. You can use this command after destroying a domain or to start a domain that was not previously run.
  • If you want to change a configuration option of a domain (such as the amount of RAM used) then the usual procedure is to edit the configuration file, run halt or shutdown from within the domain, and then create the domain again with xm create. Note that the -c option is used to attach to the console after starting the domain (you usually want to do this).
    I will probably update this post when I get some feedback. I may write more posts of a similar nature if there are requests.

    Filip Van Raemdonck: A wise man said...

    Well, I don't know John Brougher well enough to judge his wisdom, but today I read Slow down the queuing and it was so recognizable. Especially the symptoms of bookmark queuing and tabbed browser sessions.

    And, independently, (mainly guided by tips from a number of other "personal improvement" blogs) I had come to the same resolution of the problem. So there must be wisdom at least in his article...

    Dave Noble: End of Interrail period :(

    After having spent the last few weeks of my life travelling randomly around Europe; my interrail ticket has alas run out. Although this doesn't mean I stop travelling, it means I will be travelling certainly less frequently.
    Despite a few hiccups, I think the experience of travelling around Europe again was fantastic, I would like to thank pixie for bearing with me for so long; and of course also all the people who offered us places to stay. It was very generous of you, and (once I've settled into an apartment here in Oslo) feel free to give me a shout if you need a place to stay whilst over here!
    I am here until the 6th; after which I will be in Duesseldorf for a month working, and then hopefully moving back over to Oslo, after having sorted out at least a temporary job and a place to stay.
    I shall finish with a few pictures of the trip!

    Pub in Helsinki
    Pub in Helsinki; with a few Debian people!

    Helsinki Airport
    pixie in the process of killing 6 hours at an airport

    with friends in Amsterdam
    At Rob's flat in Amsterdam

    me looking psychotic
    Me looking insane on the train to spain

    pixie looking insane
    Pixie looking insane on the train to spain

    That's all folks!

    John Goerzen: OSCon Thursday

    First off, this guy is walking around handing out free fudge. Neat idea, but I can't quite figure out why!

    Bill Hilf from Microsoft spoke today. He started by saying "I guarantee you won't agree with a lot of things I say today."

    Nat introduced him as "our man on the inside."

    Microsoft is submitting their Shared Source license for OSI approval. I don't know if this means that MS will have to actually make any modifications.

    New website today: http://www.microsoft.com/opensource.

    Bill invited feedback from anyone at billhilf at microsoft dot com.

    He got some fairly pointed questions from Nat about software patents. Bill said two things about that: 1) Microsoft flubbed the communication with the press and that their intent isn't to sue, and 2) Microsoft is learning and he's working to help them learn.

    Rick Falkvinge from the Pirate Party

    Funny and informative talk about why they've started a Pirate Party in Sweden.

    Originally copyright only impacted public places, but now it impacts people's private lives as well.

    Copyright is protecting the entertainment industry -- funded by luxury purchases -- at the expense of privacy and individual freedoms.

    "The Norwegian Liberal Party forked our platform into Norwegian"

    www.piratpartiet.se/donate

    "Political donations in Sweden are not regulated", so you all can contributed

    Steve Yegge (Google)

    "Google will probably fire me for this talk"

    Neither Steve's mic nor his laptop appear to work... after his line about being fired, someone shouted "Google is very powerful!"

    "A brand, in geek terms, is a pointer."

    GTE was, for a time, the most reviled brand in the US. Then they invested in improvements and ran commercials basically saying "we don't suck anymore", but nobody believed it.

    "The single biggest branding problem in Open Source is the name 'Open Source'."

    Russell Coker: Train Routing

    Last year I spent several months living on one side of Melbourne and working on the other and travelling by train to work. Every day I had to catch two trains each way with an average wait of 5 to 10 minutes for each train to arrive giving a total of at least half an hour a day spent waiting for trains. The obvious solution to this problem is to have trains not go back and forth on one line but instead go from one side of the city to the other. This map shows that there are 14 train lines out of the city with about 5 major lines. The smart thing to do would be to have every major line have one train every 5 minutes during peak hours and to have every train go back out on a different line. Then if you are on one of the major lines and want to travel out on one of the other major lines then every 20 minutes there would have a train that would take you straight there without changing trains! Currently we don’t even have such frequent trains, during peak hour the trains on most lines run no more often than 5 per hour, the Sydenham line has trains 4 times per hour during peak hours and the trains are crammed full before they get half-way to the city. If the trains ran more frequently and were routed through the city then commuters who travel through the city would save 20+ minutes per day without going to any effort and 30+ minutes a day if they chose to start their journey at a time to avoid changing trains. This would be a significant incentive for catching the train instead of driving! For the commuters who travel to work via a single journey then having trains run every 5 minutes at peak times would mean that an average of 2.5 minutes was spent waiting for a train each way (an average of 5 minutes per day) instead of the current situation of 15 minutes per day or more. This would mean triple the number of trains on the Sydenham line which may sound excessive. However the trains are currently so crowded that there could be twice as many trains and all seats would still be full. If there were three times as many trains then I expect that more people would catch the train (surely some people would be convinced to drive to work by the idea of spending 20 minutes with barely room to stand), it’s not inconceivable that there could be three times as many trains and all seats could still be full! The next issue I have been considering is the time taken for a tram ride to/from the central city areas in peak hours. Peak hour trams stop at every stop because there are always people getting on and off. If a tram could stop less frequently then it could make a slightly higher average speed. One way of achieving this would be for the peak hour trams to stop at every second stop outside the center of the city. On the way in half the trams would accept passengers at each stop (each tram would be designated as either odd or even and labelled as such - the tram stops are already numbered). But if you have twice as many trams then the average wait would be the same while the duration of the trip would be reduced. On the way out of the city the tram driver would announce that after stop 10 (to pick a random number that might work) the tram would only allow passengers to get on or off at even/odd stops. If you knew that your stop was on an even number and the tram was an odd-numbered tram then you would change trams to an even tram. The small delay in changing trams would be made up by a faster trip overall. Politicians are always talking about ways to alleviate the water shortage caused by climate change and to improve the economy. Having people spend an extra 10 minutes a day working because of saved time on the trains would help the economy. Encouraging people to catch the trains via more frequent and efficient service as well as less overcrowding would help reduce climate change - which is the best way of improving our water supply and the only way of helping the farmers long-term!

    25 July 2007

    MJ Ray: Reply of FSF Radio Interviewee about Skype

    Peter Brown replied:
    "Thanks for the message. Here are some comments on the issues you raise:
    "> - On the Radio New Internationalist show "Up in Smoke", during an interview with Peter Brown of FSF (about 43 minutes in), I was surprised to hear the following revelation that FSF uses Skype and the failure to challenge the claim that Skype is free software:"
    The FSF doesn't use Skype. I would appreciate if you would clarify that on your blog post. The interviewer used Skype to telephone me on an FSF telephone. I agree that from what I said, it would be easy to infer that FSF uses Skype, but it doesn't. The interview lasted about an hour and we covered a lot of ground. Also, in this exchange I didn't clarify for the listener that when the interviewer remarked that "Skype was free", they meant as in price, but not as in freedom.
    "> - I was disappointed not to find much on the FSF web site about the need for free VoIP software, building on GNU oSIP and other free software, instead of Skype's proprietary software, which has contained spyware and worms already. Will you be adding such information soon? What is the official FSF view of Skype and similar proprietary VoIP systems?"
    Skype is proprietary and we don't use it. In that section of the interview we were discussing telecoms monopoly and net neutrality, and I lost the focus on the free software issue - my bad. As far as adding an article about VOIP on fsf.org I think that's a great idea. Unfortunately, I don't think we can cover that immediately, as we have some campaigns we have other campaign activities to focus on. We would be glad to take a contribution though, if you would like to write such an article - we might also want to think about using such an article as a basis for a campaign.
    "> - Nevertheless, well done for covering DRM, net neutrality and the privacy problems of Google, Yahoo! and Microsoft in a relatively short interview."
    Thanks. I actually used to work at the New Internationalist in Oxford, and they are a great coop. I have been working with them now for a couple of years, tying to encourage them to cover free software related issues for their audience. Have you seen the article Bruce Byfield (Newsforge) wrote that I got placed in the November issue of the magazine? all the best peter"
    Thanks for the reply! To my shame, I'd completely forgotten that Skype can also call ordinary telephones and the interview didn't remind me. I guess that might be because my main awareness of Skype is when it's a problem, when someone gives a skype: address instead of a sip: one or a real phone number. However, I'm not sure a called person would usually say that they were being called over Skype, rather than being telephoned. FSF people are smarties, though, so can hear the artefacts, or maybe the interviewer had mentioned it beforehand. Anyone else want to summarise the benefits of free software VoIP compared to Skype systems? I won't get time before next month. kris commented:
    "There's openwengo, it has more features than skype (i.e. video), is encrypted, open and free. Enjoy."
    I keep meaning to try openwengo, but each time I look at it, I fail to find the source tarball for the latest release. It also seems to be Qt-only, which I also try to avoid installing (as it'd be a fourth set of desktop widgets). At the moment, I'm using linphone from the command-line. I sometimes consider replacing it with a stand-alone telephone adapter. I wonder: are any running free software? (2007-07-27: 7 comments)

    David Welton: OSCON

    I'm pretty used to working on my own, with my connection to the world of geekdom and the rest of the "outside world" (which really takes on meaning with the high mountains surrounding us in Innsbruck) being the internet line to our home, but it's a lot of fun to be "in the middle of things" from time to time, and I'm enjoying OSCON so far. I've seen a few people I haven't seen in a while, and hope to see more, so look for me before and after my talk about Hecl! I'm either wandering around or in the speaker's room. Tomorrow we're headed back to Europe... sigh.

    Next.

    Previous.