[ t h e f r a g g l e . c o m ]

technology, photography and anything else that springs to mind.

xen vcpu pinning defaults aren’t ideal

I noticed an oddity the other day with a xen Domain0 host we have. There’s a cron scripted job that verifies the RPM database and the RPM’s that are installed on the system, for some reason this job failed, but kept the process open, and kept spinning around trying to do it’s job. Now, I really ought to have set up a “process count” check on the nagios monitoring we have here, but I didn’t have this at the time, so didn’t pick it up for a few days. Whilst this was all going on, the Domain0 got pretty busy and started having to use time on the other CPU’s as well as the main VCPU that wasn’t pinned to anything but the Domain0.

You can see this from the list below of the vcpu resources used by a xen server currently:

[root@somedomain0 ~]# xm vcpu-list
Name                              ID VCPUs   CPU State   Time(s) CPU Affinity
Domain-0                           0     0     0   -b-  1535018.3 0
Domain-0                           0     1     1   -b-  139549.6 1
Domain-0                           0     2     2   -b-  943651.0 2
Domain-0                           0     3     3   -b-   53883.4 3
Domain-0                           0     4     4   -b-  336268.9 4
Domain-0                           0     5     5   -b-   65240.1 5
Domain-0                           0     6     6   -b-   42854.6 6
Domain-0                           0     7     7   r–   67960.9 7
domain1                           4     0     2   r–  1791844.4 1-2
domain1                           4     1     1   r–  1619120.1 1-2
domain2                       5     0     3   -b-  511300.0 3-5
domain2                       5     1     3   -b-  456253.1 3-5
domain2                       5     2     5   -b-  456516.1 3-5
domain3                     6     0     6   -b-  166344.6 6-7
domain3                     6     1     7   -b-  137435.2 6-7

You’ll see Domain-0 which is the control domain, is pinned to all the other cpu’s that should only be used by the guests.

This isn’t ideal, and as a result you find that usually instead of a vmstat looking quite healthy and the “steal %” value that shows up being at 0, it’ll start to creep up. This means that the scheduler on the Domain0 side is interrupting the VCPU and requires CPU time from it, interrupting whatever is happening on the DomainU side.

There is a vcpu-pin action available within the xm command, which isn’t ideal to be used when you have the server live. What I found best, was to change the boot configuration for the Domain0 from the following:

