By Kevin Yank

OSCON 2006: Gettting Rich with PHP5

By Kevin Yank

This week, Kevin Yank is reporting from OSCON 2006 in Portland, OR.

PHP’s creator, Rasmus Lerdorf, gave a surprising talk on building PHP rich web applications using PHP5—suprising, because fully half the talk focused on low-level PHP optimization techniques. The slides are available online.

Taking a simple PHP script as an example, he set out to optimize it to meet a request throughput requirement of 1700 requests/second (as measured by http_load). Techniques he touched on along the way included using KCachegrind to analyze the Apache process running your script, in order to determine what parts of PHP are actually causing the slow-down in your script.

Some examples of bottlenecks he identified and fixed included a default PostgreSQL setting that uses secure SSL connections (with significant overhead) and PostgreSQL database connections, which are much slower than connecting to MySQL. He also showed how to further improve performance by caching PHP intermediate code and automatically optimizing that code using the various features of Alternative PHP Cache, a project that Lerdorf is actively working on right now.

Lerdorf then spent some time looking at new features of PHP 5.0 and 5.1 that make building Web 2.0 applications easier, including the libxml-based XML handling functions, SimpleXML, and the object oriented SOAP library, but these are things with which most serious PHP developers will already be familiar.

A few of his demos showed off PHP parsing various feeds and producing interesting user interfaces using the YUI Library, and he capped off the talk with a few Google Maps and Yahoo! Maps mashups powered by simple PHP scripts. Interesting in these demos were those that directly called the Yahoo! Maps API to pull map tiles for particular locations directly on the server-side (rather than loading up a full DHTML user interface on the client side).

  • I find it somewhat ironic that the “slides” site is down.

  • Gavin

    Hmm.. whole site seems to be down. I thought they mirrored

  • ciaranmg

    I saw this guy at a recent ez publish conference it was very impressive. Worth trying for those slides again later, they’ve been up since early June.

  • Slides work for me.

  • Kailash Badu

    Thanks Kevin. You make me feel as though I were actually attending OSCON. Thanks for covering so much about the conference.

  • materix

    I’m getting on the slides site: “IE is not supported – please use Firefox, Safari, Konqueror or just about anything else.”

    This is silly. I agree that FireFox is better than IE, but which browser to use must be up to the user to decide.

Get the latest in Front-end, once a week, for free.