1

I am running PHP Version 5.3.5 and developing a website in Codeigniter 2.1.3 I am working now to improve website performance, and I found caching can be used like APC or memcached or Zend OpCache.

In codeigniter I used $this->output->cache(43829); for caching.

Output of actions got cached, and It returns same output on every request. But I have dynamic pages so this caching will not work. I am looking around how APC can be used for ope-code caching and used to enhance web site performance.

Is APC stores opecode in cache that cane be used by zend engine for execution execution, without regenerating opecode on each request?

Attached is my PHP APC configuration enter image description here

2 Answers 2

1

PHP 5.3 is nearly 2 years past end of life, and APC is not available for current PHP versions. PHP 5.5+ comes with Zend Opcache, which has equivalent functionality. Instead of trying to get your site to work with old technologies, simply upgrading your server to a current (and secure) version of PHP would give you this performance boost without you having to do anything else.

Sign up to request clarification or add additional context in comments.

4 Comments

Zend opcode cache is not equivalent. The Opcode caching is similar, but (at least the last time I checked) it cannot be used to store arbitrary values. It is unlikely it will implement such data caching until such time as garbage collection and memory compaction are provided (which seem rather silly).
Sure, but the OP specifically mentioned opcode caching in his question. For data caching there are plenty of options (including APCu).
I can not upgrade php version. because of some dependencies. Is APC caches output of execution or opcode before execution?
@PraveenD: that's not a good enough reason. You are making the problem worse by continuing to develop against 5.3
0

Output of actions got cached, and It returns same output on every request

While its faster than regenerating the page, its still far from optimal. Better to use a caching reverse proxy in such a case.

I am looking around how APC can be used for op[e]-code caching

Your question implies that you think you are not already using op-code caching. I suggest your first port of call is to see if it is already enabled. You can see this from the output of phpinfo() or check function_exists('apc_sma_info');

APC is unlikely to be provisioned for future versions of PHP. ZOP+ is the opcode cache which is currently bundled with PHP 5.4+. It will work with 5.3, but requires some effort. Tim is correct in saying the 5.3 is past its sell-by-date and should be upgraded.

Note that ZOP+ also includes an optimizer (and, rather alarmingly, it seems to have a significant impact on the performance of many frameworks). The performance of ZOP+ is more dependent on sizing the cache than in APC - but even with APC, sizing the cache wrongly will not give good results.

1 Comment

Added PHP -APc configuration detail. APC is enabled. Is my configuration ok?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.