About the Author

Chris Shiflett

Hi, I’m Chris, a web craftsman making things like Mapalong & Brooklyn Beta with my friends at Analog.


PHP and Scalability (Again)

There's an interesting blog entry on O'Reilly's web site discussing Digg's PHP Scalability and Performance. As part of his research, the author (Brian Fioca, a Java developer) interviewed Owen Byrne, cofounder and Senior Software Engineer at Digg, and built his own PHP application, Jobby.

Here are some quotes and interesting notes:

  • He used the WASP PHP framework.
  • Digg gets 200 million page views per month. (Yahoo gets billions per day.)
  • Digg uses 3 web servers and 8 database servers.
  • "None of the scaling challenges we faced had anything to do with PHP." (Owen Byrne)
  • "In fact, we found that the lightweight nature of PHP allowed us to easily move processing tasks from the database to PHP in order to deal with that problem." (Owen Byrne)
  • Digg uses APC and MCache.
  • "It turns out that it really is fast and cheap to develop applications in PHP." (Brian Fioca)
Note: See PHP Scales for some related content and discussion.

About this post

PHP and Scalability (Again) was posted on Tue, 11 Apr 2006 at 01:30:22 GMT. Follow me on Twitter.

8 comments

1.Nate Klaiber said:

Thats pretty incredible. It says alot about the power of PHP. I believe that with ANY language you choose - it takes a proper system to make it work. So, to those who always complain about PHP - the same could be said of those using ASP, CFM, or JSP - when used improperly it will result in poor performance.

I especially liked the statistics about their traffic and yahoos traffic - both sites receiving that much traffic, yet still very powerful and scalable.

Thanks for the good read...

Peace,

Nate

Tue, 11 Apr 2006 at 02:34:51 GMT Link


2.Chris Shiflett said:

By the way, I got the Yahoo statistics from Michael Radwin's talk at ZendCon:

http://shiflett.org/archive/162

In case you want a more reliable source. :-)

Tue, 11 Apr 2006 at 03:13:34 GMT Link


3.Mike Willbanks said:

One thing that I find extremely interesting is how server setup can make PHP applications either run into the ground or shine.

This also depends on the developer as well, sometimes a developer can write a PHP application and find that it will not scale due to the code logic and design.

Besides this there are definitely things to help in keeping the server(s) running great and fine tuned.

Squid-Cache is an excellent tool to keep the load down and having some HTTP Cache on the frontend.

PHP - Using MCache, APC and only compiling extensions that are needed. Also running it as an apache dso helps :)

Apache - Using a small webserver such as lighttpd to proxy image requests or static pages to will cut down apaches load. Loading only the modules needed. Tuning the performance settings properly for the environment that you will be encountering. Making the robots.txt file and excluding search engines from scanning your image directories.

MySQL - Performance tuning the configuration for your traffic amount and application needs, Rewriting queries that hit the slow-query log (this is not enabled by default), installing mtop (mtop.sf.net) and checking what mysql is doing during peak times to help optimize the configuration. Using indexes on fields that are routinely searched/limited by. etc...

I might have to write a blog entry later on all the different issues that normally come up as traffic increases!

Chris as always thanks for the link to this :)

Tue, 11 Apr 2006 at 12:20:16 GMT Link


4.Izman Haidi said:

There we go!!!

Yet another cool story about our lovely PHP.

But I still believed, to make a really good system, it does not mainly depend on the programmer, but combination of hard work from programmers, network guys and systems engineers.

It is not fair to blame PHP for all the mistakes in web apps.

But I'm wonder, why Friendster is so damn slow :)

Wed, 12 Apr 2006 at 08:35:53 GMT Link


5.Chris Shiflett said:

Brian's blog entry has now been Dugg:

http://digg.com/software/Good_Article_for_PHP_lovers

Wed, 12 Apr 2006 at 12:25:36 GMT Link


6.Stefan said:

I am trying to scale some of our servers and am finding the greatest problem we have is that after a good while our apache processes run at between 30-50 megs usage a process. This is quite the killer on the server. I have already started work to seperate the images and static content to a lighter server, however is there a way to track and findout which of our scripts, or files are causing apache to use the most amount of memory? This could be very helpful in cleaning up bloated code.

Wed, 12 Apr 2006 at 16:18:04 GMT Link


7.Mike Willbanks said:

Stefan,

You could always install X-Debug and run a profiling script on this. Also with MySQL you could use a slow query log which might make your processes run longer.

Also you should only enable extensions in php and modules in apache that you are using. Anything else is just taking up extra memory.

You also might want to think about using apache 1.x and compiling php as a static module if you want some more speed :)

Wed, 12 Apr 2006 at 18:40:48 GMT Link


8.Tom said:

PHP Rocks!

Sun, 11 Jun 2006 at 06:03:37 GMT Link


Hello! What’s your name?

Want to comment? Please connect with Twitter to join the discussion.


Work and Books

Analog Essential PHP Security HTTP Developer's Handbook