467,915 Members | 1,274 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,915 developers. It's quick & easy.

Script acceleration with ZEND/Truck MMCache

I have PHP script running complex query and then calculating data for
different conditions from received result set. Actually, it's doing the same
as if I would make several queries with different conditions on same data in
DB.

Calculating data in PHP instead of running several queries (each query has
joins on several tables with several hundreds of thousands of records)
shortened page generation time, but it's still not fast enough :-(

Now, I'm wondering if using some PHP accelerator/optimizer like Zend
Optimizer or Truck MM Cache would help me increase PHP script calculation
performance and shorten page generation time? As far as I could see, main
purpose of these accelerators is to decrease server load while high number
of users is requesting more or less simple content and in my case I have low
number of users requesting very demanding content.

Thx for any advice.

Munja


Jul 16 '05 #1
  • viewed: 2850
Share:
4 Replies
Actually, no. Those do opcode caching, which is basically the part where
the Zend Engine reads the php file and transform it into
machine-readable code. Those accelerators will not speed up your queries
at all. If you want to speed up queries, you might want to upgrade to
MySQL4 to benefit from the query caching.

Munja wrote:
I have PHP script running complex query and then calculating data for
different conditions from received result set. Actually, it's doing the same
as if I would make several queries with different conditions on same data in
DB.

Calculating data in PHP instead of running several queries (each query has
joins on several tables with several hundreds of thousands of records)
shortened page generation time, but it's still not fast enough :-(

Now, I'm wondering if using some PHP accelerator/optimizer like Zend
Optimizer or Truck MM Cache would help me increase PHP script calculation
performance and shorten page generation time? As far as I could see, main
purpose of these accelerators is to decrease server load while high number
of users is requesting more or less simple content and in my case I have low
number of users requesting very demanding content.

Thx for any advice.

Munja


Jul 16 '05 #2
Munja:
I have PHP script running complex query and then calculating data for
different conditions from received result set. Actually, it's doing the
same as if I would make several queries with different conditions on same
data in DB.

Calculating data in PHP instead of running several queries (each query has
joins on several tables with several hundreds of thousands of records)
shortened page generation time, but it's still not fast enough :-(

Now, I'm wondering if using some PHP accelerator/optimizer like Zend
Optimizer or Truck MM Cache would help me increase PHP script calculation
performance and shorten page generation time? As far as I could see, main
purpose of these accelerators is to decrease server load while high number
of users is requesting more or less simple content and in my case I have
low number of users requesting very demanding content.


The first thing you should do is profile your code and find out where the
bottleneck is. Based on that you can try to optimize the script, or maybe
even rewrite critical parts of it in C.
Jul 16 '05 #3
"André Næss" <an*********************@ifi.uio.no> wrote in message
news:bf*********@maud.ifi.uio.no...
Munja:
I have PHP script running complex query and then calculating data for
different conditions from received result set. Actually, it's doing the
same as if I would make several queries with different conditions on same data in DB.

Calculating data in PHP instead of running several queries (each query has joins on several tables with several hundreds of thousands of records)
shortened page generation time, but it's still not fast enough :-(

Now, I'm wondering if using some PHP accelerator/optimizer like Zend
Optimizer or Truck MM Cache would help me increase PHP script calculation performance and shorten page generation time? As far as I could see, main purpose of these accelerators is to decrease server load while high number of users is requesting more or less simple content and in my case I have
low number of users requesting very demanding content.


The first thing you should do is profile your code and find out where the
bottleneck is. Based on that you can try to optimize the script, or maybe
even rewrite critical parts of it in C.


I supose this is where I can maybe make some improvement. Do you know if
there is some PHP performance mesuring tool on the market (something
simillar to Borland Optimizeit for Java)?
Also, how complicated is to make parts of scripts in C? Does it requiere
dramatical Apache/PHP reconfiguration or it can be solved on more or less
simple INCLUDE and CALL from PHP ?
Jul 16 '05 #4
Munja:
The first thing you should do is profile your code and find out where the
bottleneck is. Based on that you can try to optimize the script, or maybe
even rewrite critical parts of it in C.
I supose this is where I can maybe make some improvement. Do you know if
there is some PHP performance mesuring tool on the market (something
simillar to Borland Optimizeit for Java)?


There was a thread here very recently about that, but I didn't read it...
Try searching google groups for "php profiler/profiling". It's really
unfortunate that PHP doesn't come with a profiler :/
Also, how complicated is to make parts of scripts in C? Does it requiere
dramatical Apache/PHP reconfiguration or it can be solved on more or less
simple INCLUDE and CALL from PHP ?


If you can isolate the bottleneck and turn it into a function written in C
it shouldn't be too hard. That way you could keep the rest of the script as
it is. I guess you should start here: http://www.php.net/manual/en/zend.php

A search also turned up this: http://www.devnewz.com/2002/0909.html

And I'm sure there are plenty more resources out there.

André Næss
Jul 16 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Antoine Bajolet | last post: by
24 posts views Thread by Yang Li Ke | last post: by
1 post views Thread by Alex | last post: by
1 post views Thread by siliconmike | last post: by
1 post views Thread by Ju Hui | last post: by
1 post views Thread by Dan | last post: by
2 posts views Thread by Andy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.