Professional PHP

PHP Programming, Web Development, PHP Advocacy and PHP Best Practices.
« PHP Scalability and Performance
Jason Sweat’s Blog »

The PHP scalability saga continues

July 1st, 2004

Troutgirl wieghs in with some more information on the Friendster PHP conversion:

1) We had not one but TWO guys here who had written bestselling JSP books. Not that this necessarily means they’re great Java devs, but I actually think our guys were as good as any team.

2) We tried rewriting the site in Java twice, using MVC and all available best practices. It actually got slower. Anyway, what does MVC have to do with speed or scalability? I thought it was a design cleanliness and maintainability thing.

3) We tried different app servers, different JVMs, different machines.

4) Anything that money could do, it did.

George Schlossnagle has the best coverage of the topic, saying It’s the App code, stupid (As an Adult Swim fan, I have to appreciate the Big O reference):

My personal bias against java is that many Java programmers seem to be thread-crazy, and as has been noted, humans just aren’t smart enough to program threads.

I once lost a job by saying “Threads are dangerous” at a job interview. Everything was going well, until they asked me what I thought about threading. (this was a business application) Obviously, my opinion didn’t agree with this companies vision for their software. Ironically, I was being interviewed to help them fix their problems with frequent unrepeatable lockups and GPFs. They did not see the connection.

One advantage of PHP is that it simplifies your life by not bothering you with threading, just as it doesn’t bother you with memory management. That doesn’t mean that concurrency issues go away, any multi user application will have them, it just means that they are made explicit at the application level.

George Schlossnagle:

Share nothing’ (which if you don’t want to click on the link basically means not performing much inter-process or inter-thread data sharing or pooling) is not something unique to PHP. In fact, I’m quite sure that you can implement it in Java as well. The problem is that Java gives you a number of powerful facilities with which to shoot yourself in the foot

Here is a java performance article that recommends against object pooling. The struts vs. webwork comparison has an interesting take on this:

Struts Actions must be thread-safe because there will only be one instance to handle all requests. This places restrictions on what can be done with Struts Actions as any resources held must be thread-safe or access to them must be synchronized.

WebWork Actions are instantiated for each request, so there are no thread-safety issues. In practice, Servlet containers generate many throw-away objects per request, and one more Object does not prove to be a problem for performance or garbage collection.

It seems like the Java culture, if not the java language seems to encourage premature optimization in the form of creating pools of shared information.

John Lim expresses some skepticism about the inherent scalability properties of any language, claiming its the developer skill not the language.

I think I’ll end this post with heresy. The field of web development seems to have a mental model of application development forged from the dot-com boom era. We operate with the vision that our applications are going to experience exponential usage growth. Perhaps this leads to an unhealthy focus on scalability in web applications versus other requirements. Perhaps this also leads us to employ optimizations prematurely before we can even understand their impact or even have a need for them. Perhaps these premature optimizations even hurt scalability and performance and needlessly complicate our applications.

Perhaps the Java Culture is more infected with “dot-com-itis” than the php culture?

Scalability – YAGNI?

Filed Under

  • PHP

Related Posts

  • un-Friendster: fired for blogging
  • PHP Scalability and Performance
  • PHP Framework Consolidation?
  • Why is PHP Code Considered Hard to Maintain?
  • PHP Development From Java Architects Eye
Both comments and pings are currently closed.

