35 Comments
- echimu, on 10/12/2007, -2/+14Make sure you put apache+php on a single box and mysql on another single box.
Few links about MySQL tuning
MySQL Performance Tuning: Top 5 Tips (free reg need) http://www.mysql.com/news-and-events/on-demand-webinars/mysql-performance-tuning.php
Good tips http://ez.no/community/articles/tuning_mysql_for_ez_publish
Turn on mysql cache
http://www.cyberciti.biz/tips/enable-the-query-cache-in-mysql-to-improve-performance.html
High Performance MySQL : http://www.oreilly.com/catalog/hpmysql/
Tons of tips at MySQL site itself just use google and you find lots of tips
There is also good MySQL optimization file (my.cnf)located in /usr/share/docs/mysql*/examples directory .
PS: I lost net connection while editing above post so I am putting them in separate post.
HTH - frase, on 10/12/2007, -3/+11It's highly likely that APC will be part of the base distribution of PHP 6. So this may be a non-issue for most people in the not too distant future.
t - echimu, on 10/12/2007, -4/+12Well article is good .
I highly recommend xcahce. I am responsible for popular movie forum (300-500 user on line at a time with tons of customization and fancy features). After xcahce our load went down (between 1-2 now; it was 5-15 earlier).
If possible use lighttpd or squid as reverse proxy it will improve performance. Get fast SCSI disk and optimize MySQL Server. There is good book by Jeremy zawodny
Hope this will help someone! - gaoshan, on 10/12/2007, -1/+8postgres is overkill for many uses. MySQL, properly tuned and coded for, is blazing fast.
- Redth, on 10/12/2007, -2/+5I've found success with eAccelerator. The results were drastic.
- Rickard, on 10/12/2007, -0/+3Why digg this down? He's right. APC is slated for inclusion in PHP6.
- invader, on 10/12/2007, -1/+4@brendanc
quit being an ass. it's not like he's saying he's the queen of france. digg probably gets well over 10 million page views per day. he didn't say it was a "high traffic site", you did. a couple hundred thousand is respectable, probably considered more of a middleweight.
i guess you think he's trying to brag or make things up. whether he is or not, he should be treated with the same amount of credibility. you do remember that you're on the internet, right?
@200iso
simple solution, but it depends greatly on the type of content and how often it is read/written. - gaoshan, on 10/12/2007, -0/+2Funny he should support APC so solidly. Of course, APC is his project so maybe, just maybe that has a little something to do with it.
FYI, I recommend APC... just don't be surprised that the dev behind it supports it. - bismarck73, on 10/12/2007, -0/+2I have created a free small caching library (43 lines of code)
it's available here:
http://www.woxxom.com/programming/php/titancache-php/ - YellowBook, on 10/12/2007, -1/+3except that ASP.NET hosting is generally 3x more expensive than PHP hosting
- kerplunk, on 10/12/2007, -2/+3All great PHP accelerators; however, I would have to recommend APC. APC is developed by the people who largely contribute to PHP's core code. As mentioned above, it is also going to be included in PHP 6 (although it will be disabled by default). It is very stable and fast. Easy install to. I recommend installing from source, but you can also install it by typing: pecl install apc
As a side note, lighttpd is a very great web server for static images. If you are hosting images with Apache, you should really try lighttpd. - pynx, on 10/12/2007, -0/+1Good articles. I am looking for new accelerator to replace mmCache. mmCache has a great performance but it does not support php5.
- opus20745, on 10/12/2007, -0/+1He is one of the "leads" on the project, but not really the main developer.
Either way, I'm more inclined to go with what Yahoo uses most often. - mariuz, on 10/12/2007, -0/+1xcache and apc seems to be quite fast
eaccelerator is very good too (just installed on main production site and response from serve ~ 2x faster )
http://itst.net/wp-content/uploads/2006/10/PHP%20Bytecode%20Cacher%20Review.html
via
PHP on Fire: Five Opcode Caches compared.
http://itst.net/654-php-on-fire-three-opcode-caches-compared - 200iso, on 10/12/2007, -0/+1@brendanc
strict privacy clause in my contract, sorry dude.
you'll just have to take my word for it. - figvam, on 10/12/2007, -0/+1Your best bet is eaccelerator then - it's the direct successor to mmcache:
http://eaccelerator.net - coolbru, on 10/12/2007, -0/+1I had APC serve over a million file hits (not page hits) in 10 mins recently. Server didn't break a sweat.
It may be of interest that APC is substantially faster (~5x) than memcache, though of course it is not shared so you can't use it for the same things. - shakin, on 10/12/2007, -0/+1PHP Accelerators are just one of many optimizations that should be made on a high-traffic site. If you're doing some very complex logic or sorting in PHP then maybe the accelerator will even make a big difference.
However, the database will nearly always be the bottleneck on the server. Caching database output is crucial and easy enough to do. Using shared memory to store a result set works very well, as does something like Smarty's template cache that stores the generated HTML (actually, Smarty's cache is extremely fast and very easy to use). I've also made my own cache on the database layer by simply storing each result set in shared memory with the SQL query as the key, so each query made is searched in the cache before going to the database. That eliminates any need for making your app more complex with caching code because it's all in the database wrapper. - figvam, on 10/12/2007, -0/+1Funny that you mention it, despite being so close to Zend, APC seems to be most buggy from the three accelerators listed. Just check this thread:
http://www.vbulletin.com/forum/showthread.php?t=167107
None of these problems exist under eAccelerator. I can't say for xcache because it's too new and not so widely used and therefore tested. - m00n1, on 10/12/2007, -2/+2It amazes me that PHP doesn't have this out of the box. I'm not flaming, but it's 2006 here. You can hardly call PHP enterprise ready. Yet Another Module To Support. ASP.NET has had this out of the box since day 1, and it works great.
- 200iso, on 10/12/2007, -3/+3can't say, after having revealed the traffic stats. Sorry.
- opus20745, on 10/12/2007, -3/+3I recently had the opportunity to speak with Rasmus himself at the local Washington DC PHP developers' conference. In particular, I asked him about which accelerator he'd recommend. Having used turckmmcache (and now eaccelerator) for several years, I was interested in his thoughts. Far and away, his recommendation was APC. That is where all major community focus in (free) PHP accelerators seems to be headed.
- inactive, on 10/12/2007, -0/+0in my own speedtests eAccelerator is definitly ruling
- LogicallyGenius, on 10/12/2007, -3/+2PHP 6 is on the horizon (with built in APC)
http://www.corephp.co.uk/archives/19-Prepare-for-PHP-6.html - brendanc, on 10/12/2007, -3/+2Ok, so, whats the site?
- 200iso, on 10/12/2007, -7/+5I haven't had much luck using php accelerators in the past. The only time I saw a major effect was on a lower end box.
Caching mysql output to a file seems to be much more effective.
I'm running a completely dynamic news site (articles, comments, msgboard) site that gets about 150,000 - 200,000 pageviews per day. - brendanc, on 10/12/2007, -6/+3You know, thats a bunch of crap. I don't care if you get dugg down for revealing your so called high traffic site. It's not slashdot; you don't have karma to "burn".
You might as well not have a site because thats about as much credibility as you've got by saying you can't tell us. - chronodev, on 10/12/2007, -5/+1Best php accelarator:
http://www.youtube.com/watch?v=UHRw0lJoylk - diablonhn, on 10/12/2007, -4/+0You guys should check out Quercus from Caucho. It's a PHP engine written entirely in Java and comes with popular PHP modules including APC. The cool thing about it is that you can use Java libraries inside your PHP code and vice versa.
http://www.caucho.com/resin-3.1/doc/quercus.xtp - JEmerson, on 10/12/2007, -5/+1"now I have problems getting girls because I'm too nice of a person, and a young woman wants more than nice.. They want someone to beat them, and um be assertive"
What women want is a dominant male. Which is confused by both themselves and young males as the same as being an abusive dick. Women do want a nice guy, but they just need him to have evidence of good genetic stock to offer for their protection, and for that and the generation of offspring. I'll gaurentee that as much as you think you want total equality that you're looking for the same thing as well. Deny it as much as we want, we're a slave to a genetic pattern that was formed before our neocortex-a-go-go society decided things should be different.
Seriously, if you're not in the upper 10% in terms of physical shape, get there. Do the same for a skill that'll have a probability of getting you money. Those two, plus confidence and nice guy will net you the best years of your life while you're in school. - streaky, on 10/12/2007, -5/+0Just a note, you should always tune your code first (both PHP and SQL to the point that you shouldn't need an accelerator) *then* choose an accelerator :p
And just to point out that Zend Optimizer is a) Not commercial (at least you don't have to pay to use / install it - don't confuse it with Zend's other products - though the source would be nice) and b) Pretty damn good at what it does.
Other than that, a reasonably well worked article. - msergeant, on 10/12/2007, -10/+3MySQL is great as long as you don't value your data in anyway.
- slasherx, on 10/12/2007, -12/+3One of your best optimizations would be to move from mysql to postgresql and optimize that if possible. A combination of squid and memcached and even a self written file cacher for static pages will greatly help out your server.
- inactive, on 10/12/2007, -17/+0Is anyone even listening to you?


What is Digg?
The Digg Toolbar for Firefox lets you Digg, submit content, and keep track of Digg even when you're not on the Digg site. Download the official