I’ve been hacking with ZeroMQ for some time now… reading through the excellent guide and working on the preliminary steps to incorporate it into the new version (migrated to GitHub from Google Code) of my Doppler radar analysis application. Multi-threading support was on the list of original criterion and considering many of the other analysis features I’d like to eventually add, full distributed processing would be the best design. I’m not an expert hand at SMP application design and although the implementation needs here would be fairly trivial, choosing a good library to handle the nasty bits would make things vastly easier.
So I tinkered with several of their samples designs, implemented a few of the patterns in my code and tested things out. Initial results with just a simple multithreaded service seemed work OK at first glance but eventually dropped data caused issues so I decided to try something with reliability such as the paranoid pirate pattern (robust reliable queuing). Thinking back, I should have realised something was up when it exhibited that issue on both inproc IPC and tcp/localhost. No matter what I was trying to do porting examples into my code nothing remained stable; either it crashed immediately or processed a few messages then died. C and C++ code showed similar results. Running the examples on their own worked fine. The front-end/client-side Python application worked fine. I gave it a fresh shot with another example – the Majordomo pattern (service-oriented reliable queuing) again showed similar symptoms of instability. Commenting out huge sections of my code thinking it may of had something to do with a broken pointer or some other oversight on my part had little to no results. Eventually I started comparing the GCC invocations and noticed there were some minor differences. After 5 minutes of testing the weeks of tinkering finally yielded some fruit… Google confirmed my suspicions: linking ZeroMQ with -pg for gprof support crashes the library.
It’s amazing how quick it can be to find what you’re looking for when you know exactly what you want. At least now I can get back to implementing 0MQ in my code.
I’ve been working on migrating a virtual host over to Rackspace which mainly runs a mail server among a few other small items. I wasn’t 100% sure how smooth the process would be, expecting to hit at least a few road bumps along the way. The first one I encountered was issues surrounding MX entries and the simplistic nature of the DNS record editor at Rackspace – most of my emails sent from my home PC were bouncing back 550 failed recipient verification. This was just a dry run however as when the domain was with my previous hoster I just used my registrar’s DNS, when I switched back the problem seemed to be resolved.
However the second issue I hit had me stumped for a few days. One of the reasons I migrated (besides price) was greater flexibility; Rackspace gave me more options for distros to choose from and I thought their overall interface was cleaner and designed better. So when I provisioned the new VM I gave Ubuntu a shot since I run it on my home network I’m a bit more familiar with how I want to configure the box for the software I run at least. After the DNS/mail issue was resolved everything seemed solid except for a random, albeit fairly minor problem. For some odd reason hostname resolution replied with “hostname: temporary failure in name resolution” randomly. I was getting emails from cronjobs running with this error which I found a bit strange. While I was tinkering with the mail problem I also built a CentOS VM real quick and didn’t notice the error occurring with that host. I double-checked and made sure the resolv.conf was identical, then /etc/hosts, then nsswitch.conf and so on, all the files seemed the same or at least close enough that I didn’t think it would be a problem. I made sure DNS resolution worked on the machine and ensured any iptables rules were not in place. What caught me as the strangest part was the fact it randomly worked and randomly didn’t, there did not seem to be any sort of reproducibility in the issue. I even ran an strace and compared logs from instances it worked and when it didn’t. ‘hostname -f’ also took a second or two to reply rather then an immediate response.
Eventually I figured I’d just add an alias to /etc/hosts with the local non-FQDN hostname. I also noticed then that the /etc/hosts didn’t seem to have an extra carriage return at the end, I put one in and bingo! Problem fixed. Looking back through the strace logs I saw upon closer inspection that it didn’t actually read in the second line which had the FQDN hostname, the first for localhost was OK but then it stopped further parsing. For some reason CentOS behaves differently as I saw – the hosts file was identical (except for the IP’s of course) – it too was missing a carriage return but strace revealed that it parsed the file just fine. Just in case any one is wondering I was testing this on Ubuntu Lucid 10.04.2 LTS and CentOS 5.5.
::sigh:: Ah well at least I can cancel the plan with my original hoster now. 🙂
So I am going through the process of upgrading my server to 8.10. A quite useful HOWTO on howtoforge.com can be found guiding through the process (they also document upgrading from Desktop version as well).
I was not sure which exact command to run given that my headless server obviously doesn’t have update-manager running. The HOWTO covers usage of the ‘do-release-upgrade’ command. Only thing I ran beforehand was my rootfs rsync script to make a backup copy of my OS drive incase the worst happen.
If this runs smoothly I will make a backup copy of my desktop rootfs drive and do a similar upgrade to Intrepid. I am already aware of one or two things I’m not keen on with Intrepid, notably that btnx is not compatible! For those not aware, btnx was the premier application for configuring and making use of every single one of those buttons on the higher-end mice. I have a Logitech MX Laser something and have it set up perfectly, tilt wheel left/right for forward/back in Firefox, extra buttons for minimize or close windows (Ctrl-W), etc. I spend weeks trying to get it working the way I wanted with xmodmap and that ended in nothing but frustration. I’m sure there will be some other things that don’t work quite the way I would like so a mirrored backup drive pre-upgrade is nice to have.