About the Author

Chris Shiflett

Chris Shiflett is an author and speaker who leads the web application security practice at OmniTI.


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.

8 Comments

1. Nate Klaiber's GravatarNate 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's GravatarChris 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's GravatarMike 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's GravatarIzman 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's GravatarChris 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's GravatarStefan 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's GravatarMike 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's GravatarTom said:

PHP Rocks!

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


Post A Comment

Personal Details and Comment

Style Guide

Line breaks are converted to paragraphs. Also use:

  • <a href="" title="">text</a>1
  • <em>text</em>
  • <blockquote><p>text</p></blockquote>
  • <code>2  <?php  if ($foo) {      $foo = TRUE;  }  ?></code>
  1. Note: <code> can be used inline (e.g. in paragraphs) or in a block as shown. Include whitespace and newlines in blocks.

Please enter Chris (my first name) below. This is a primitive spam prevention technique, and I apologize for the inconvenience.

Preview and Submit

Upcoming Talks

php|tek

19 - 22 May 2009

At Sheraton Gateway Suites Chicago O'Hare, Chicago, Illinois.

OSCON

20 - 24 Jul 2009

At San Jose McEnery Convention Center, San Jose, California.

New Comments

Ronald wrote:

A little hard for a rookie like me, but useful. I also thought you'd like to know there is a grea...

Posted in A rev="canonical" HTTP Header
Alex wrote:

Aren't you forgetting that the session will expire if _write() is never called? That excludes ...

Posted in
Andy Mabbett wrote:

@Chris Shiflett, #4, belatedly: Google only accepts rel=canonical within the same domain. My s...

Posted in A rev="canonical" HTTP Header
Kenneth Udut wrote:

I've implemented this rev="canonical" idea on http://free.naplesplus.us in the hopes that it catc...

Posted in Save the Internet with rev="canonical"
Mark wrote:

After reading your article and all the comments, what I got out of this was that sessions are not...

Posted in

Browse Comments