title Enterprise Linux (2.6.18-128.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-128.el5
module /vmlinuz-2.6.18-128.el5xen ro root=/dev/vg01/root console=tty0 rhgb quiet
module /initrd-2.6.18-128.el5xen.img

To the following:

title Enterprise Linux (2.6.18-128.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-128.el5 dom0_max_vcpus=1
module /vmlinuz-2.6.18-128.el5xen ro root=/dev/vg01/root console=tty0 rhgb quiet
module /initrd-2.6.18-128.el5xen.img

You’ll notice the option dom0_max_vcpus=1, this tells the Domain0 to pin to only one available VCPU, the one it’ll choose should be the first one.

You’ll see a difference in the vcpu-list afterwards like this:

[root@somedomain0 ~]# xm vcpu-list
Name                              ID VCPUs   CPU State   Time(s) CPU Affinity
Domain-0                           0     0     0   r–      54.0 0
domain1                           3     0     7   -b-       3.2 6-7
domain1                           3     1     6   -b-       3.0 6-7
domain2                          1     0     1   -b-      10.3 1-2
domain2                           1     1     2   -b-       2.9 1-2
domain3                          2     0     3   -b-       3.7 3-5
domain3                          2     1     4   -b-       2.5 3-5
domain3                          2     2     5   -b-       0.9 3-5

It’s worth noting that you can also limit this on the fly, by using the following command:

xm vcpu-pin Domain0 0 0

Which can be useful if you can’t get the down time for a box and it’s guests.

Tags: , ,
, ,
September 1, 2009 at 11:11 pm Comments (0)

TanTan flickr photo gallery broken after upgrade to Wordpress 2.3

So I realised that the admin part of the Flickr Photo gallery plugin I use (which is at http://www.thefraggle.com/flickr/) was a bit broken after upgrading wordpress to v2.3.

It appeared to work with the configuration I had set previously. However, when on the options page for the plugin, it was complaining of not being able to find a standard wordpress include.

A quick google search showed me a couple of resources, that told me where I needed to make a slight alteration to the source of my flickr plugin …

in the file “/path/to/your/wordpress-install/wp-content/plugins/silaspartners/flickr/admin-options-load.php

    require_once(dirname(__FILE__).$tmpPath.'/wp-admin/admin-db.php');

needs to change to

    require_once(dirname(__FILE__).$tmpPath.'/wp-admin/includes/user.php');

Once that’s done, the plugin works a treat!

Tags: , ,
, ,
October 27, 2007 at 7:30 pm Comments (0)

Flickr is my new favourite toy

Until recently I hadn’t been taking that many shots, and had just been uploading the odd photo to deviantArt. This is all good and well, but it isn’t really suited to making proper sets of images, say from a shoot at a gig, or other event.

This is when I decided to give Flickr a try. So far I have been super impressed with the ability to tag photos, store images in albums and collections together, and the huge user base also means there are lots of scripts and website applications that are available to help you make the most out of your Flickr experience!

Now, I don’t post much to wordpress because I don’t usually have anything that I feel may be read worthy, but decided to have a play about anyway with some of the worpdress plugins available that let you use your Flickr photostreams with your wordpress blog. The best one I found so far I must say is one from http://tantannoodles.com/toolkit/photo-album/ which lets you add a sidebar widget and also basically embed your Flickr photostreams into a page (see here for an example).

There were only a couple of things I needed to do (edit a couple of bits of html to make it fit in a bit more with the current style I’ve adopted for wordpress) and it does seem to look pretty smart.

Uploading images to Flickr is super easy as well, personally I use “uploadr” which you can get off their website, it lets you just drag and drop images from explorer, and then you have the option to resize images, and to create a new album to put them in as well as being able to add common tags.

Anyway, the big thing is that Flickr is awesome, tagging photos is a great way to help you organise your images and search them later for recurring themes, as are collections and albums. I do highly suggest giving it a try, you can get free accounts where you are limited to a small upload limit daily, or for a small fee you can have an unlimited upload account.

Tags: , , , ,
, , , ,
October 20, 2007 at 4:29 pm Comments (0)

cheap portable hard disks a go go

I decided to buy a portable hard disk this week for my trip to germany, so that I can ensure I don’t run out of CF space.

It’s a vosonic vp2160, and at £109 for a 60gb model I’m pretty happy. It happily reads my CF card fresh from the camera, and copies over all the images pretty speedily.

The interface is super simple and easy to use, it doesn’t play music or anything like that, but all I wanted it for was to store pictures on till I get home and can process the images.

The USB2.0 interface is speedy enough to copy over files i’ve copied to the disk, and also allows you to use the device as a CF/MMC/whatever reader for your PC, which is handy. It’s pretty handy too how you can charge the Li-ion battery via USB too (you have to plug two usb connectors into your pc, but that’s no biggie really)

What really impressed me the most, however, is how it actually seems to suggest you should be fine upgrading the hard disk at some point. They include (amongst the power adapter to charge it up and the install cd for win98 drivers etc) a mini screwdriver to uncouple the back off it, which reveals a bog standard fujitsu 2.5″ hard disk. So if I decide 60gb isn’t enough in this little device I will be able to have a good go at upgrading the hard disk!.

Vosonic VP2160

I also purchased a Creative Zen Vision:M 30gb today too today to tide me for my trip to germany, but will druel more at that when it arrives tomorrow :D

Tags: , , , ,
, , , ,
June 21, 2007 at 6:35 pm Comments (0)

Virtual domains in exim4

I’ve been using exim for a while with virtual domain support, and thought it be best to document what I did somewhere.

For a long time I wondered how I might actually support virtual domains in exim 4 and held off by just dumping all mail from all domains into my mailbox (how gosh darn lazy is that).

I finally got bothered enough to, and found a lot of easy to follow help on the internets (google), and came up with the following additions to my exim4.conf :


domainlist localdomains = dsearch;/etc/exim4/virtual : @ : localhost

and in the routers section

begin routers
...
vdom_aliases:
driver = redirect
allow_defer
allow_fail
domains = dsearch;/etc/exim4/virtual
data = ${expand:${lookup{$local_part}lsearch*@{/etc/exim4/virtual/$domain}}}
retry_use_local_part
pipe_transport = address_pipe
file_transport = address_file
no_more

As you can see there is a directory called /etc/exim4/virtual, which contains several files, each of which define the aliases for a domain, an example file in that directory could look like:
filename: thefraggle.com


* : :fail:
chris : chris@localhost

As you can see this looks pretty simalar to the sendmail aliases file, but requires no rebuilding (if you have used sendmail at some point, you’ll know that you need to issue a “newaliases” command.

Anyway, hopefully that wasn’t too painful, any improvements, suggestions and other observations welcome!

Tags: , , ,
, , ,
June 14, 2007 at 6:59 pm Comment (1)

« Older Posts