Skip to main content

Why all my files are not cached with apc op code?


I'm using APC (3.1.9) and Zend Framework, however, only a bunch of file are being cached (something like 10 / 400).



Do you have any ideas? I'm using the factory options on a debian installation.



EDIT: It looks like the only file which are opcached are the one I manually call with require ''; however the ones which are loaded by my autoloader are not. Any ideas?





Runtime Settings




apc.cache_by_default 1
apc.canonicalize 1
apc.coredump_unmap 0
apc.enable_cli 0
apc.enabled 1
apc.file_md5 0
apc.file_update_protection 2
apc.filters
apc.gc_ttl 3600
apc.include_once_override 0
apc.lazy_classes 0
apc.lazy_functions 0
apc.max_file_size 1M
apc.mmap_file_mask
apc.num_files_hint 1000
apc.preload_path
apc.report_autofilter 1
apc.rfc1867 0
apc.rfc1867_freq 0
apc.rfc1867_name APC_UPLOAD_PROGRESS
apc.rfc1867_prefix upload_
apc.rfc1867_ttl 3600
apc.serializer default
apc.shm_segments 1
apc.shm_size 32M
apc.slam_defense 1
apc.stat 1
apc.stat_ctime 0
apc.ttl 0
apc.use_request_time 1
apc.user_entries_hint 4096
apc.user_ttl 0
apc.write_lock 1





here is apc.php screenshots apc.php



The files that are getting opcached php code



And the index.php (ZF) where I require files and register autoloader within Zend_Loader_Autoloader.



opcached files


Source: Tips4allCCNA FINAL EXAM

Comments

  1. For some reasons apc.cache_by_default was set to OFF, an my files were not getting cached correctly, which is logical given this config, however, I still don't understand why those I manually required was actually cached.

    ReplyDelete
  2. Probably one of the biggest downside to autoloading is that op cache doesn't cache autoloaded files as one would hope (something about autoload being runtime vs. include/require being compile time. Or not. I dont claim to understand it.). Read more here.

    While I never tried, I wonder if manually adding your autoloaded file to the cache by calling apc_compile_file() in the autoloader would, effectively, solve this issue?

    ReplyDelete

Post a Comment

Popular posts from this blog

Why is this Javascript much *slower* than its jQuery equivalent?

I have a HTML list of about 500 items and a "filter" box above it. I started by using jQuery to filter the list when I typed a letter (timing code added later): $('#filter').keyup( function() { var jqStart = (new Date).getTime(); var search = $(this).val().toLowerCase(); var $list = $('ul.ablist > li'); $list.each( function() { if ( $(this).text().toLowerCase().indexOf(search) === -1 ) $(this).hide(); else $(this).show(); } ); console.log('Time: ' + ((new Date).getTime() - jqStart)); } ); However, there was a couple of seconds delay after typing each letter (particularly the first letter). So I thought it may be slightly quicker if I used plain Javascript (I read recently that jQuery's each function is particularly slow). Here's my JS equivalent: document.getElementById('filter').addEventListener( 'keyup', function () { var jsStart = (new Date).getTime()...

Is it possible to have IF statement in an Echo statement in PHP

Thanks in advance. I did look at the other questions/answers that were similar and didn't find exactly what I was looking for. I'm trying to do this, am I on the right path? echo " <div id='tabs-".$match."'> <textarea id='".$match."' name='".$match."'>". if ($COLUMN_NAME === $match) { echo $FIELD_WITH_COLUMN_NAME; } else { } ."</textarea> <script type='text/javascript'> CKEDITOR.replace( '".$match."' ); </script> </div>"; I am getting the following error message in the browser: Parse error: syntax error, unexpected T_IF Please let me know if this is the right way to go about nesting an IF statement inside an echo. Thank you.