Re: Reducing load for LAMP app?



Jeremy wrote:
The Natural Philosopher wrote:
Jeremy wrote:
every cycle saved on redundantly compiling PHP code is a cycle that can be used doing useful computation.

Er.. what planet are YOU on?

Unless you are totally CPU bound, most of the time your processor is doing precisely nothing. Thats why its imporatnt to wortk out what teh bottleneck is. Boosting CPU power may have as much effect as fitting a turbocharger to a car that spends all its time in a traffic jam..



NOT running a bytecode cache is pretty pointless. Why not do it?


Because it may make no difference whatsoever. And adds more complexity.

Jeremy


So, you're saying it doesn't make any sense to eliminate the compilation step on every request? That the request will be handled just as fast if many thousands of lines of code must be compiled first?

Whatever planet I'm on, I want to move to yours - because computers there seem to be magical.


Sorry, I agree with Philo here. If the CPU is idle anyway, it's not going to make any difference.

Let's look at some benchmark tests:

http://2bits.com/articles/benchmarking-apc-vs-eaccelerator-using-drupal.html


In this particular case, adding APC resulted in a ~494% increase in performance over PHP alone. Maybe that's a result of Drupal being poorly written - couldn't tell you; I've never used it. But it seems like something that could potentially be pretty helpful, so I suggested he try it. I use it everywhere; it requires no maintenance, it installs in seconds, it has concretely improved the performance of my applications, and my servers have never crashed (with the exception of occasional fan failures) or required restarts. Anecdotally, I would say it's a pretty good thing to consider.

Jeremy


Yes - IN THIS PARTICULAR CASE. That is not always true.

In in this case it would have hurt performance because a major portion of his bottleneck was a shortage of memory. Now you just took more of it.

And BTW - your memcache idea would have taken even more of what he was short of.

You're suggesting he steal bread from a starving man...

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================

.



Relevant Pages

  • Re: Concurrent server design issues.
    ... the connection, processing the request, sending the reply, and closing ... If the scheduler feels that a particular ... request on each CPU in the machine, ... some of the stages of request processing are not CPU bound, ...
    (comp.programming.threads)
  • [PATCH 16/22] trivial: fix typo "that that" in multiple files
    ... block, switch to user-mode execution, or enter the idle loop. ... as soon as a CPU is seen passing through any of these ... that submitted the just completed request are examined. ...
    (Linux-Kernel)
  • Re: Concurrent server design issues.
    ... the connection, processing the request, sending the reply, and closing ... request on each CPU in the machine, ... some of the stages of request processing are not CPU bound, ... thread during the CPU bound stages of request processing. ...
    (comp.programming.threads)
  • Re: Peformance on sun4u Netra(tm) cp2300
    ... I can accept your opinion. ... I still can't get picture how one request takes 100% cpu usage. ... >> resources one by one. ...
    (comp.unix.solaris)
  • Re: Peformance on sun4u Netra(tm) cp2300
    ... So I better to study more how the cpu works. ... CPU executing a list of instructions to do the request. ... and run another task, in a "fair manner". ...
    (comp.unix.solaris)