osdir.com
mailing list archive

Subject: Re: PHP Frameworks and scalability - looking for recommendations - msg#00054

List: php.tcphp

Date: Prev Next Index Thread: Prev Next Index
Nick Miller wrote:

I've been using the PHP xdebug (http://www.xdebug.org) module to generate
profile information...


I like APD[1] better for profiling and xdebug better for debugging. But that just answers the profile side of the question -- the easy part.

Benchmarking is the hard part, and I don't have any good suggestions there. You'll want to simulate your ultimate actual load and probably more to see what will happen when it goes live -- and find the problems *before* it goes live. That's the general idea, anyway. Easier said than done.

[1] http://pecl.php.net/package/apd


---------------------------------------------------------------------
To unsubscribe, e-mail: talk-unsubscribe-4zcLI8jJc/rYtjvyW6yDsg@xxxxxxxxxxxxxxxx

Please read and follow the list guidelines:
http://www.tcphp.org/mailing_list/guidelines

The tcphp.org mailing list is sponsored by pajunas interactive, inc.




Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

Re: PHP Frameworks and scalability - looking for recommendations

Quoting Brandon Carlson <brandon-+k24AcDEvnDQT0dZR+AlfA@xxxxxxxxxxxxxxxx>: Thanks Chris, Can anyone recommend some good benchmark tools? Brandon This is my first post to this list, so I hope I don't sound like too much of an idiot. Hello, all. PEAR has a Benchmarking class you can use to build performance tests around. http://pear.php.net/package/Benchmark That'll work for testing various snippets of code. For stress-testing the entire application, jmeter is pretty good. http://jakarta.apache.org/jmeter/ Code profiling helps locate where your application is spending most of its time. That's very helpful for finding inefficient code. XDebug can create profiles which can be visualized with kcachegrind. http://www.xdebug.org/ http://kcachegrind.sourceforge.net/cgi-bin/show.cgi Info on how to get started : http://xdebug.org/docs/profiler General musings : It's worth noting that Zend Framework and Cake take very different approaches to 'framework-ishness', if that's a word. Cake is the 'do it my way' approach. You do things the Cake way, and you get the benefits of leveraging a lot of prebuilt components that are meant to work together 'magically' and hide a lot of the inner workings from you. Zend Framework is the 'pick and choose' approach (much like PEAR). ZF components were written so that they can work together, or you can just take the ones you want and glue them together with your own code. Cake (and RoR, etc.) make more assumptions about what you want to do, and how you should do it. The further your app is from doing something that Cake is setup to do, the more problems you'll have with it. If you are doing a vanilla CRUD-type web application, you'll probably have no issues. I think its inevitable that there will be a tradeoff between abstraction and performance. A flexible, easily refactored app will usually be more CPU-intensive than something written to do only 1 thing. Using a framework like Cake will get you flexibility at the cost of some performance. The usual assumption made in this case is that the benefits outweigh the extra resources you'll need, but there's no 1 way to make that determination. Only benchmarking will tell you how much of a difference it is. Well, benchmarking, plus writing the app 2 different ways... :) If you've got a load balancer, scaling PHP apps is pretty easy. Add more webservers. The only real trick is to manage sessions such that a user can land on any webserver and still have their session data intact. You can also just peg each user to a single webserver and store the sessions locally, but that makes it harder to balance the load amongst servers. Make use of caching wherever possible. Look into memcached. (www.danga.com/memcached). This can take a lot of heat off your database. Keep static content like images and CSS on a different webserver. You can run that one with a threaded worker model in Apache and get 3-4X more requests/second than the prefork model recommended for mod_php. Or run an entirely different http server like thttpd or lighttpd Even if you don't implement this right away, using a different vhost for static content will make it much easier to add this later. http://httpd.apache.org/docs/2.0/mod/#core http://www.lighttpd.net/ http://www.acme.com/software/thttpd/ You might think about putting some Squid caching servers in front of your webservers. This would serve basically the same purpose as a static content server, but with a different architecture. (It wouldn't require you to write your HTML to reference a different domain for certain types of content.) http://www.squid-cache.org/ Try to write your app in such a way that you can easily switch between database servers. (Don't assume that you'll always use a single DB server.) If you use MySQL, for instance, and your DB server is bogged down, you can pretty easily set up a replication slave and point all SELECT traffic at the slave. Scaling write traffic is a much bigger problem, but most web applications are heavily skewed toward reading. Use monitoring software to tell how busy your servers are. This will make it easier to tell when you need to expand some part of your architecture. http://ganglia.sourceforge.net/ OK, that's all I can think of for now. It's a big laundry list, I know. Lots of these ideas can be mixed/matched, and even run on the same hardware if you've only got a few boxes. regards, alex --------------------------------------------------------------------- To unsubscribe, e-mail: talk-unsubscribe-4zcLI8jJc/rYtjvyW6yDsg@xxxxxxxxxxxxxxxx Please read and follow the list guidelines: http://www.tcphp.org/mailing_list/guidelines The tcphp.org mailing list is sponsored by pajunas interactive, inc.

Next Message by Date: click to view message preview

Re: PHP Frameworks and scalability - looking for recommendations

