xcache doesn't speed up my php application

93 Views Asked by At

I have a php application which provides restful service,I want to speed it by xcache,but the situation is not as imagined.

My php application bases on yii 1.1,and the function I test does heavy db query and calculation.The elapsed time if not use xcache is 600ms(300ms db query) and things are on the whole the same if use xcache.

I can see xcache is really working by accessing xcache admin page.

Xcache can save time by avoiding creating reduplicated opcode,theoretically it can speed my application,but it doesn't here,so can someone explain?

4

There are 4 best solutions below

1
Nick On BEST ANSWER

I think the reason is that compilation time only the small part of the whole.I'll test it and put the result here later.

0
James Kirkby On

You should try enable opcache in php ini that is now bundled in as part of php core. a better alternative would be to try and optermise the heavy query

0
Shira On

Profile your application. You can't expect a significant speedup if the bottleneck is IO or some poorly optimized DB queries.

0
Matt Cavanagh On

Opcache is now the standard, and it's highly recommended to use it.

It's also seemless, you don't need to do a thing (other than installing it) as Opcache manages all the setting and getting of Op Code caches for you transparently.

Alternatively, you could attempt to diagnose your query by looking at database indexes, using EXPLAIN (if you're using MySQL) and caching the results.