start-stop-daemon, Gearman and a little PHP

The scope of this blog entry is to give you a quick and dirty demo for start-stop-daemon together with a short use case on Gearman (all on Ubuntu). In this example, I’m using the start-stop-daemon to handle my Gearman workers through an init.d script. Gearman Gearman is a queue! But unlike for example most of the backends to Zend_Queue, Gearman provides a little more than just a message queue to send — well — messages from sender to receiver....

April 22, 2010 · 2 min

Caching for dummies

Caching is one of the things recommended whenever something is slow — “Your [database, website, server]? Well, duh! You need a cache!”. All things aside, it’s not always easy to cache stuff. I find myself often in situations where I can’t cache at all or where a caching solution is complex as hell to implement. All of the sudden you need to dissect your page and lazy load half of it with Ajax — bah....

April 6, 2010 · 3 min

Zend Framework: Slow automatic view rendering

So I posted something on Twitter today, which wasn’t exactly news to me. I was more or less pointing out the obvious. From a couple follow-up tweets, I guess, I need to explain more. The idea My thesis is that there’s a gain in page rendering time when I disable automatic view rendering and use explicit render calls ($this->render('foo');) inside my controllers. And to cut to the chase, there is. On our app, I measured a 12% improvement using Xdebug’s profiler — simple before-after-style....

March 29, 2010 · 2 min

PHP parse errors with cgi and nginx

So for whatever reason, it took me a while to figure this out earlier today: 2010/03/15 15:44:16 [info] 22274#0: *148224 client closed prematurely connection, so upstream connection is closed too while sending request to upstream, client: a.a.a.a, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/tmp/.fastcgi.till/socket:", host: "localhost" 2010/03/15 15:44:16 [info] 22274#0: *148207 client closed prematurely connection, so upstream connection is closed too while sending request to upstream, client: a.a.a.a, server: localhost, request: "GET / HTTP/1....

March 15, 2010 · 1 min

DB_CouchDB_Replicator

Update, 2010-03-04: I just rolled a 0.0.2 release. In case you had 0.0.1 installed, just use pear upgrade-all to get it automatically. This release is trying to fix a random hang while reading documents from the source server. I also opened a repository on Github. --- As some may have guessed from a previous blog post we are currently running a test setup with CouchDB lounge. My current objective is to migrate our 200 million documents to it, and this is where I am essentially stuck this week....

March 3, 2010 · 2 min