Monthly Archives: September 2010

Installing PostgreSQL 9.0 on Ubuntu 10.04

PostgreSQL 9.0 final was released on 2010/09/20 which I’ve been waiting for to begin playing with it and evaluating it. The mainline Ubuntu Lucid apt repositories only have 8.4. According to the package maintainer, Martin Pitt, the postgresql-9.0 package won’t be added until Ubuntu Natty. Thankfully, he setup a backports repo for Ubuntu that we can pull from.
Continue reading

In Python, thread safe does not mean fork safe

We discovered this in a not so easily reproducible way. Here at Mahalo we use this wonderful distributed task queue called Celery. Upon restarting the celeryd server, rarely (until recently) and only some of the workers would throw MemcachedError during their first task. The cause of the issue would be receiving a “STORED” reponse to a memcached_get (wtf?!) or some other variant of invalid response or an EINPROGRESS (which is the socket is already busy doing something). Now another tidbit, we also use Pylibmc which is a wrapper around the libmemcached C library which we’ve written a custom Django cache interface for.
Continue reading

Beware of using Pylibmc 1.1+ and mod_wsgi

Recently, we attempted to bring up a new web server but to our dismay after it was all said and done, the Django application wouldn’t load. Eventually a “gateway timeout” was thrown with no errors in the wsgi or Apache error log. These types of errors are a pain to debug. What made the mystery even better, was the application ran just fine under the Django dev server!
Continue reading