Site Info Open forum for the discussion of the S2K International site and organization. If you like what we're doing, post it here. If you don't, post it here too. Get answers to site related questions.

PHP Accelerator

Thread Tools
 
Old Jun 23, 2004 | 04:50 PM
  #1  
flitcroft's Avatar
Thread Starter
Registered User
20 Year Member
 
Joined: Sep 2003
Posts: 3,802
Likes: 0
From: Los Angeles
Default PHP Accelerator

Cthree and Krazik,

Have you guys tried PHP Accelerator (phpa - http://www.php-accelerator.co.uk/) on the servers? I read recently that you have a bank of three servers. I had a similar setup at an old job and a developer put the free PHP accelerator on our three boxes (round robin under a load balancer) and we could handle 12x the transaction volume instantly with no code changes -- we were fulfilling 600,000 ecommerce transactions a day with three cheapie boxes. I'm not a programmer so I don't know what the installation entails but I heard that it was easy, quick, and painless. You guys may want to give it a shot if you haven't yet.
Reply
Old Jun 23, 2004 | 04:51 PM
  #2  
flitcroft's Avatar
Thread Starter
Registered User
20 Year Member
 
Joined: Sep 2003
Posts: 3,802
Likes: 0
From: Los Angeles
Default

Every time a PHP script is accessed, the PHP engine must open the script file and read, parse, and compile the file contents into a compiled form. Only then can the compiled code be executed. With scripts often including other scripts, this work can become a significant part of the overall time to deliver a page. It can also impact I/O performance, and require much dynamic memory allocation that in itself can be time consuming.

The reality, however, is that most PHP scripts never change from one access to the next; indeed they may never change for weeks, months, or even years. The Accelerator works to eliminate the penalty of processing scripts that never change, and by caching the compiled scripts in shared memory, delivers significant performance gains as a result. Note that this is very different to caching script output. PHPA doesn't do this, scripts remain fully dynamic, and if they do change then PHPA caches a new version - they just run faster!

So by caching, the Accelerator eliminates:


reading of source code
parsing of source code
compiled code generation
many memory allocation and copying operations
disk related operations
Once script execution has completed, compiled versions of any new or modified scripts are immediately cached on disk for later reuse. This guarantees good acceleration, but scripts are then cached in shared memory, and offering the maximum performance gains.
The Accelerator has one other performance enhancing feature - a built-in code optimiser. Although in it's early stages, the optimiser reduces the size of compiled code and improves the code by removing unnecessary operations.

So in summary, by aggressively removing operations causing performance overhead, the Accelerator is able to deliver performance rivalling the very best alternatives, and for free!

There are also a few performance tests and testimonials that illustrate the potential impact of the Accelerator.
Reply
Old Jun 23, 2004 | 07:36 PM
  #3  
krazik's Avatar
Administrator
25 Year Member
Liked
Loved
 
Joined: Oct 2000
Posts: 17,004
Likes: 7
From: Santa Cruz, CA, US
Default

we've been running phpa for a LONG time.

It works great. Cut our load at the time to about 1/5th the previous levels.

Thank you for the sugestion, but the problem is the sites code itself no ammount of caching can help that
Reply
Old Jun 23, 2004 | 07:39 PM
  #4  
krazik's Avatar
Administrator
25 Year Member
Liked
Loved
 
Joined: Oct 2000
Posts: 17,004
Likes: 7
From: Santa Cruz, CA, US
Default

speaking of caching not only do we use phpa, but we also use squid running in httpd accelerator mode infront of apache on all 3 s2ki web servers. So apache sees no static image requests also reducing the load even more.

Even with all that, we still run a LA of about 4-8 on all 3 webservers (single cpu P4s ~2.4G)
Reply
Old Jun 24, 2004 | 04:40 PM
  #5  
flitcroft's Avatar
Thread Starter
Registered User
20 Year Member
 
Joined: Sep 2003
Posts: 3,802
Likes: 0
From: Los Angeles
Default

D'oh! That's the worst kind of slowdown. It's always easier to just throw money at things

Good luck and thanks for the great site!
Reply
Old Jun 24, 2004 | 05:36 PM
  #6  
pll's Avatar
pll
Registered User
 
Joined: Mar 2001
Posts: 909
Likes: 0
From: Bay Area
Default

Interesting. In our case, our DB server is the one that is thrashed and the webservers are cruising along at almost no load. Then again, our DB server does all of the work (sorting, filtering, etc.). The webservers just spit out HTML.
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Ws2006
California - Southern California S2000 Owners
1
Aug 19, 2011 10:43 AM
OVER 9000!
S2000 Under The Hood
10
May 3, 2011 10:12 AM
bd307
California - Southern California S2000 Owners
10
Sep 21, 2008 05:44 PM
DRhie
California - Southern California S2000 Owners
6
Apr 11, 2006 11:47 PM




All times are GMT -8. The time now is 10:56 PM.