22 Responses to “The PHP scalability saga continues”

  1. Jeff Moore's Blog » un-Friendster: fired for blogging says:
    9/1/2004 at 5:58 am

    [...] had hoped that more information would come out about Friendsters Java to PHP conversion (1 2 3). Sadly, I don’t think thats going to happen. It seems [...]

  2. John Lim says:
    7/1/2004 at 9:31 pm

    Hi Jeff,

    Nice Summary.

    >> John Lim expresses some skepticism about the inherent scalability properties of any language,
    >> claiming its the developer skill not the language.

    A slight correction. I certainly don’t believe it’s merely developer skill per se.
    The technology needs to be mature enough to support scalability. But scalability does not come out of the box.

    And you’re right there is an obsession with scalability which is irrelevant for the typical website. Not many sites will ever get slash-doted.

  3. CT says:
    7/2/2004 at 1:15 pm

    Really excellent posts today by you, Schlossnagle and Fuecks.

    I find one of the great strengths of PHP is that I can code small, medium and large sites in a way appropriate to each. Small sites can be traditional mixed PHP and HTML pages because nothing is faster to code. Medium sites can us templates, db and some light controller logic. Large sites can deploy a framework to improve working as a team. This makes programmers scalable as well as their apps.

    The great thing is that all of these applications use the same concepts, just rolled into or unrolled from libraries/frameworks. This allows you to code small, smart and fast, and makes it easy to scale up an app as needed.

    I think PHP need a whole new take on the idea of “design patterns.” In Java/C++ there tend to be bad ways and a good way. In PHP there are still bad ways, but there are multiple good ways. When there is more than one way to do the same thing, it’s understanding the concept and choosing the right path given the requirements.

    Perhaps these are more best practices, but there is a pattern feel to them as well. Traditional compiled language patterns apply to PHP when dealing with the purely algorithmic. But has any PHP group dealt with things like the Request and nailed down the key concepts and then shown 2-3 solid implementations depending on the scale and type of the application? We now need some guidance with how and when to best use exceptions. The list goes on.

  4. Bill K says:
    7/4/2004 at 9:10 am

    Jeff, very good links on PHP scalability. It seems like PHP does try to focus on its niche and lets other technology do what they do best. With this in mind, I’m paying close attention to MySQL Cluster and how it might handle scalability on the database side. I can only imagine how fast things can get when you use an in-memory database. My initial euphoria was dampened by the memory requirements (said to be 2.5x your DB size by some reviewers), but in looking over some papers, it seems like you each DB node can serve up a portion of the DB. Why hasn’t there been more hysteria from PHP scalability guys on MySQL cluster? PHP on the front-end and MySQL Cluster on the back-end sounds like a match made in “shared nothing” heaven :)

  5. Harry Fuecks says:
    7/8/2004 at 4:17 pm

    Just throwing another link into the party: The Scalability Holy Grail – wise remarks.

  6. Kami Mandolini says:
    6/2/2010 at 4:37 am

    Awesome this is a great share, thank you for putting this article together! Saw this post tweeted by odegard media on twitter. Looking forward to more and will reply to those who comment back for next months group meetup!

  7. Terresa Resner says:
    6/2/2010 at 6:31 am

    Really enjoyed this, thanks for posting. What is the affiliation with web design san diego meetup group next month?

  8. duafe says:
    5/5/2011 at 9:09 am

    http://classsex.ru/sex/336.jpg
    http://opapizda.com/img/11/index.jpg
    http://tdq.in/images/1/374.jpg

    bb.txt open error

  9. dixylseracr says:
    6/16/2011 at 3:20 am

    Things went silent, i looked puzzled, oh. Leigh shrugged.

  10. ibrojqagor says:
    6/16/2011 at 2:58 pm

    Sheground her hair, that left a challenge. The female for anyonestill inside of her hair.

  11. agwamm says:
    6/16/2011 at 9:44 pm

    Her pussy. No idea where the couch isnt the strangers cock and the laser and.

  12. fxuqduqfizli says:
    6/17/2011 at 3:02 am

    Mr. Roquan gave you liked sucking my lipstick was notyet fully accommodating the lotion.

  13. mqecyjicvydk says:
    6/17/2011 at 9:08 pm

    Felix groaned as, she reached out from her legs.

  14. Cheap Cable says:
    8/3/2011 at 7:31 pm

    Empty vessels make the most noise

  15. how to reverse heart disease says:
    11/10/2011 at 5:14 pm

    I want to use some of the content material on my blog. Naturally I’ll give you a link on my internet blog. Thanks for sharing.

  16. Freddie Leaton says:
    12/13/2011 at 12:58 am

    Hello awsome weblog you made some awsome factors from it i will increase you to definitely my top picks.

  17. Monty Gucciardo says:
    1/10/2012 at 5:08 am

    Wow, awesome weblog layout! How lengthy have you been running a blog for? you made running a blog glance easy. The whole glance of your web site is magnificent, as smartly as the content!

  18. Cameron Borah says:
    2/8/2012 at 6:20 pm

    Write-up is extremely nicely written, and by no means forgetting to mention that it could be particularly informative also. Kudos to you towards the outstanding task nicely completed there!

  19. go learn web98. says:
    3/13/2012 at 7:17 pm

    [...]The information mentioned in the article are some of the best available [...]……

    [...]The information mentioned in the article are some of the greatest available [...]……

  20. Jodee Stibb says:
    3/21/2012 at 5:05 pm

    I almost never comment, however i did a few searching and wound up here The PHP scalability saga continues – Professional PHP. And I do have 2 questions for you if you do not mind. Is it only me or does it look like some of the remarks come across like they are left by brain dead folks? :-P And, if you are writing on other online sites, I’d like to follow anything new you have to post. Could you make a list of the complete urls of your social pages like your linkedin profile, Facebook page or twitter feed?

  21. Joseph Ownes says:
    3/30/2012 at 7:04 pm

    Thanks for your own work on this website. Kate really likes making time for investigations and it’s simple to grasp why. A lot of people hear all concerning the dynamic manner you offer worthwhile solutions via the website and even recommend response from others on that subject and my child is actually understanding a lot of things. Have fun with the remaining portion of the year. You’re doing a brilliant job.

  22. cercei din inox says:
    4/11/2012 at 10:19 am

    I know this if off topic but I’m looking into starting my own blog and was wondering what all is needed to get setup? I’m assuming having a blog like yours would cost a pretty penny? I’m not very internet savvy so I’m not 100% sure. Any tips or advice would be greatly appreciated. Kudos

    Subscribe Feed
    Share Subscribe to this blog…
    Share Bookmark or share this page…
  • About

    My name is Jeff Moore. I'm a PHP programmer living in San Francico and working for a startup.

    More about me…

  • Categories (Home)

    • Agile Methods (14)
    • Mac (14)
    • Misc (18)
    • Open Source (14)
    • PHP (99)
    • Software Design (29)
    • Usability (14)
    • Web Design (20)
  • Recent Comments

    • rsync to remote server via ssh  37
      Petr Halounek, Penni Tomasino, Rodney Kohnen [...]
    • WordPress BBCode Plugin  30
      wepniveth, Pamella Philipps, evakuat [...]
    • PEAR Templates  18
      Sang Bellotti, Kandice Sansing, car insurance estimates for teenagers [...]
    • Extreme Simplicity  15
      Gilbert Moatz, Roni Beauregard, Barb Geyer [...]
    • Manual Memory Management is Dead  6
      Grass Fed Filet Mignon, Kellie Carello, PAPANDOR [...]
    • Friendster wrapup: does MySQL scale  38
      Ollie Joya, nfl jersey on sale, selling scrap gold [...]
    • The Coding Apprentice  51
      fkawau, Annamae Mccane, Boca Raton Personal Injury [...]
    • The Legality of Republishing RSS Feeds  30
      dasfdsfsd, reebok authentic nfl jersey, Tory Rennemeyer [...]
    • Exceptional PHP  7
      Sports, The Click, Laraine Waterhouse [...]
    • PDO versus MDB2  42
      selling silver coins, Oliver Luongo, ddkoaorpa [...]
  • Recent Posts

    • Richard Thomas
    • ZendCon: Writing Maintainable PHP Code
    • Looking Towards the Cloud
    • Holiday Tech Support
    • Closures are coming to PHP
    • php | tek Wrapup
    • php | tek 2008
    • Sarah Snow Stever
    • Benchmarking PHP’s Magic Methods
    • The Endpoints of the Scale of Stupidity on Video
  • Site

    • Archives
    • Log in
  • Search