Login  |  Register
PHP3000.com  - Article Details
STATISTICS
  • Active Links: 4383
  • Pending Links: 5
  • Todays Links: 0
  • Total Articles: 4
  • Total Categories: 43
  • Sub Categories: 0

search engine - best results

Rasmus Lerdorf at OSCON: Getting Rich with PHP 5

Date Added: July 28, 2008 12:15:41 PM
Author: Carl Evans
Category:

Rasmus Lerdorf gave a great talk at OSCON titled Getting Rich with PHP 5. From the title, I was expecting yet another session on how to build the next great “social networking, tagging, photo sharing, podcasting, blogging, insert-latest-fad-here”. Not that there’s anything wrong with those type sessions but honestly, I like sessions with a bit of depth to them. I was presently surprised when Rasmus threw us into the deep end.

Rasmus’ 3 point plan to get rich?

  1. Build tagged, socially networked, Web 2.0ish, Ajaxy thing
  2. Get 500,000 users quickly (and have it actually work)
  3. Profit

First, the sample application. He showed us a simple news site that pulls stories from a database and displays them. Rasmus showed that for this simple application, 500,00 users translated into ~1,700 requests per second. Using http_load, he shows that the code actually execute 17 requests per second and that it will take approximately 100 servers to service your 500,000 users.

From there he showed several tweaks to speed things up. Using callgrind to map out what is going on and KCachegrind he is able to identify bottlenecks and display exactly what is going on in the process of displaying a page. Turning off ssl connections in the PostgreSQL 8.1 database as well as persistent connections make a huge difference. Switching to MySQL and turning on PDO::ATTR_EMULATE_PREPARES brings us even closer to our goal of 1,700 requests per second. Dropping in APC and properly tweaking it gives further performance gains. Finally, taking a look at the include files and making sure they are all needed gives the final boost.

All told, Rasmus was able to take his small application from 17 requests per second to an astounding 1,100 requests per second while reducing the latency dramatically.

It was one of the best sessions I attended at OSCON. If you are currently struggling with optimizing a PHP application This is a great session for you to review. Rasums published the slides on php.net. Niall Kennedy has also posted a great review of the session on his blog. He was on the front row of the session and has published an audio recording of the session to go along with the slides.

Ratings
You must be logged in to leave a rating.
Average rating: (0 votes)
Comments

No Comments Yet.


You must be logged in to leave a Comment.
ARTICLES
Rasmus Lerdorf at OSCON: Getting Rich with PHP 5
Rasmus Lerdorf gave a talk on “Getting Rich with PHP 5”. He showed techniques to dramatically improve the throughput of a web application. Click [ more ] and I’ll give you the details.
Creating A Fulltext Search Engine In PHP 5 With The Zend Framework's Zend Search Lucene
This article covers the implementation of a fulltext search engine using PHP 5 and the Zend Framework. We will be using the Zend_Search_Lucene component to create and search our fulltext index.
Monitoring File Uploads using Ajax and PHP
Because of the limitations of HTTP, it is difficult to monitor the status of files as they are uploaded via HTML forms. While other programming languages have built-in methods to monitor file uploads, PHP does not. This article shows how to implement such a solution in PHP. We will use Ajax to retrieve information about a file as it is being uploaded and display the progress back to the user.
Generating Static Images of Google Maps
One useful feature of Google Maps is the ability to generate a static image of any longitude and latitude that you desire, as opposed to using the normal JavaScript-based interactive map. In this article I will show you how to request such static images. We will then combine this technique with the geocoder we created in the article Geocoding with PHP and the Google Maps API.