Saturday, July 26, 2008

YOUNME

YOUNME
Added to my Flickr favourites at 09:19.

Friday, July 25, 2008

Comet Daily » Blog Archive » Introducing HTTP Channels

“Comet solution for RESTful real time data synchronization architecture”. Change notification, syncing, etc.

Wednesday, July 23, 2008

Waiting

Waiting
Another bike parked up outside the Yamaha shop on Shoreditch High St. They loves it in there, they does.

Shoreditch High Street, London

Monday, July 21, 2008

A madeleine of my own

A madeleine of my own
I’ve been meaning to write this down for a while now. I think it was in early October 1989 that I was sent on an errand which involved picking up a box of now–forgotten materials from a printer’s premises somewhere around this area; Tabernacle Street rings a distant bell. Memories fade, memory confounds, and close on twenty years have passed since that atom of happenstance flickered in and out, but I know I have an image of this place, forged by the place it then was, on that sunny autumn day.

I remember the old Tube station — I feel like it was Moorgate — as having an agèd wooden bridge over the tracks, and I remember looking, as I wandered through this maze of biblically–inspired street names, down into still–forsaken gaps in the buildings, gouged presumably by the intrusion of V2s decades earlier.

I remember that pinch in the air, that welcome snip of coolness slicing through the tail of an Indian summer’s breath. I remember the shimmering, thinning quality of the light, borne of our angle to the sun at that autumnal point; and as I remember, the years gone by conspire to spin webs of tangled connections in my mind between that glistening, concrete day in which I lived, and others, similar, but merely conjured from the minds of writers I read as a child. I remember popping in to The Castle Sandwich Bar on my way back to the station to buy a toasted sandwich: ham, cheese and pepperoni, a recent concoction, and by far my favourite at the time.

I remember so clearly how good it was; not just the butter and grease oozing out of the edges of the burnished floury white bread to soak into the bitty texture of the coarse white paper bag as I walked excitedly yet somehow deflatedly back down Paul Street to find my way home and back to the grind of the familiar, but the whole sphere of presence and determination, of an expanding vista of thus far elusive but soon–to–be graspable possibilities opening themselves to me — the thrill of the new, the budding comprehension of the enormity of it all. It felt good; it was good.

I remember the friendly faces in the Castle and the easy, matter–of–fact bonhomie of the people who worked in this oasis, alongside its even–then ageing décor; and I remember, fondly, one of my first solitary tastes of a hitherto completely unknown city.
Civic duty

Civic duty
This van was at one end and three or four bikes were at the other, holding back the traffic so as to allow this ludicrous pantechnicon to turn into a plainly too-small road. Why they don't send two smaller ones I don’t know. Well, you know, obviously I do, but you know what I mean. Maybe.

Great Eastern Street, Shoreditch, London

Wednesday, July 16, 2008

ChordFind.Com - 4-string Chord Finder

Looks like I’m going to need this.
I finally gave in.

I finally gave in.
It’s probably been about eighteen years, since I first heard John Martyn’s “Over the Hill”, that I wanted one of these. In all that time I’ve never quite been able to justify buying one, what with not knowing how to play it and everything. I carried on wanting one, but always telling myself that it was a bizarre, atavistic desire and that it should consequently be quashed. Today, I walked past the Duke of Uke on Hanbury Street at lunchtime, went in, feeling slightly annoyed by some shit or other, just to buy some plectrums, and came out, feeling a lot brighter, with a mahogany Tanglewood mandolin. Bugger to tune, these things, and I bet it’s going to need setting up, but still, wheee!
Sushi binge

Sushi binge
Kulu Kulu on Brewer Street - owned by the same people who run Ten Ten Tei a few doors down. Munched through a huge pile of plates with a pal and suddenly thought "oh shit, 16 plates, bill pain" - but, including 2 beers, it came to £53 between us. In your face, recession.
Only just

Only just
I think these guys were about to bust a squat or something, so I took the pic with the camera upside-down and pointing backwards. Amazed it managed to catch them, even if it was only just.

Sclater Street, Shoreditch, London

Monday, July 14, 2008

php-fpm: a smoother PHP/FastCGI process manager

I’ve been running PHP apps with the standard PHP FastCGI server behind nginx for a couple of years now, and in that time have worked up a set of tools to manage PHP processes with multiple configuration profiles. This has been based around my slightly hacked version of Alexey Kovyrin’s PHP–FCGI spawn script, along with a chkconfig–compatible init script I’ve written as a front–end to control it, taking in some simple per–profile configuration in /etc/sysconfig/php-fcgi.

Various contributors to the English nginx mailing list have posted in that time singing the praises of Andrei Nigmatulin’s php-fpm, a patch to the PHP source which adds “FastCGI Process Management” to the standard php-fcgi binary. It’s apparently in use in some pretty heavily–loaded sites, and I’ve had it in mind to check it out, but as my setup has been stable (if not exactly full–featured) over the last few projects, I haven’t had a huge impetus to get and do it. Today, however, I finally had enough downtime to check it out, and now I’m wishing I’d done it earlier.

My existing method basically worked like this:

· init script reads configuration file, with one “profile” per line detailing location of php.ini file, interface and port to run on, number of child processes to run, number of requests to serve before a re–spawn, etc.;

· init script uses these details to construct a command–line to call Alexey’s spawn script, once for each profile;

· spawn script constructs environment and command–line argument list to spawn a set of PHP processes for each profile entry.

This has worked fine, but as so often with these things, the init script became a bit unwieldy with additions over time, and is still unable to do anything elegant like graceful restarts on the PHP daemons.

php-fpm addresses these issues and more. The “profile” configuration is put into a sensible, clear configuration file (php-fpm.conf) which allows you to specify a number of named PHP process “pools”, each with its own detailed FastCGI server and PHP configuration.

The documentation’s somewhat light, and mostly in Russian, but it has all you need to get going, and the configuration file is easy to read. Once you’ve configured the pools you want (in my case sets of named dev/stage/live setups on different ports, so as to keep include_paths — and therefore library code — properly staged), you just need to run php-cgi --fpm. From there on, you can send various signals to the master process including SIGQUIT for a graceful stop, SIGUSR1 to cycle log files, and SIGUSR2 for a graceful reload/restart. The master process ID is stored in $PHP_PREFIX/logs/php-fpm.pid.

I’ll probably write a simple chkconfig/init wrapper to send these signals to the master using e.g. /etc/init.d/php-fpm graceful, but that’s about all I’ll need to do in order to replicate and extend my existing setup.

Not only does this simplify and tidy up my PHP–FCGI setup enormously, it also adds a number of convenient extra points, including IP–restriction and a nice fix for the “empty error” page problem. Intuitively it “feels” a lot more solid, and I’m looking forward to trying it out on the next suitable project. Nice bit of Russian coder humour there on the “extra points” page, too. Thanks, Andrei!