Brandon, Does Zend use ORM? I believe the Db_Table implementation does. However, if you are familiar with other packages such as Doctrine there is an article on how to integrate it (http://www.spotsec.com/blog/archive/2007/12/12/integrating-doctrine-orm-with-zend-framework/) How is the documentation with Zend? I remember way back when I started working with Frameworks, Cake had the most extensive documentation. Although, I haven't revisited this recently, I do recall that the Zend documentation about a year ago was "Please check back soon". Has this improved? The documentation has been flourished quite a bit. It actually reads much like a tutorial and it fairly simple to navigate. Typically multiple pages per implementations with examples. If we needed to bring on extra talent (i.e. programmers) which would be easier to find someone with experience in Cake, Zend or other? Zend would be easier to learn since it is more so just a library of "use what you need" rather than an all encompassing "wrap you in a box" type framework. Therefore, with that said, teaching someone the Zend Framework is quick and the adoption of the Framework seems to be rather high (at least from the development firms I know of in MN). Also since developers already know the language, learning a package is really nothing. Regards, Mike --------------------------------------------------------------------- To unsubscribe, e-mail: talk-unsubscribe-4zcLI8jJc/rYtjvyW6yDsg@xxxxxxxxxxxxxxxx Please read and follow the list guidelines: http://www.tcphp.org/mailing_list/guidelines The tcphp.org mailing list is sponsored by pajunas interactive, inc.

Previous Message by Thread: click to view message preview

Re: PHP Frameworks and scalability - looking for recommendations

Brandon, I've been using the PHP xdebug (http://www.xdebug.org) module to generate profile information and then read it using KCacheGrind in KDE. Works pretty well in identifying your bottlenecks, and it's the preferred method of Rasmus Lerdorf (at least from a few years back) :-) Also checkout http://xdebug.org/docs/profiler . There's some more information there. Best, -Nick >>> Brandon Carlson <brandon-+k24AcDEvnDQT0dZR+AlfA@xxxxxxxxxxxxxxxx> 1/29/2008 >>> 3:27 PM >>> Thanks Chris, Can anyone recommend some good benchmark tools? Brandon On Tue, 2008-01-29 at 15:20, Chris Johnson wrote: > Brandon Carlson wrote: > > > So my question is, do any of you have recommendations for PHP based > > frameworks to use with a high volume / high traffic web site? Do any of > > you have some references as far as comparisons between different > > frameworks? > > I've not used Cake or Zend frameworks, but I doubt either would make or break > your performance. It's more about your architectural and design choices, and > other bottlenecks, like the database and the network in most cases. > > The best way to succeed is to plan in advance -- build in time in the > schedule > -- to prototype and benchmark. It's a sure thing that no matter what > framework or other technology choices you make, there will be some > inefficiencies or outright bottlenecks. You'll need to be good at finding > them. That means some good benchmarking test harness and some good methods > for profiling to find the hotspots and code which needs refactoring, etc. > > Mike's posting has a bunch of useful information to think about, but not all > will apply to each application or be helpful. > > APC seems pretty much a universally accepted given, because PHP spends so > much > time just reading the files and parsing them. (Who out there remembers when > PHP could pre-compile to byte code, and then execute from such files later?) > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > talk-unsubscribe-4zcLI8jJc/rYtjvyW6yDsg@xxxxxxxxxxxxxxxx > > Please read and follow the list guidelines: > http://www.tcphp.org/mailing_list/guidelines > > The tcphp.org mailing list is sponsored by pajunas interactive, inc. Brandon Carlson Zend Certified Engineer Aphion Inc - Enhancing the web experience, one site at a time www.aphion.com brandon-+k24AcDEvnDQT0dZR+AlfA@xxxxxxxxxxxxxxxx 651-204-6424 AIM: bcarl314pi Yahoo: bcarl314 NOTE: This E-mail is confidential and its contents and any attachments are private and are intended only for the use of the addressee(s), and may contain privileged and/or confidential information. If you are not the intended recipient, you are hereby notified that the use, dissemination, distribution, or copying of this E-mail and/or the attachments is strictly prohibited. If there are any non-disclosure agreements, non-compete, or similar agreements, this message serves as notice that this email, its contents and attachments are confidential and privileged and are subject to applicable non-disclosure and non-compete agreements. --------------------------------------------------------------------- To unsubscribe, e-mail: talk-unsubscribe-4zcLI8jJc/rYtjvyW6yDsg@xxxxxxxxxxxxxxxx Please read and follow the list guidelines: http://www.tcphp.org/mailing_list/guidelines The tcphp.org mailing list is sponsored by pajunas interactive, inc.

Next Message by Thread: click to view message preview

Re: PHP Frameworks and scalability - looking for recommendations

While I'm sure a good number of you know about ySlow, I didn't until a few months ago. Video lecture/presentation outlining the package: http://blog.jowe.biz/?tag=yslow Link to the firefox/firebug extension: http://developer.yahoo.com/yslow/ It might be a little rudimentary for the topic, but I didn't know about parallel-request blocking or the impact of JS placement. 500ms*1million page views will probably add up after a while. Cheers, Garrett --------------------------------------------------------------------- To unsubscribe, e-mail: talk-unsubscribe-4zcLI8jJc/rYtjvyW6yDsg@xxxxxxxxxxxxxxxx Please read and follow the list guidelines: http://www.tcphp.org/mailing_list/guidelines The tcphp.org mailing list is sponsored by pajunas interactive, inc.
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by