Slashdot Mirror


Optimize PHP and Accelerate Apache

An anonymous reader writes "As the load on an application increases, the bottlenecks in the underlying infrastructure become more apparent in the form of slow response to user requests. This article discusses many of the server configuration items that can make or break an application's performance and focuses on steps you can take to optimize Apache and PHP."

191 comments

  1. want performance from php? by wwmedia · · Score: 3, Interesting

    want performance from php?

    Dump Apache! its the slowest link!

    use Lighttpd + latest PHP 5.2.2 + APC

    1. Re:want performance from php? by Ant+P. · · Score: 3, Interesting

      I'll second that - Apache is as bad as Firefox when it comes to resource waste. On my machine, lighttpd uses about 1MB of RAM, not counting the PHP processes.

    2. Re:want performance from php? by Anonymous Coward · · Score: 1, Insightful

      Lighttpd?
      A buggy server and FastCGI, really great combination.
      No thanks!

    3. Re:want performance from php? by Anonymous Coward · · Score: 3, Interesting

      There are many reasons Apache httpd is the standard and speed isn't one of them but lighttpd is pretty awful although lua integration is cool (much faster than PHP). I might say that if you want performance, avoid crap like PHP and Ruby. That's pretty much true but ignores the fact the bottleneck is usually going to be the database, regardless of whatever other software you happen to be running.

      TFA reads like a newbies blog article, 'OMG I know how to haX0r php.ini and httpd.conf'. Any half decent sys admin already knows all this - it's obvious and well documented stuff. I wouldn't be surprised if the author just reworded a couple of blog entries for this article.

    4. Re:want performance from php? by Anonymous Coward · · Score: 3, Informative

      That sounds like a rather dumb comment. I also bet you are comparing lighty to apache 1.3. Or you do not know what you`re talking about. I have had (until february) a P3-400 w. 256 MB with around 200 Domains configured (of which 2 make up for 98% of traffic)
      running a LAMP Stack w. apache 1.3. The machine serves 6 concurrent users with 8.9 Database-Hits/Sec serving around 30-40G/month.

      I have absolutely no problem with apaches speed when it comes to serving pages. It does lag when forking processes, though, so I have to keep a certain quantity of processes in reserve (20).

      This leads to memory problems, especially since, with mod_php, the process size alway increases but never decreases with apache-process age. Thrading (where basically memory is shared) and Fastcgi for the php should cure that. And that is what lighty does. But: with apache2, worker mpm and mod_fcgid, it works, too.

      Then all you need to do is keep keepaliverequests reasonable and keepalivetimeout low. And get a reverse proxy (apache2.2).
      Lighty is probably good, but I do not think it has much advantage over a well tuned apache.

    5. Re:want performance from php? by malsdavis · · Score: 2, Informative

      I would love to dump Apache, but Lighttpd and the other alternatives simply don't provide the power, functionality and customisation I need from my servers. Then there are the many inequitable Apache extensions which are simply a necessity in some situations.

      Personally I feel Lighttpd is just too light, but I agree, Apache is too heavy. I would love to find a happy medium but I am yet to find a httpd server which even approaches Apache and its popularity shows that an awful lot of people agree with this.

    6. Re:want performance from php? by Anonymous Coward · · Score: 0

      Hey dude, take a look at varnish instead of using Apache as a reverse proxy ;-)

      Myself, I like mathopd for static content and employ a stripped down Apache 1.3 with a static mod_php for the dynamic stuff. Lighttpd is often promoted by fanbois that obviously don't even run busy sites - it's very strange these guys think themselves qualified to give advice (and yes, I have evaluated it).

    7. Re:want performance from php? by Anonymous Coward · · Score: 0

      "wealth creation" is a measure of future expectations. It does not break any rules.

    8. Re:want performance from php? by TheLink · · Score: 2, Interesting

      lighttpd leaks memory, how secure and "lightweight" is that?

      So far Apache is good enough for me, but if you're going to replace Apache with something that is fast and has features, you may wish try Zeus.

      Anyway, I'd dump PHP first. PHP is slow and has tons of security problems - and judging from the way the devs do stuff, there'll be plenty more to come.

      --
    9. Re:want performance from php? by Anonymous Coward · · Score: 0

      no, the performance bottleneck lies with PHP being incompatible with pure threaded apache. It's been a long time since apache2 came out, and php is only partially threadsafe. The weakest link is PHP.

    10. Re:want performance from php? by prencher · · Score: 1

      YouTube, reddit, parts of wikipedia, imageshack, sourceforge all use lighttpd.. Are those small sites?

      More here: http://blog.lighttpd.net/articles/2006/12/28/light tpd-powers-5-alexa-top-250-sites

    11. Re:want performance from php? by pooh666 · · Score: 2, Insightful

      Apache is what you *make* of it. If it is heavy look to your sysadmin and cut out the stuff you don't use. The idea that Apache is a bottleneck compared to ANY scripting application is totally misguided nonsense. I can't believe such an ignorant comment got any mod points, even on Slashdot. I can get at least 100Mbs out of a single server pumping out static content with nothing special other than removing unused modules in the compile to save on memory. So guess what, you are WRONG.. I at one point tried using things like thttpd for banner servers, I found with a little work, I could get Apache to run FASTER than those tiny httpd servers and I didn't loose out by having to work with a feature poor server.

    12. Re:want performance from php? by future+assassin · · Score: 1

      Or from other people experiences that I've been reading about go with Litespeed http://litespeedtech.com/

      --
      by TheSpoom (715771) Uncaring Linux user here. I have nothing to add to this but please continue. *munches popcorn*
    13. Re:want performance from php? by Anonymous Coward · · Score: 0

      Only for static content you retard.

    14. Re:want performance from php? by Anonymous Coward · · Score: 1, Informative
      > YouTube, reddit, parts of wikipedia, imageshack, sourceforge all use lighttpd..

      ...and thousands of bloggers copy them blindly without understanding the problem area. Then they go espousing how lighttpd is some magic bullet, when the truth is that every situation is different. YouTube (for example) also use Apache, what does that tell us?

      One thing lighttpd has going for it is SCGI, FCGI really does need to die.

    15. Re:want performance from php? by nneonneo · · Score: 1

      Hmm, the article you linked to says that Slashdot runs PHP -- I'm pretty sure that isn't the case. In any case, the majority of the sites mentioned are using Lighttpd for static content only.

    16. Re:want performance from php? by gbjbaanb · · Score: 4, Insightful

      They are for static content.

      Now lighttpd serves 6 out of the top 250 sites. Do you think the other 246 run IIS or something?

      Lighttpd is good, but is best used in specialised instances, for specific (mainly static content) tasks. Its pointless using it for PHP as the cost of forking out a process to run the script will outweigh any saving from running a lighter-weight http server.

    17. Re:want performance from php? by doubledjd · · Score: 5, Informative
      My history is java but I've come to appreciate php recently. The track record on it when used properly is impressive. In case there are some people just starting with it, the several of the problems with php performance is caching. (this is pretty standard stuff so apoligies to people who know a lot more about it than I do)
      1. Use apc or eaccelerator. (yahoo uses apc so that is the one we went with). This alone will give considerable benefit. Apc can defaultly cache any of the php that runs or it can also be used as a local cache for objects you'd like to store programmatically.
      2. If you need distributed items, especially in a non-sticky load balanced environment, look at memcached.
      3. Use a query cache for your db
      4. If your db connections are expensive, look at sqlrelay
      5. Look at whether a caching proxy is a possibility for you (squid or apache has some mods).
      6. Benchmark your pages and functions. It is the only way to know if configuration tweaks are adding any value. I usually do this after a full profiling using apd (to help identify the bottlenecks and frequently called functions). I usually run apache's ab to get a look at page benchmarks.
      7. you can always write c extensions for items in php that are too slow. Of course, you'll have to know c, increased maintenance, development time, etc
      There are a million things to be done to increase performance. Obviously, don't use anything blindly. Still, I think the opcode cache (apc or eAccelerator) is probably the easiest and most substantial win.
    18. Re:want performance from php? by consumer · · Score: 5, Informative

      All that apache does when serving PHP requests with mod_php is run the early phases (auth, URL mapping) and pass the request to PHP. Do you really think that Lighttpd + FastCGI is going to be significantly faster than that? The bottleneck is your PHP code, not the web server.



      Lighttpd is probably faster at serving static content. Most sites don't have enough bandwidth to find out.

    19. Re:want performance from php? by TheLink · · Score: 2

      Flamebait? Someone can't handle the truth? Tsk tsk :).

      "lighttpd leaks memory":
      http://www.google.com/search?hl=en&safe=off&q=+sit e:trac.lighttpd.net+lighttpd+memory+leak
      Random complainer: http://hostingfu.com/article/nginx-vs-lighttpd-for -a-small-vps

      As for security: Apache isn't what you'd call secure software, but Lighttpd isn't either.

      PHP is slower than Perl or Python for most stuff. This should be common knowledge amongst decent programmers- go find/make your own benchmarks and links.

      PHP security? ;). Need I say more?

      --
    20. Re:want performance from php? by julesh · · Score: 1

      Speaking as somebody who runs PHP in a threaded environment, PHP is actually pretty damned stable in one (i.e., it has *never* crashed for me). As I understand it, as long as you stay away from the less frequently-used extensions, you'll be fine.

    21. Re:want performance from php? by Anonymous Coward · · Score: 0

      Or use the Zeus Web Server - way faster then Apache, especially when running PHP using FastCGI.

    22. Re:want performance from php? by TheRaven64 · · Score: 1

      Its pointless using it for PHP as the cost of forking out a process to run the script will outweigh any saving from running a lighter-weight http server. Lighttpd uses FastCGI for PHP, so the PHP scripts run in a separate process which persists across connections (and several can be used for load balancing). There may be other reasons for not using Lighttpd with PHP (I've not tried), but the cost of fork is not one of them.
      --
      I am TheRaven on Soylent News
    23. Re:want performance from php? by malsdavis · · Score: 5, Insightful

      "PHP is slower than Perl or Python for most stuff."

      I'd say that in practice (i.e. when performing the vast majority of dynamic web functionality: e.g. database lookups) the opposite is true. Perl & Python are quicker at some tasks, but every-time I've rewritten a website between PHP and Perl (I don't program in Python because it's named after my most hated animal), PHP has come out slightly on top.

    24. Re:want performance from php? by prencher · · Score: 1

      This is of course true to an extent, but to say that lighttpd is only good at static content serving is flat out false; Look at reddit for example.

      Furthermore, I never argued whether or not ligthy is better than apache in my post, I just wanted to make clear that lighttpd certainly has a use for busy dynamic sites as well. The post I replied to seemed to imply this is not the case.

    25. Re:want performance from php? by Fweeky · · Score: 1, Insightful

      Quite; you can easily use FastCGI with Apache too (though lighttpd's built-in load balancing sounds nice; hopefully mod_proxy{,_balancer} will one day grow useful FastCGI support). Do that and watch as Apache sits using about 1000x less CPU than your backend PHP's.

      lighttpd and friends are generally better if you're serving static content, but it's doubtful you'll notice unless you're talking in terms of many thousands of requests per second to a single server. That's not to say there aren't other reasons you might want to use lighttpd, but performance isn't really one of the interesting ones.

    26. Re:want performance from php? by Anonymous Coward · · Score: 0

      > The post I replied to seemed to imply this is not the case.

      That would be my post and I didn't mean to imply that. I was just pointing out that lighttpd seems to be promoted by plenty of people who don't run busy sites. It's single process design uses less memory than Apache and that alone may be a valid reason to use it but as someone below noted; very few sites have the bandwidth required to benefit from the performance gains. This is especially true since the OP was talking about replacing Apache + PHP where performance gains would be minimal at best.

    27. Re:want performance from php? by SQL+Error · · Score: 5, Insightful

      The problem is not that Apache is slow, it's that it uses huge amounts of memory. If your database is running slow for some reason - say, during backups - requests will start to queue up, Apache will start more and more threads to handle those requests, and things will spiral rapidly out of control.

      Lightppd doesn't have that problem.

    28. Re:want performance from php? by Anonymous Coward · · Score: 1, Insightful

      > Lightppd doesn't have that problem.

      No, it leaks memory instead.

      Nginx doesn't have either problem.

    29. Re:want performance from php? by kbahey · · Score: 1

      As far as Lighttpd is concerned, there is an up and coming competitor called nginx (Engine X). Its reputation is that it has all the benefits of Lighty, minus the memory leaks.

      I have benchmarked APC vs. eAccelerator and found that eAccelerator is some 13% faster. It also has significantly lower memory consumption than APC.

    30. Re:want performance from php? by kbahey · · Score: 1

      If you want to stay with Apache, then the quickest fix for this is to reduce the number of MaxClients so that an incoming avalanche of traffic does not cause overuse of memory and hence the swapping to hell syndrome.

      What number to set it to depends on the size of each Apache process, and how much memory you can spare in the system.

    31. Re:want performance from php? by consumer · · Score: 4, Interesting

      If you use separate processes for your static content and your PHP (either Apache with FastCGI or a reverse proxy), you won't have problems with memory. The size of an Apache process that's just serving static stuff is tiny. It's the PHP processes that take the RAM, and they will do the same when run from Lighttpd.

    32. Re:want performance from php? by NickFitz · · Score: 1

      Hmm, the article you linked to says that Slashdot runs PHP -- I'm pretty sure that isn't the case.

      You are correct.

      --
      Using HTML in email is like putting sound effects on your phone calls. Just say <strong>no</strong>.
    33. Re:want performance from php? by SQL+Error · · Score: 1

      Yes, that stops it killing your server, and instead it rejects requests. It does nothing to actually fix the problem.

    34. Re:want performance from php? by QuoteMstr · · Score: 1

      Your server is going to choke at some maximum number of clients anyway. You might as well configure it to handle what it can and gracefully reject the rest instead of letting everybody's requests wallow in a mire of thrashing.

    35. Re:want performance from php? by Anonymous Coward · · Score: 5, Funny

      Dear Opera user: Fuck you.

    36. Re:want performance from php? by QuoteMstr · · Score: 1

      Grow up. What, am I supposed to like Java because it's named after my favorite drink?

    37. Re:want performance from php? by Anonymous Coward · · Score: 0, Troll

      That's pretty much true but ignores the fact the bottleneck is usually going to be the database
      Can you clarify what this means? In particular, what is a bottleneck and what is a database?

      (this is wwmedia speaking, I can't post under my own name for some reason)
    38. Re:want performance from php? by malsdavis · · Score: 0, Flamebait

      I think it is yourself who needs to gain a bit of maturity. While your at it maybe you could learn to spot obvious jokes.

    39. Re:want performance from php? by QuoteMstr · · Score: 2, Interesting

      As somebody who's writing a program that might be running under fastcgi, I'm genuinely curious as to why fastcgi sucks and scgi is better.

    40. Re:want performance from php? by cheater512 · · Score: 1

      Just so you know, you can make processes die after X requests to solve the memory problem.

    41. Re:want performance from php? by cheater512 · · Score: 1

      Yep your right. Slashdot runs off Perl.

      I find it rather ironic how few people here would say good things about Perl.

    42. Re:want performance from php? by Anonymous Coward · · Score: 1, Informative

      FastCGI is over-complex and was abandoned tech until the rails guys started using it. mod_${script_host} was deemed a better solution by almost everybody back in the day.

      Compare the specs: SCGI FCGI

      You could probably write a SCGI daemon in your lunch hour.

    43. Re:want performance from php? by BertieBaggio · · Score: 1

      So, Indy, you gave up on archaeology and fighting Nazis to hack PHP and Perl?

      --
      If all you have is a grenade, pretty soon every problem looks like a foxhole -- MightyYar
    44. Re:want performance from php? by FST777 · · Score: 1

      True, for webpages. But the summary (haven't read TFA yet) talks about applications. Now that's more than webpages.

      Consider a chat-application (I've written and I'm maintaining one) based on AJAX. To feel responsive, every parttaker in a chatsession should at least fire one XMLHttpRequest each second. More would be nice. Lighttpd can handle that with two or three "chatters" online. More becomes painstaking. The same is true with Apache 2 using the default settings, but you can increase the maximum it can handle by tweaking several settings.

      I've seen Apache being forced on its knees with ten connections issuing two request per second each. Lighttpd wouldn't even dream of doing that. After some tweaking, Apache could easily handle 40 of those connections. The bottleneck then is memory usage at the PHP side of the coin. So I'm off to RTFA to see if they have any solution on that.

      --
      Free beer is never free as in speech. Free speech is always free as in beer.
    45. Re:want performance from php? by kv9 · · Score: 2, Insightful
      Yep your right. Slashdot runs off Perl. I find it rather ironic how few people here would say good things about Perl.

      or that "shitty non-database" MySQL that manages to store all the bazillion comments/stories and is constantly hit.

    46. Re:want performance from php? by trawg · · Score: 1

      Yes, that stops it killing your server, and instead it rejects requests. It does nothing to actually fix the problem. It doesn't actually rejects them (unless you configure it to do so) - by default it just queues them somehow internally in apache (so when one of the clients disconnects freeing up a connection, one of the queued connections waiting for a free spot nabs it).

      I assume this behaviour is documented somewhere, but I haven't seen it.
    47. Re:want performance from php? by azenpunk · · Score: 1

      python is named for a sketch comedy troupe. i'll let you guess which one.

      aren't you glad? now you can use the language!

      and today i am a true slashdotter, for i have taken time out of my busy (ha!) day to correct some pointless detail in another's post, hopefully showing off my knowledge and intelligence. yes, i am one of you now.

      (what can i say, it's been a slow day)

    48. Re:want performance from php? by malsdavis · · Score: 1

      "python is named for a sketch comedy troupe. i'll let you guess which one."

      Hah, that is good to know. Actually, I've always been a big Monty Python fan and never realized that it mentions a snake in its name. Damn, now rather than use Python I'm probably going to not watch Monty Python either!

      Only joking, the real reason I don't use python is I have never seen any real major advantage in using it over Perl/PHP/Java. Having said that, the couple of times I've played around with it I did keep on getting this creeping feeling that something was slithering around my legs under the desk!

      Btw, welcome to the world of the slashdotter, all you have to do now is make sure you don't actually read linked articles before giving your opinion on them and then your journey towards the dark side will be complete.

    49. Re:want performance from php? by Lakenarr · · Score: 1

      You are wrong. Check meebo.com to see what lighttpd does under heavy ajax request load.

    50. Re:want performance from php? by azenpunk · · Score: 1

      linked articles?

    51. Re:want performance from php? by malsdavis · · Score: 1

      I mean the articles linked to from within the stories on Slashdot's main-page.

    52. Re:want performance from php? by TheSunborn · · Score: 1

      I don't think apache queue the requests. But the operation system does as part of the normal tcp/ip handling.

      The os will always queue incomming requests for a given port if a program(apache) have been bound to that port.
      The request will then be in queue until apache calls accept() and accept the new connection.
      There is ofcause a limit to how much the os will queue, and after that it just refuse new connections similary to if no webserver were running.

    53. Re:want performance from php? by trawg · · Score: 1

      Ahh, ok - I just figured it was apache because I assumed it would have closed the port or something when it had hit MaxClients, so I thought it was dealing with it by leaving the port open and accepting requests and just processing them later on a first come first serve basis, but what you're saying makes sense.

      So I guess what could also happen is you could exhaust the operating system's ability to handle connections, right? So if you hit MaxClients early and you have thousands and thousands of users trying to get to the site, I assume that must be consuming some operating system resource to manage all those connections - and if it is set really high, perhaps it could cause some other problem to arise.

    54. Re:want performance from php? by Anonymous Coward · · Score: 0

      Has anyone played with SAMP (Solaris, Apache 2, MySQL 5, and PHP 5) for Solaris 10 or Solaris Express? http://www.sun.com/bigadmin/features/articles/samp _setup.html

    55. Re:want performance from php? by Anonymous Coward · · Score: 0

      Looks like you are already on the right track

    56. Re:want performance from php? by Buzzard2501 · · Score: 1

      Lighttpd is good, but is best used in specialised instances, for specific (mainly static content) tasks. Its pointless using it for PHP as the cost of forking out a process to run the script will outweigh any saving from running a lighter-weight http server.
      That's why when we have FastCGI
      --
      Real programmers don't comment their code. It was hard to write, it should be hard to understand.
    57. Re:want performance from php? by Anonymous Coward · · Score: 0

      PHP security? ;). Need I say more?

      Um, if you mean the security of poorly programmed web applications (e.g. PHP-BB, PHP-Function-Name-Here) then yes, but the language/framework itself had a very good security track record.

      There are some stupid features that can make it easy to shoot yourself in the foot (Global variable from post names anyone?), but if you know your way around any web based programming language (e.g. PERL) you'd know better than to use weak features like that.

      PHP in and by itself is no more or less secure than other languages, it's the packages/apps that were programmed with them. For example:

      <?php echo "Hack this..."; ?>

    58. Re:want performance from php? by azenpunk · · Score: 1

      tried to be funny, failed at it. my indoctrination continues.

    59. Re:want performance from php? by Anonymous Coward · · Score: 0

      maybe you could learn to spot obvious jokes.
      Maybe you should learn to make funny ones?
    60. Re:want performance from php? by The+Bionic+Vapour+Bo · · Score: 1

      What bout nginx instead of Lighttpd?

    61. Re:want performance from php? by Rudd-O · · Score: 2, Insightful

      Yes, it queues request, and you can configure the queue depth in the Apache config file. See the apache docs.

      --
      Rudd-O - http://rudd-o.com/
    62. Re:want performance from php? by Rudd-O · · Score: 1

      If you want a chat app to work and you want it to scale, you need to look into using comet instead of AJAX. Of course, you can rule Apache out for comet because it requires one permanent connection per client, and the per-process memory usage of Apache makes it prohibitively expensive for large numbers of processes.

      I'm old enough to remember the wbs.net chat rooms. They used comet and they worked fine.

      --
      Rudd-O - http://rudd-o.com/
    63. Re:want performance from php? by ceeam · · Score: 1

      1.4.13 does not leak in my experience. Having it running for months on medium traffic site.

    64. Re:want performance from php? by ceeam · · Score: 1

      First - you don't want to use Apache with FastCGI with PHP. And if you use mod_php (like all people do) you can't limit PHP processes to reasonable amount (say, 4 times the number of cores you have) without limiting the number of HTTP requests at all. Am I right?

    65. Re:want performance from php? by Anonymous Coward · · Score: 0

      What are the reasons for choosing PHP/Apache over ASP/IIS?

      Remote dedicated servers running linux run about $99/month and with w2k3 its $120. Not a huge difference. I suppose if I had a couple dozen servers in house then the licensing could become a factor, but thats still only about $1000/per server for the OS.

      I can't see anything apparent that makes PHP syntactically preferable to ASP. I guess that really comes down to familiarity.

      For me the only thing appealing about PHP is the great number of free apps. (eg SugarCRM and ilk) What I was wondering is why those apps choose PHP in the first place?

    66. Re:want performance from php? by FooBarWidget · · Score: 1

      Sure, but how's that relevant now? There are FCGI implementations that are ready to use. FCGI seem to be maintained right now. So what makes FCGI a bad choice *today*?

    67. Re:want performance from php? by TheSunborn · · Score: 1

      If you talk about the ListenBacklog option (http://httpd.apache.org/docs/2.2/mod/mpm_common.h tml) it just set the backlog(queue) size for the tcp/ip stack.

      And just because I am bored now, I looked op SOMAXCONN which is defined to 128, so the default limit for linux(Fedora core 5, kernel 2.6.20) is 128 which is actuelly rather small.

    68. Re:want performance from php? by CarpetShark · · Score: 1

      "want performance from php?

        Dump Apache! its the slowest link!"

      Then dump php, and get a real webapp tool.

    69. Re:want performance from php? by killjoe · · Score: 1

      I hear AOLserver + TCL is also blazingly fast.

      --
      evil is as evil does
    70. Re:want performance from php? by 1110110001 · · Score: 1

      Flamebait? Someone can't handle the truth? Tsk tsk :).
      Or not all have mem leaks and/or don't care for bugs closed months ago.

      PHP is slower than Perl or Python for most stuff.
      And your filesystem, database or network is even slower. Benchmarks != real applications.

      PHP security? ;). Need I say more?
      Maybe show security problems on Flickr or in Yahoo apps or comparable apps written in PHP.

    71. Re:want performance from php? by Khazunga · · Score: 3, Interesting

      Lighttpd is awful for any serious use. Until it has a decent URL rewriting module, it's a toy. Apache with an event MPM is on par with lighttpd on speed and memory usage -- ie. it's a bit larger than lighty, but does contain more features.

      --
      If at first you don't succeed, skydiving is not for you
    72. Re:want performance from php? by Khazunga · · Score: 1

      Sure, but how's that relevant now? There are FCGI implementations that are ready to use. FCGI seem to be maintained right now. So what makes FCGI a bad choice *today*?
      FCGI doesn't seem maintained. mod_fastcgi has no releases after 2004:
      http://www.fastcgi.com/dist/
      and mod_cgid always suffered from instability under serious loads, which was never solved. There is no fastcgi module from the ASF...
      --
      If at first you don't succeed, skydiving is not for you
    73. Re:want performance from php? by Khazunga · · Score: 1

      Personally I feel Lighttpd is just too light, but I agree, Apache is too heavy. I would love to find a happy medium but I am yet to find a httpd server which even approaches Apache and its popularity shows that an awful lot of people agree with this.
      Exactly my feeling. I've settled with a frontend Apache, running an event MPM, along with a backend apache with a prefork MPM. The frontend handles URL-rewriting, keepalive connections and mod_deflate filtering, then serves all static content. Non-static content is proxied to the backend apache, without keepalive (connections are local, so I don't want processes 'hung' on keepalives because of memory consumption) and with mod_cache. The backend apache contains the modules needed to serve dynamic content, namely mod_php -- the largest memory hog.
      --
      If at first you don't succeed, skydiving is not for you
    74. Re:want performance from php? by Khazunga · · Score: 1

      The problem is not that Apache is slow, it's that it uses huge amounts of memory. If your database is running slow for some reason - say, during backups - requests will start to queue up, Apache will start more and more threads to handle those requests, and things will spiral rapidly out of control.
      Don't set MaxClients so high that you'll run out of memory. Apache can queue requests at the ip stack level, before launching a new process to handle them.
      --
      If at first you don't succeed, skydiving is not for you
    75. Re:want performance from php? by rsax · · Score: 1
      "If your db connections are expensive, look at sqlrelay"

      To what extent have you used sqlrelay? Any particular shortcomings? It sounds like it would be a nice solution to use where you have multiple database servers and only want to use one for updates/inserts but not a lot of people use it for some reason.

    76. Re:want performance from php? by baadger · · Score: 1

      I don't get it.

      Isn't the point of FastCGI (fcgi) to enable communication between a web server and an arbitrary *persistent* daemon process (the CGI) to avoid the overhead* you commonly get with standard CGI?

      I've read your little SCGI protocol.txt file and it doesn't explain any of this, in fact it looks like it advocates just passing the request (HTTP headers) through another TCP (well, a "reliable stream protocol") connection to the CGI process much like regular CGI (but without the use of environment variables as a transport). It doesn't seem to even try to deal with the **management** of these CGI processes, their *lifetime* of the process, or how they should inform the web server of whats going on. Doesn't that leave it up to implementation designers to invent their own management interface?

      What i'm trying to say is, SCGI may be ridiculously simple but, unless I'm missing a massive chunk of specification I don't see how it solves any problems with FastCGI. In fact the only advantage it seems to have over *standard* CGI is the fact it uses a stream connection and can therefore be located on remote machine (like FastCGI can). If I'm missing something, please explain.

      * Process startup and/or fork()'ing, script interpretation, server side resources such as database connections being obtained etc.

    77. Re:want performance from php? by Ekarderif · · Score: 1

      I don't program in Perl because it's named after an obscene sexual practice.

    78. Re:want performance from php? by Nasarius · · Score: 1

      the real reason I don't use python is I have never seen any real major advantage in using it over Perl/PHP/Java
      I assume you're only talking about web programming here, because Python occupies a vastly different niche than any of the above. As an object-oriented Swiss army knife that can gracefully handle anything from simple one-off scripts, to embedded scripting in a C++ app, to huge complex GUI applications all by itself, its only real competitor is Ruby. And for web stuff, Django is already better than Rails.
      --
      LOAD "SIG",8,1
    79. Re:want performance from php? by Anonymous Coward · · Score: 0

      > that manages to store all the bazillion comments/stories and is constantly hit.

      For some "3% downtime" value of "manages", yeah.

    80. Re:want performance from php? by NeptuneSunset · · Score: 1

      You run a performance website... invest in performance equipment!

    81. Re:want performance from php? by consumer · · Score: 1

      You don't say why you're against Apache with FastCGI for PHP. Maybe you think the FastCGI implementation is not good? A lot of people use it. Anyone running mod_php on a popular site should run a reverse proxy in front of their mod_php server for static content. Then you have separate control for static and PHP content (effectively the same as FastCGI).

    82. Re:want performance from php? by Anonymous Coward · · Score: 0

      > I don't program in Perl because it's named after an obscene sexual practice.

      Heh heh heh good one!

      I don't program in Pascal because it's named after a Frenchman, who also happened to be a religious philosopher.

    83. Re:want performance from php? by Anonymous Coward · · Score: 0

      >> maybe you could learn to spot obvious jokes.
      > Maybe you should learn to make funny ones?

      Maybe you could just write "DICK" on your head, it would save you the trouble of having to converse with people.

  2. Of course! by BabaYama · · Score: 5, Funny

    You should compile it yourself wicked fast compiler optimizations on top of your wicked fast install of Gentoo (which you also compiled yourself)

    --
    Sucks
    1. Re:Of course! by VagaStorm · · Score: 1

      I disagree, an eterprice enviornment is the only place you should ever have to compile anything for yourself :p Umless ofcource you just wrote it :p

    2. Re:Of course! by cheater512 · · Score: 1

      Hey! I didnt apply stupid CFLAGs. ;)

      Yeah one of the servers on a large site I manage runs Gentoo which I installed.
      Its a smaller server than the others but it can keep up well.

  3. Modules by deftcoder · · Score: 2, Interesting

    Apache generally ships (on most distros) with TONS of modules enabled... kill off any unneeded modules (come on, how many of you actually use mod_userdir or mod_rewrite?), tweak your MPM settings, and be done with it.

    I also force PHP to run in FastCGI mode, that way I can use suExec with it to prevent exploits in PHP itself from allowing the entire system to be compromised. Apache suid()s itself after handling the request, but the Apache user can generally write to a few good places, therefore I use suExec.

    --
    Peace sells, but who's buying?
    1. Re:Modules by tomhudson · · Score: 1

      "kill off any unneeded modules (come on, how many of you actually use mod_userdir or mod_rewrite"

      Are you kidding? If anything, those are the two that are the handiest. Ever use short urls? That's mod_rewrite for you. Ever have users with their own public_html? That's mod_userdir.

      Really, if you're going to pick on something, pick on, um, maybe mod_speling. (no that's not a spelling mistake - its a module that tries to guess what you really wanted if you misspelled a url, rather than just sending a 404, and even that doesn't take up much resources, since its only called in the event a request would generate a 404, not on success, so even mod_speling isn't "evil").

    2. Re:Modules by Anonymous Coward · · Score: 0
      Struck me as odd considering mod rewrite isn't even built by default in the 1.3 series.

      ./configure \
      "--with-layout=Apache" \
      "--activate-module=src/modules/php5/libphp5.a" \
      "--disable-module=imap" \
      "--disable-module=include" \
      "--enable-module=rewrite" \
      "--prefix=/srv/www"
    3. Re:Modules by Anonymous Coward · · Score: 0

      I use mod_rewrite on every project I'm currently working on, and unless something better comes along, I'll keep using it for the foreseeable future.

  4. But I Can't Pronounce "LLMP"! (n/t) by Mateo_LeFou · · Score: 3, Funny

    no text

    --
    My turnips listen for the soft cry of your love
  5. Dunmp then both by butlerdi · · Score: 2, Interesting

    I have found that a truly scaleable design pattern is using a lean little engine like Jetty and a declarative/Rest based architecture. We have recently ported Sugar CRM PHP/Apache to NetKernel and lost over 95% of the code and subsecond response times. We kept the horrible database design and the workflow in the first version as well, so reworking that will further improve performance and further reduce the need for code. For me performance is important but maintainability is equal. The less code the easier to maintain. There is a great white paper from the NK guys here

    --
    "If the King's English was good enough for Jesus, it's good enough for me!" -- "Ma" Ferguson, Governor of Texas (circa
    1. Re:Dunmp then both by gbjbaanb · · Score: 2, Funny

      If I took an app, "lost" 95% of the code, then I guarantee it'd work faster. Of course, by "work" I mean, "do nothing" but lets not let a little semantics get in that way of some technical self-aggrandisement. :)

    2. Re:Dunmp then both by butlerdi · · Score: 2, Insightful

      Well, it now has all of the original functionality it had and that is down to the lack of redundant code and frameworks. Declarative based systems are just different. PHP is an awful lot of code. The code seems to me difficult to maintain and modify, but this is just my experience. I stopped using the J2EE frameworks for the same reason. After 30 years of hacking this stuff I have seen an awful lot of 3GL, 4GL .... and other frameworks and they all have to me seemed a bit bulky. Like when I try to find the actual business logic in most of them. Web based apps have come a long way, I started with WebObjects on the Next machines, and have tried many of the methodologies currently being used Ruby, Groovy, PHP, JSP et al. Declarative and RESTfull systems have just worked for me and I have always found that most of the code in the others was for the framework not my app. But as I said before, this has just been my humble experience.

      --
      "If the King's English was good enough for Jesus, it's good enough for me!" -- "Ma" Ferguson, Governor of Texas (circa
    3. Re:Dunmp then both by ABasketOfPups · · Score: 1

      The NetKernel doc says code required is "10x to 100x less than other approaches" which, along with the complete technobabble in the early part of the doc, tells me this is Yet Another Piece O' Nonsense.

      I'll start believing when you have a complete working example of an application (not the NetKernel framework) that you can share, in full, with the world, that compares directly with another known piece of software. In the meantime, read Don't let architecture astronauhts scare you.

    4. Re:Dunmp then both by butlerdi · · Score: 1

      It was a research project at HP which was spun off. Our firm has been using it for the past four years and it does in fact do exactly what it says on the box. We have developed systems for several Telcoms, Manufacturers and Service Companies. Technobabble, I dont know, isnt most computer related literature ? I think that the whitepaper makes it fairly obvious why and how it works and I did not think it to be too heavy on the technobabble. Anyway, the CRM code that we have been porting will be posted by the end of the week to Sourceforge NK-CRM. My only reason for posting on this topic was that I have spent the last week or so porting Sugar CRM from PHP and it is truly a lot of work that would not have been necessary had the performance with PHP been better.

      --
      "If the King's English was good enough for Jesus, it's good enough for me!" -- "Ma" Ferguson, Governor of Texas (circa
  6. Diet article by billcopc · · Score: 5, Informative

    Maybe I'm being a cynical bastard again, but that article is REEEALLY light on content. Compared to the other featured articles from IBM, which are usually very rich and informative, this one is more like an "idiots guide to apache", the kind that belongs on Digg's mountain of filth. This is little more than a rehash of the Readme files for Apache and PHP combined. It's about as deep as telling a windows user how to make their PC faster by changing to the Windows NT theme. Of much greater value to web professionals is this article from a fellow OSDN site (!) Lighttpd can lighten Apache's load

    --
    -Billco, Fnarg.com
    1. Re:Diet article by iknownuttin · · Score: 1
      Maybe I'm being a cynical bastard again...

      It's called being a realist and I, personally, don't think you should imply an apology - especially in this over-hyping everything day and age.

      --
      I prefer Flambe as apposed flamebait.
    2. Re:Diet article by mangu · · Score: 1
      Maybe I'm being a cynical bastard again,


      Well, yes, I agree, you are being a cynical bastard. I just forwarded the link to a couple of people I know who could get some useful tips from that article. You see, not everyone is born knowing it all, some people can profit from stuff that others already know.


      And also, information isn't like money, that you want as much as possible. There is such a thing as information overload, information is something that you want exactly as much as you need, not a bit more. All in all, I think the IBM page is a good start for someone who needs to configure Apache and has been overwhelmed by all the data available.

    3. Re:Diet article by hachete · · Score: 1

      what's lighty like with mysql in the mix - I run a LAMP installation which could go faster ... an article on fine-tuning LAMP installations would be useful :-)

      --
      Patriotism is a virtue of the vicious
    4. Re:Diet article by Ythan · · Score: 2, Informative

      If you want to improve the performance of your database, you should check out Sphinx to handle your fulltext searching. In my opinion this is one of the most criminally overlooked pieces of software when it comes to website optimization.

    5. Re:Diet article by billcopc · · Score: 1

      I certainly agree with you about information overload. I often times find myself way over my head when all I need is an intro to some topic. This article is neither overloading nor introductory, and I think my biggest problem is that it misses the mark with regards to its target audience. It's offering these horribly basic configuration "tips" that would normally be the first thing a server admin would do, but trying to present them as "performance tips" is complete disinformation. I think the kind of readership on /. and IBM's tech blog would have wanted some nitty gritty on some new tricks to squeeze even more juice out of our already-tuned setups, like the very popular Lighttpd article I linked in my previous comment.

      If it had been titled "How to properly configure your LAMP stack", I would probably have been ok with it. Actually I would have ignored it completely because such things are trivial to me. Calling them performance tips is unnecessary hype. What if it were about auto maintenance, titled "Optimize your engine and make your car go faster" when it was just a PSA about changing your oil regularly and checking your tire pressure ? My gripe is simply that this article claims to be something it's not. The information contained within is still accurate and valuable to some, that's something I can't deny.

      --
      -Billco, Fnarg.com
    6. Re:Diet article by Anonymous Coward · · Score: 0

      >>Maybe I'm being a cynical bastard again

      No, you're being a cynical little bitch ass motherfucker, again.

    7. Re:Diet article by pimpimpim · · Score: 1

      Didn't you notice the "anonymous" article submitter? It went like this: someone wanted to know the best way to increase his apache/php speed. Of course he could write an 'Ask slashdot' entry with this question, but would know that he would only get "don't use php" answers. So he had a cunning plan! Instead he wrote this mock-up article, posted it to slashdot, and is now reading the pretty useful comments out here! This is analogous to the way to get help from linux experts. Never ask them directly for the answer, you'll get a RTFM. Instead, say that you could do this-and-this much more efficiently on Windows before but linux is crap at it, and you will get al the 101 ways to do it perfectly explained.

      --
      molmod.com - computing tips from a molecular modeling
    8. Re:Diet article by billcopc · · Score: 1

      Sounds about right, except nobody posted anything meaty, like making massive edits to the PHP code base to strip out fluff, or implementing an interpreter-level cache that encapsulates multiple script invocations into one persistent execution, or just buying more friggin hardware :)

      --
      -Billco, Fnarg.com
  7. http is the problem by larry+bagina · · Score: 5, Funny

    Last year, we dumped apache (and http altogether) and went with a gopherd/fastcgi approach for serving up our php pages. For people still stuck on port 80, we have a squid proxy which converts the request to gopher. Since then, traffic has increased 34%, while average load has dropped by 20%.

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

  8. You can talk about this all day, but... by sobolwolf · · Score: 1

    Unless these recommendations can implemented in shared hosting environments they are of no real use to someone like me - ie web application designer. In regards to opcode caching I would go with Ioncube as there are runtimes available for most server environments.

    1. Re:You can talk about this all day, but... by Anonymous Coward · · Score: 0

      I don't bother with opcode caching any more. Longterm, I'm going to evaluate the roadsend compiler, caucho and plumhead with a view to replacing Zend for our legacy PHP code. I also expect that the language is going to be forked at some point unless the PHP developers clean up the function naming - it's infuriating.

    2. Re:You can talk about this all day, but... by tomhudson · · Score: 4, Informative

      "I also expect that the language is going to be forked at some point unless the PHP developers clean up the function naming - it's infuriating."

      There's nothing to stop you from cleaning up the function naming. We'd all appreciate it :-)

      Also, if you really want performance "uber alles", don't bother with apache or any other "pre-made" server - write a custom server in c designed to load modules that serve just the content you want served. You can then handle a thousand requests per second (including time to access the database a half-dozen times per request) on comodity hardware.

      Its not like there isn't code out there that shows you how to implement a server in c, how to write and load modules in c, how to use threads in c, and how to access mysql via c. You'll be super fast ... except that your development time will be super slow.

      apache+php is a compromose that most people can live with, most of the time.

      Yes, the function naming in php is crap. Show us a scripting language where it isn't.

    3. Re:You can talk about this all day, but... by julesh · · Score: 1

      Unless these recommendations can implemented in shared hosting environments they are of no real use to someone like me - ie web application designer

      There are plenty of shared hosting providers who will let you use any apache/php settings you choose. I have a virtual server with bytemark, and have so far been quite happy with it. It doesn't cost a fortune, and is quite capable.

    4. Re:You can talk about this all day, but... by Anonymous Coward · · Score: 0

      > There's nothing to stop you from cleaning up the function naming. We'd all appreciate it :-)

      You mean the patch or the resulting flamewar on internals:P

      > write a custom server in c designed to load modules that serve just the content you want served.

      Been there, done that.

      > Yes, the function naming in php is crap. Show us a scripting language where it isn't.

      lua ;-)

    5. Re:You can talk about this all day, but... by suv4x4 · · Score: 1

      Yes, the function naming in php is crap. Show us a scripting language where it isn't.

      Well, the list is too long. First, not scriping languages, but just as fast and robust to develop in : .NET and Java. Then ECMAScript, Ruby, Python etc.

      But I can give you very quickly the list of scripts that have as bad or worse function/feature consistency than php:

    6. Re:You can talk about this all day, but... by imroy · · Score: 1

      Yes, the function naming in php is crap. Show us a scripting language where it isn't.

      Perl, for one.

      To summarise:

      • Arguments and return values are extremely inconsistent
      • PHP has separate functions for case insensitive operations
      • PHP has inconsistent function naming
      • PHP has no lexical scope
      • PHP has too many functions in the core
      • PHP lacks abstraction and takes TIMTOWTDI to bad extremes

      Which all adds up to one thing: PHP is a simple language that's actually rather hard to program in. Or maintain.

    7. Re:You can talk about this all day, but... by Just+Some+Guy · · Score: 1

      Yes, the function naming in php is crap. Show us a scripting language where it isn't.

      Off the top of my head, I can't think of another scripting language that has no support whatsoever for namespaces. So while I can't necessarily show you a language whose function naming doesn't suck, neither can I show you any whose sucks as badly.

      --
      Dewey, what part of this looks like authorities should be involved?
    8. Re:You can talk about this all day, but... by kuzb · · Score: 1

      Strange, I don't seem to have a problem writing in it, or maintaining it. While I'd agree that there is some really bad php out there, the same could be said of Perl. I also agree that PHP lacks some language features that it could use.

      Honestly, if I were to reach for another language to get something done, I'd go for Python or Ruby before I even considered Perl as an option. Both are far more elegant choices.

      --
      BeauHD. Worst editor since kdawson.
    9. Re:You can talk about this all day, but... by imroy · · Score: 1

      Honestly, if I were to reach for another language to get something done, I'd go for Python or Ruby before I even considered Perl as an option. Both are far more elegant choices.

      True, I'd even agree with you there. I simply picked Perl because I've done a lot of work with it and someone had made a really good page comparing the built-in functions of both PHP and Perl. And the core of the PHP language is clearly heavily influenced by Perl. Sadly the original PHP developers show none of the care and insight that Larry Wall shows with Perl. And they took a "hands off" approach to growing the language, allowing people to add cruft with little oversight. Which is why PHP is such a huge mess.

    10. Re:You can talk about this all day, but... by Dirtside · · Score: 1

      PHP has too many functions in the core

      I wanted to discuss this one... I've heard this particular criticism of PHP many times, although I haven't seen any suggestions about what precisely PHP should do to fix this. (Or what precisely is wrong with having a lot of functions in the "core," a term which is also unclear.)

      A fresh PHP 5 install with no optional libraries included has 1,282 functions defined. Is that a lot? The standard C library has around 300 functions. A lot of PHP's functions are things that are commonly useful in the web environments where it's used. I mean, you probably could pare it down some, but you'd start removing functions that a lot of people actually do use. Why stop there? You could simply include no functions by default, except maybe the basic array and variable manipulation functions, I guess, but to what end? Most people would end up having to go through and figure out what to enable, and then... well, the end result is, PHP just wouldn't be as popular as it is now, for better or worse. :) The kitchen-sink approach probably happened because a fair number of people wanted those functions...

      Don't get me wrong, there's a lot about PHP I'd like to see fixed (namespaces, normalizing function naming/parameter order/return values, various quirks). But I just don't see the "too many functions" argument as being a valid one.
      --
      "Destroy science and religion. Science would re-emerge exactly the same; but not religion." - Penn Jillette, paraphrased
    11. Re:You can talk about this all day, but... by Anonymous Coward · · Score: 0

      write a custom server in c designed to load modules that serve just the content you want served. You can then handle a thousand requests per second...

      So where is the difference to FastCGI? I think you are reinventing the wheel.

    12. Re:You can talk about this all day, but... by bad-badtz-maru · · Score: 1


      He sounds like our IT Director... no input on how anything actually works but always quick to critique the name of a new database field or function, color of a control, etc. Bikeshedding.

    13. Re:You can talk about this all day, but... by tomhudson · · Score: 1

      FastCGI is a server extension - this allows you to avoid using a server like apache, etc.

    14. Re:You can talk about this all day, but... by imroy · · Score: 1

      I wanted to discuss this one... I've heard this particular criticism of PHP many times, although I haven't seen any suggestions about what precisely PHP should do to fix this. (Or what precisely is wrong with having a lot of functions in the "core," a term which is also unclear.)

      What I see as wrong with having lots of built-in functions:

      • It's difficult to remember them. This is compounded by the inconsistent naming, and the inconsistent arguments and return values. It means you have to keep referring to some sort of reference... or just copy-and-paste code from other people like a lot of PHP users appear to do.
      • It reduces the set of names that you can use for your own functions, and increases the chance of an accidental collision.

      The answer is modularisation. Looking at the long list of functions in the PHP manual, I think that all but a few core groups should be handled in modules that are loaded at run-time. That'd clean things up, but would be yet another backwards-incompatible change to the language. Frankly it'd be easier in the long term to switch to a proper language with a good framework e.g Java (Struts), Perl (Catalyst), Python (Django, TurboGears), or Ruby (RoR). Your code will be clearer and easier to maintain because of the MVC separation and you won't have to fuck around with your language changing underneath you (or be stuck with PHP 4 because your $5.95/mo web host doesn't want the hassle of breaking customer's web sites).

    15. Re:You can talk about this all day, but... by Dirtside · · Score: 1

      It's difficult to remember them.

      This, by itself, I don't see as valid -- it's difficult to remember any large list of things, regardless of whether they're all included by default. However:

      This is compounded by the inconsistent naming, and the inconsistent arguments and return values.

      This, I definitely agree with, and it is harder to remember any list of things when they're inconsistently named, so alleviating this would alleviate the first issue. Plus, namespaces would help a great deal.

      It means you have to keep referring to some sort of reference...

      Uh, you'd still need a reference even if PHP only had a couple hundred functions by default. No significant number of people is going to be able to memorize the names and argument/return syntax for 300 functions. Modularization wouldn't help, you'd still need a function reference for each module. Which is, in fact, exactly what PHP has.

      PHP DOES have a problem where there are some functions which do almost exactly the same thing, and they could be combined, but that's a separate issue.

      I think that all but a few core groups should be handled in modules that are loaded at run-time

      Backward-compatibility aside, it'd probably be a perormance issue to be loading those modules every single fork -- the company I work for has 300+ web servers constantly at full load, running dozens of PHP theads per second each. Having to runtime-load all the modules we'd need (a dozen of them at least) on each thread would probably bog things down quite a lot. (Yes, yes, I realize that if performance is an issue, we shouldn't be using PHP, but we're stuck with it short a complete site rewrite which would take ten programmers a year to do -- you got a million bucks lying around to pay for that?)
      --
      "Destroy science and religion. Science would re-emerge exactly the same; but not religion." - Penn Jillette, paraphrased
    16. Re:You can talk about this all day, but... by Anonymous Coward · · Score: 0

      As a "real life" example, my company uses both PHP and Perl. We constantly have script failures due to servers being upgraded/reinstalled and random Perl module X missing, or needing a slew of contradicting dependencies to do a manual (ie: cpan) compile of a module. Often for ridiculously basic functionality.

      We've never once had this problem with PHP.

      I'd much rather have a sensible set of features with a 4mb executable (ZOMG THATS OS MUCH RAM!!!) than have a useless language with tons of self-compiled modules that reimplement the same functionality, make scripts completely non-portable, and basically make my life running development and operations living hell.

      We're in the process of removing all perl from our company. This has more to do with having to pick a single language to avoid duplicated functionality across languages, but PHP was the obvious choice.

      And for the record...I don't at all understand the whining about function naming and return values. I don't care what language you're talking about, I've programmed in all of them, and I *always* use an IDE or good reference (ie: MSDN or php.net) to double-check any functions I don't use regularly enough to have memorized. It takes me far longer to find reference documentation for Perl than PHP, so I don't care how "logical" you think Perl's argument order or function names are (especially with so few functions in the core to begin with), I still don't know them without checking, and PHP.net makes that incredibly easy.

      Anyway, not to sound argumentative towards OP, since we agree - but this has been my company's experience with that argument.

      I also had the pleasure of hearing Rasmus Lerdorf give a keynote at a PHP Conference. He had some great thoughts on how hard it was for him to learn English, but how it's much better to have English make little "logical" sense, than to try to "break" every book, movie, documentation, etc. written in English to "correct" the language. From what I hear Perl went the route of substantially breaking backward compatibility just to rearrange parameters to be more "logical". Way to go...preventing adoption of a new release of the language, creating far more confusion for developers (now there are TWO correct version of the function, depending on the version you're using on a particular project or server), and to what benefit? The language is potentially extremely slightly easier to use? And yet PHP is commonly referred to as far and away the easiest web development language. It sounds to me like the language Nazis are sabotaging Perl to no benefit. Unfortunately language nazis are common among us computer scientists. Rasmus had interesting thoughts on computer scientists' role in development too :)

    17. Re:You can talk about this all day, but... by Anonymous Coward · · Score: 0

      >> quick to critique the name of a new database field or function, color of a control, etc. Bikeshedding.

      Exactly. The people who complain about PHP naming are armchair-analysts who probably use Java or Perl or C full time and have just glanced at PHP on occasion. PHP programmers don't have any problems with the naming - that's what PHP.net is for, much like MSDN for Visual C++. No one can use any full-featured language without good documentation.

      What the armchair-analysts are really saying is "Wahhhh, this function isn't named the same thing it is in Language X". In fact one of the confusions is that there are some PHP functions based on C equalivents, and some that are based on Perl equivalents. As someone who programmer both C and Perl before ever touching PHP, I find it completely intuitive and "obvious". But as a C-only or Perl-only programmer, you're bound to run into a function thats not what you expected. SURPRISE - it's its own language, not a Perl-clone or a C-clone.

  9. use perl; by Anonymous Coward · · Score: 1, Informative

    [troll]Use Perl, mod_perl, profile your applications, and cache, cache, cache.[/troll]

    1. Re:use perl; by eneville · · Score: 1

      [troll]Use Perl, mod_perl, profile your applications, and cache, cache, cache.[/troll] that's actually the best advice in this thread, caching that is. and perl does that well with hash lookups... so you dont need a db... just use bdb for most of the pages and get them from the bdb based on page url. that's much faster than dynamically creating the page and should be less of a resource hog overall.
    2. Re:use perl; by Anonymous Coward · · Score: 0

      Preoptimization sucks. Now if you wish to do anything DB related, you can't do anything too fancy because it's in a bdb. :P. Create the system sanely, then optimize w/ the complex heavy parts optimized.

      Oh wait, I forgot this is php. Let's be clever!

    3. Re:use perl; by QuoteMstr · · Score: 1

      Amen. I think the premature optimization bit is a phase that most good programmers grow out of sooner or later. I've grown tired, though, of having to explain the concept. "No, allocating twelve objects really won't impact performance that much. You're going to be hitting the database with a huge query anyway. The memory allocation won't matter next to that!"

    4. Re:use perl; by eneville · · Score: 1

      Preoptimization sucks. Now if you wish to do anything DB related, you can't do anything too fancy because it's in a bdb. :P. Create the system sanely, then optimize w/ the complex heavy parts optimized.

      Oh wait, I forgot this is php. Let's be clever! it totally depends on the job in hand and how often it is called. a 'system' might rely heavily on pre-optimisation, simply because of the way it's intended to function. a good cache can help tremendously.
  10. Re:But I Can't Pronounce "LLMP"! (n/t) by larry+bagina · · Score: 2, Funny

    try LOL - Linux/OCaml/Lighttpd

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

  11. In the previous article by Anonymous Coward · · Score: 1, Interesting
    In part 1 of this series this was recommended...

    "The first order of business is to ensure that atime logging is disabled on file systems. The atime is the last access time of a file, and each time a file is accessed, the underlying file system must record this timestamp. Because atime is rarely used by systems administrators, disabling it frees up some disk time. This is accomplished by adding the noatime option in the fourth column of /etc/fstab."

    Can someone share their thoughts about this tweak? Is it safe to use from a data integrity perspective?

    1. Re:In the previous article by Anonymous Coward · · Score: 0

      > Can someone share their thoughts about this tweak?
      > Is it safe to use from a data integrity perspective?

      It's perfectly safe and also standard practice.

    2. Re:In the previous article by pooh666 · · Score: 1

      You don't have to access, what you have cached in memory.. If making this change affects performance, then you are hitting the disk too much anyway. The only exception I can think of is where you are server up a massive amount of distinct content, but even then some things get accessed a lot more often and caching can help with those.

    3. Re:In the previous article by Antique+Geekmeister · · Score: 1

      Yes, I find it very hepful. There are only a few things that really care about atime (such as expiring and deleting files based on last access). For web servers, it's a fairly useless tool.

    4. Re:In the previous article by guruevi · · Score: 2, Informative

      Yes, it is safe, it doesn't add or remove anything from a safety perspective. The atime is however useful in case you regularly have to audit your system for financial reasons (SoX) but otherwise not necessary for working. Make a backup of your filesystem and then disable it, no harm will be done.

      --
      Custom electronics and digital signage for your business: www.evcircuits.com
  12. Don't just make it up... by Anonymous Coward · · Score: 0
  13. Apache ain't the fastest... by Anonymous Coward · · Score: 4, Informative

    It's common knowledge that Apache certainly isn't the fastest out there to server web pages. For static pages lighttpd and, heck, even a basic stand-alone Tomcat (yup, a Java server!) can easily serve as many pages as Apache. That was already the case for, say, Java 1.5 / Tomcat 5.5. Now take Java 1.6 and Tomcat 6 (or, better, Resin [not completely free]) and suddenly Apache is looking even more ridiculous.

    For anything SSL related IIS makes fun of Apache.

    For many concurrent sessions there are proof of concept servers written in functional languages (like erlang) that handle an order of magnitude (!) more simultaneous sessions than what Apache does.

    I understand that for many here Apache is all they know and hence regard it as the holy grail but it is far, far, from being that. It is a good overall purpose web server but it is certainly not the fastest.

    In the face of the countless security holes that are all too common in C-written apps I'm now more and more installing pure Java web servers. At first I was using Apache + Tomcat now I'm more and more using Tomcat in standalone mode. Easier configuration, no buffer overflows to patch.

    1. Re:Apache ain't the fastest... by Anonymous Coward · · Score: 0

      or, better, Resin [not completely free]
      I'm not sure it's fair to say that it isn't free. They have a full J2EE server (unlike Tomcat) that is GPL. It's only the distributed sessions and performance tweaks that they charge for. By most accounts (and from what I've seen), Resin GPL has more features and is somewhat faster than Tomcat.

      even a basic stand-alone Tomcat (yup, a Java server!)
      I'm not sure why this should be a surprise. Java will usually kick the snot out of Apache with Perl, Python or PHP. For one, the ability to keep the database connection(s) open rather than establishing a new connection for every dynamic request will make a huge difference. And it's not just database connections, loading all code ahead of time before the request means that servicing the request is much faster. If you can avoid the albatross that is EJB (even the re-invented pseudo-EJB that is 3.0), it takes some determined coding to be slower than Apache + scripting language.

      Unfortunately, all the things that make Java faster also make it suck in a shared context (non-dedicated hosting plans). Hopefully this will change if they can ever finish the Isolates and Resource Consumption JSRs since it should allow the app servers to manage the applications it runs to prevent one application from bringing down all other applications.
    2. Re:Apache ain't the fastest... by DanFluidMind · · Score: 1

      For anything SSL related IIS makes fun of Apache.

      I beg to differ. Just setting up SSL in IIS is a pain with their damn wizard. In apache it's just a couple of openssl commands and a few additional lines added to the config file and you're done. (Aside from the hassle of getting the CA-signed cert itself, which is common among all HTTP servers.)

      But the worst part about SSL on IIS is when you want to have multiple name-based virtual hosts on one IIS installation, all with their own SSL certificates. For some unimaginable reason, the IIS developers put an arbitrary limitation in the GUI admin for IIS that makes it impossible to set multiple sites to listen to port 443. So if you have multiple sites each with a separate SSL cert, you have to go to the command line and run a special VBS script to add them. One guy on a forum even suggested that this was a limitation of SSL itself! Hardly. Apache has no problem with multiple name-based virtual hosts all listening to port 443 and using their own certificates.

    3. Re:Apache ain't the fastest... by Daath · · Score: 1

      You can't do name based virtual hosts using different certs on the same IP/port. It is indeed a limitation of SSL. It is in fact impossible.

      --
      Any technology distinguishable from magic, is insufficiently advanced.
    4. Re:Apache ain't the fastest... by DanFluidMind · · Score: 1

      Sorry about that, I wasn't clear at all about what I had in mind. I was thinking in terms of wildcard SSL certificates: multiple name-based virtual websites for several third-level domains on the same second-level domain (www.example.com, staging.example.com, members.example.com, etc.) all using a wildcard SSL certificate. That setup is easy to handle in Apache, but a pain in IIS. You're right, multiple SSL certificates for different name-based virtual hosts with different second-level domain names is impossible in both Apache and IIS.

  14. Re:But I Can't Pronounce "LLMP"! (n/t) by julesh · · Score: 1

    It could be worse. I don't know if IIS runs under Wine, but if it did that would be LIMP.

  15. Careful with the php accelerators by graveyhead · · Score: 2, Informative

    I routinely experience Apache crashes while using eAccelerator, APC or Zend Optimizer, even with the latest stable PHP. If you use one of these products, be sure to also run some kind of watchdog that will restart httpd if (when) the stack crashes. They're totally worth running in any case. Zend Optimizer speeds up my Drupal installation by a huge amount because of the time saved parsing code.

    You also should of course make sure you've got caching happening at every level of your app. Memcached is a great application level cache. Apache side, make sure you enable and configure the memory cache for static files. (mod_mem_cache) and possibly the file cache (mod_disk_cache). Client side, make sure you're caching static files like images, js, css. Apache's mod_expires gives you good control over this in Apache config.

    Of course, all of this could be just spinning your wheels if you have badly optimized sql queries or bad table design to start with. Set mysql's slow query log threshold very low to catch these issues early.

    --
    std::disclaimer<std::legalese> sig=new std::disclaimer; sig->dump(); delete sig;
    1. Re:Careful with the php accelerators by gazbo · · Score: 1

      I don't think you know what Zend Optimizer is.

    2. Re:Careful with the php accelerators by Billly+Gates · · Score: 1

      You can try running php on Windows with IIS. Its alot more stable on the windows platform and IIS is no longer the POS it used to be. Also you may want to use a real mature language like java or .NET if you need stability and maturity. Php is very mixed.

      Of course I am probably going to be modded down here on slashdot for such a posting.

    3. Re:Careful with the php accelerators by yabos · · Score: 1

      The username Billly Gates certainly doesn't help. :)

  16. How to know? by bigjoeystud · · Score: 1

    Is there an easy way to figure out where my bottlenecks are? We have a LAMP site that used to run fast, but with a new version of CentOS, it now runs real slow and I'm not sure why...

    1. Re:How to know? by QuoteMstr · · Score: 1

      Good question. The first step is to figure out where the slowness is coming from. Is the web server process waiting for database queries? Is the CPU pegged at 100%, or is the server waiting for disk IO?

      I like to use atop to figure these things out. It breaks down system resource use into a couple of distinct categories, like mem, cpu, and swap, and visually indicates which one is the limiting factor at the moment. It'll also tell you which processes are allocating and deallocating memory. It's not particularly user-friendly, but it's a powerful tool.

      Also, if it turns out that a process _is_ using a lot of CPU time, and you can't figure out why, strace and httpd -X (which forces Apache to run with one worker) are your friends.

      Of course, I'd still prefer to have dtrace in the Linux kernel. Maybe someday...

    2. Re:How to know? by Anonymous Coward · · Score: 0

      This will help you a lot: http://pecl.php.net/package/apd/ APD, a profiler for PHP

  17. C code is one answer by Anonymous Coward · · Score: 3, Interesting

    I had a customer (I am a contract programmer, working on a per-project basis) who had an emmense PHP / MySQL application that ran so slowly it was unuseable. We did every simple optimization such as is described in this article, and more. In the end, the issue was clearly that there was simply a lot of PHP code, and a lot of it using PHP's objects, and searches through arrays, and that sort of thing. The biggest performance increases we were getting was when we could push some sort of comparison or logic from PHP into the SQL query.

    What we did was re-write all of the application except the parts that actually printed HTML to the page in C. We made that library into a php extension, which we added to our php installation. The speed ups varied according to the type of code, of course. MySQL queries changed hardly at all. A simple for loop might speed up from 100 to 1000 times, however, and a for loop that involved some sort of object oriented operations -- say, the creatation of a new object with each iteration, in an extreme example -- could be sped up from 10,000 to 100,000 times.

    Now, most code that was sped up 100,000 times, when examined closely, could be sped up in PHP also by writing it smarter. But bad C code still runs faster than good PHP code.

    If your disk drives are slow, or your code is printing a debugging log that has every function entry and exit to a network shared disk, or something like that, don't even think about C, just fix the basic problem first.

    However, in my experience, twiddling the apache configs for "AllowOverride" and stuff like that will never get you as big a speed up as moving PHP code to C.

    Note, that the way we did it, we moved all the core functionality and logic to a C library, but most of the display stuff was left in PHP. This meant that most ongoing development could continue to be done by cheaper, less skilled people who knew only PHP, MySQL, javascript, and CSS.

    1. Re:C code is one answer by pooh666 · · Score: 1

      Funny we did almost the same thing with mod_perl under PHP :)

    2. Re:C code is one answer by Anonymous Coward · · Score: 0

      Agreed. After everything is said and done, sometimes using C is a great choice when building a tight, fast component.

    3. Re:C code is one answer by QuoteMstr · · Score: 1

      What were you doing that took so much CPU time? Shouldn't all the heavy lifting have been done by the database anyway? IMHO, it's pretty bad design to put too much sorting, filtering, etc. logic in the client code anyway, regardless of whether that client code is written in C, PHP or INTERCAL.

      That said, PHP is only a constant factor slower than C. A big constant factor, granted, but not 100,000. It appears that your perform improvement with the C rewrite came from algorithmic improvements, not a simple translation into machine code.

    4. Re:C code is one answer by Anonymous Coward · · Score: 0

      I wrote the C directly from the PHP, literally by changing the ".php" on the filename to ".c", then going through it and removing all dollar signs with a search-and-replace, and then making a second pass to declare all types. Then I would start trying to compile it. No algorithmic improvements were made at that stage because we were afraid of introducing bugs and not being able to figure out what change had caused them.

      The PHP is not always a "constant" factor slower than C. If the code uses objects, it is really slow. The more that PHP has to figure out type stuff, the slower it is. Other operations such as substr() and regular expressions are already C coded modules in PHP, and there isn't much difference. String comparisons seem to be slow also.

      Also, obviously not all applications, even web applications, can simply be written as queries to a database. While it may be a common fault that many coders learn only the simplest use of SQL and then re-write large chunks of the SQl engine in their code, there are obviously whole applications that don't use a database at all.

      If you know both PHP and C, I encourage you to check my observations. First, learn how to install PHP from source on your system -- most of that is figuring out all the options to the big "./configure" statement used to compile it (use the output of phpinfo() from the PHP that came with your system). Then, follow the instructions in Blake Schwindiman's book "Bulding Custom PHP Extensions" and make an example PHP extension.

      Throw some for loops and more complecated code into php and into your extension. You'll see.

    5. Re:C code is one answer by lawpoop · · Score: 1

      What about optimizing the MySQL queries? I've found that lousy PHP programmers are even lousy database designers and query writers. Lousy PHP tends to make up for even lousier DB structure and querying.

      --
      Computers are useless. They can only give you answers.
      -- Pablo Picasso
  18. Its all about how you use Apache by irving · · Score: 2, Interesting

    The reason why Lighty and Litespeed have pulled better numbers than Apache is because they are threaded and use FastCGI, and always get compared to Apache with the prefork MPM using mod_php.

    The latest performance numbers show that Apache 2.2 w/ worker MPM (threaded) + FastCGI can keep pace with Lighty and LiteSpeed. Many of us large site maintainers prefer Apache's feature set.

    I agree that APC rocks, it outpaces Eaccelerator in a big way, and is more stable.

    This article is not worth the read, I could condense it into a 3-fold pamphlet. Performance tuning is an art, this article does it a great bit of injustice.

  19. how abt direcly using Apache Modules.. by Anonymous Coward · · Score: 0

    At my company we have our own C++ modules (no PHP layer) which we use to server our content.. though development takes more time we get solid performance...

    1. Re:how abt direcly using Apache Modules.. by QuoteMstr · · Score: 1

      Fair enough. But why should development with C++ take longer than with PHP, assuming that you're using a decent framework and a solid templating engine with both? Compile time ought to be negligible. You can develop faster with PHP only if you corners and don't adhere to good coding practices.

    2. Re:how abt direcly using Apache Modules.. by TheSunborn · · Score: 1

      But are there any good template systems for C++? I have been looking for one, but newer found anything usefulle. Something like Velocity but for c++ would be perfect.

    3. Re:how abt direcly using Apache Modules.. by Jamie+Lokier · · Score: 1

      I haven't tried it, but KLone looks interesting.

  20. Well We could always by Sammy+Loo · · Score: 1

    just get a bunch of old computers, cluster them, and every time the server load gets larger, add another old computer from the junkyard. Parallel computing at its finest.

  21. Performance tuning and optimization of LAMP by kbahey · · Score: 4, Informative
    This is a set of articles on Drupal performance tuning and optimization for large web sites. Although it says Drupal, much of it applies to the LAMP stack in general.

    It includes:

    • PHP op-code caches / accelerators: Drupal large site case study
    • Benchmarking APC vs. eAccelerator using Drupal
    • Drupal core caching and contributed content caching modules
    • Installing eAccelerator 0.9.5.1 on Ubuntu Feisty 7.04
    • logwatcher: restart Apache after a segmentation fault
    • MySQL InnoDB: performance gains as well as some pitfalls
    • MySQL my.cnf configuration for a large Drupal site
    • Presentation: Performance tuning and optimization of high traffic Drupal sites
    • Tools for Performance Tuning and Optimization
    • Tuning the Apache MaxClients parameter
    • Links and resources on Drupal performance tuning and optimization


    Disclaimer: this is stuff that I have written.
  22. Reverse proxy by Snowhare · · Score: 2, Informative

    And get a reverse proxy (apache2.2).
    I have to second this point. I am in the process of setting up a new site that needs to use a PHP based knowledgebase system. The raw performance numbers of the knowledgebase were absolutely abysmal (6 pages/second). I spent half a day working with the Apache 2.2 reverse proxy and got it up to 350 pages/second.
  23. Re: Stevie B. told me... by MahariBalzitch · · Score: 0, Offtopic

    At a recent Web conference a guy name Steve told me the best web server to use was IIS from some company called Micro something or other. He was grasping his chair very intimidatingly, so I took his word for it. He also managed to talk me into buying a corporate license for some product called Office something or other. He was a great salesman I must say, since I don't even work for a company!

  24. Re:Just listen to this by Anonymous Coward · · Score: 0

    Some of us make a living doing this and the tools we use on the server have one job. That job is to send content to the client as fast as possible. There are numerous tradeoffs in the architecture and configuration of web servers and scripting languages and when you're working with this stuff everyday the sub-optimal becomes irritating.

    If it's all a bit over your head, I suggest you instead participate in discussions at a level you're more comfortable with.

    HTH

  25. Hello mac troll! by Vexorian · · Score: 1

    Could you get more content? This one is pretty outdated, you used to take less time to update...

    --

    Copyright infringement is "piracy" in the same way DRM is "consumer rape"
    1. Re:Hello mac troll! by Anonymous Coward · · Score: 0

      Give him a break, it's hard work to come up with good things to say about the Mac constantly.

  26. Really dump them???? by Nicolay77 · · Score: 1

    Hey, I'm interested ^^

    Besides that white paper do you have more info about it ?

    --
    We are Turing O-Machines. The Oracle is out there.
    1. Re:Really dump them???? by butlerdi · · Score: 1

      There is plenty of info out there both on the HP site and the 1060 site. Google turns up a plethora of info on this stuff as well.

      --
      "If the King's English was good enough for Jesus, it's good enough for me!" -- "Ma" Ferguson, Governor of Texas (circa
  27. Re:But I Can't Pronounce "LLMP"! (n/t) by zitch · · Score: 3, Funny

    Just keep IIS in its native environment and we'll get WIMP... :)

  28. Re:Just listen to this by Qbertino · · Score: 3, Interesting

    Some of us make a living doing this and the tools we use on the server have one job.

    No, really? I do to too actually.

    That job is to send content to the client as fast as possible.

    Wrong. That job is to get the job done, fast, good and cheap, and if that doesn't work (which it never does) it's to evaluate the best tradeoffs without bugging the client to much. And by client I mean the one with the two legs and the checkbook that doesn't give a damn wether you're using Ruby or PHP or Django or Symfony or Zope or Rails or whatnot but wants to see his webapp ASAP.

    There are numerous tradeoffs in the architecture and configuration of web servers and scripting languages and when you're working with this stuff everyday the sub-optimal becomes irritating.

    And you know what the suboptimal and the optimal is? No? Well, then you are aware of more than most posters I sorta quoted above.

    If it's all a bit over your head, I suggest you instead participate in discussions at a level you're more comfortable with.

    WTF? I've been programming since '86 and have been doing webstuff for a living since 2000. I don't see nothing over my head here. Just a tad incoherent for a community made up of what seems like 90% part-time webdevs with each their own favorite toolset. A community of which 80% act as if they where members of the Linux Kernel Team and come across a bit silly at times. Don't get me wrong, there are interesting posts here. But for each of those it looks as if three 'expert' posts sound like what I was moking. And that what I was poking at with the parent post.

    --
    We suffer more in our imagination than in reality. - Seneca
  29. Re:Just listen to this by Anonymous Coward · · Score: 0

    Blah, blah, Ruby, django, ASP, ASAP, blah, blah, programming 86, blah, 90% part time weddevs, blah, blah, YHBT, HAND.

  30. The real way to improve server performance... by dgym · · Score: 5, Funny
    ...is to decrease load on the server. Most of the work can be done on the client anyway, so that is where it belongs.

    Here are a few tips:
    • Databases can get pretty slow with complicated queries, so upload your database to the client when they load the page and then your database queries are distributed.
    • PHP isn't very fast, and neither are Perl or Python, so you don't want to be running them on the server either. Write an interpreter for the language of your choice in Javascript and move your business logic to the client. This will also interface better with the client side database copy.
    • SSL is a performance killer, don't use it. If you need to send something securely just prefix it with a predetermined number of random letters and numbers, no one will think to look beyond them.
    • Writing to databases can be pretty bad too. Try discarding all your changes, your users might not notice the difference, but they will appreciate the performance gain.
    • Even with all the above you might still be getting too many requests. Try designing your site to exploit bugs in the major browsers and reconfigure your users machine to store and load everything itself.
    • Get better hardware.
    • Make your site less interesting, or less reliable. Changing your DNS entry to point to an unrelated site for one week a month can really help reduce load.
    • If you have had success with the other steps then you don't need a dynamic server anymore, code a simple static server in assembly, preferably for the architecture you intend to be running on, and be done with it.

    Best of luck!
    1. Re:The real way to improve server performance... by Anonymous Coward · · Score: 0

      this is the craziest list i've ever came across. i love the tips! but code your own server in assembly? you're nuts! ahaha

  31. Lighttpd can't solve that problem. by Generic+Player · · Score: 1

    Lighttpd (or any of the good event driven webservers, lighttpd is awful) can't solve this problem. If your database is running slow, the requests that "start to queue up" are requests for PHP scripts. Static files will still get served just fine. Lighttpd has to have just as many concurrent PHP processes as apache does worker processes or threads. Either way its the same problem, lots of PHP processes/threads hanging around sucking up lots of RAM.

  32. WordPress and making it run fast by Rudd-O · · Score: 1
    --
    Rudd-O - http://rudd-o.com/
  33. One word by Rudd-O · · Score: 1

    Django.

    --
    Rudd-O - http://rudd-o.com/
  34. Biggest back for the buck... by sufehmi · · Score: 2, Informative

    ...for most many cases, is to setup an edge server / reverse proxy. It will stop the load BEFORE it even reaches lighty / apache / whatever.

    It's very easy to do, take very little time, reliable & proven (which is not always the case with php accelerators), and will easily drop a double-digit server load to a single one.

    It constantly amazes me how people will do the hardest stuff which gave the minimum return first.
    Such is life I guess :-)

    If you want more proof, read this guy's article. He sell a "turbo charged" Wordpress, got digged and overloaded, optimized his website and still overloaded. Finally his server managed to go through it after he implemented squid's reverse proxy.

    In summary - sort out your priorities guys.
    Biggest back for the buck first, and then go down from there.

  35. PHP rocks on AMD64? by ceeam · · Score: 2, Interesting

    BTW - I noticed that PHP5.2.1 on my home machine (Sempron64, Kubuntu AMD64, 2.0Ghz) to be consistently at least 1.5-2 times faster on (micro)benchmarks than the same PHP version "hand-built" with usual optimizations and the same AFAICT ZTS and other settings on Core2 Dual Xeon machine on RHEL4 i386 (1.8GHz). How comes? Is AMD64 ABI really that great for PHP or what? Python's benchmarks, OTOH, generally don't show any improvement between i386 and AMD64.

    1. Re:PHP rocks on AMD64? by Anonymous Coward · · Score: 0

      Are you compiling with Xeon (nacona) in mind? Looks like you're not utalising the 64 bit extensions on your Xeon CPU, how can that possibly be a fair comparison?

      After installing a x86_64 distro, try something along the lines of:

      CFLAGS="-O3 -march=nocona -msse2 -msse3" CXX="gcc" \
      CXXFLAGS="-O3 -march=nocona -msse2 -msse3 -felide-constructors -fno-exceptions -fno-rtti" \
      CXXLDFLAGS="" \ ./configure ...

  36. PHP is still the hottest. by imkow · · Score: 2, Interesting

    The blog site of sina.com(ranked 13 in global traffic by alexa index) is built entirely with PHP. It's the biggest blog site in China, with more 50 million users including thousands of Chinese celebrities. The blog site deeply use ajax techniques and has a video blog built also with PHP. My point is that if PHP can handle an interactive website(AJAX+Video) with more then 50 million users and more than 10 million page hit a day, what else in the 'net' PHP cannot do?

    --
    China, in fact, is very fragile.
  37. Another word. for good. by imkow · · Score: 1

    you don't wanna mess up with millions of (awesome)PHPers, or they gonna eat you alive...

    --
    China, in fact, is very fragile.
  38. actually by weierstrass · · Score: 1

    it's "Claris"

    --
    my password really is 'stinkypants'
    1. Re:actually by Anonymous Coward · · Score: 0

      If you think Clarus is a misspelling of Claris, then you REALLY, REALLY need to GET. THE. FUCK. OUT. RIGHT. NOW.

  39. Re:Just listen to this by Anonymous Coward · · Score: 0

    "WTF? I've been programming since '86 and have been doing webstuff for a living since 2000. I don't see nothing over my head here."

    Kinda young aren't ya sonny.