locked
Am I misunderstanding caching? RRS feed

  • Question

  • User-419366161 posted

    Setup is IIS6 / PHP5.3.2 NTS / Wincache 1.1.0630.0 / FCGI 1.5 RTW

    In php.ini I've set wincache.ttlmax=0 which I assumed would stop cached files being purged.

    After browsing a cached site, wincache.php shows files being cached (in the Opcode cache overview), however, after a minute or two these files disappear from the cache.

     What's wrong (if anything?)

    Saturday, July 10, 2010 10:04 AM

All replies

  • User-1405480850 posted

    Hi,

    Yes, setting wincache.ttlmax=0 means the scavanger will not run at all. But you need to understand that wincache cache is available only till the time php-cgi.exe is running. It might be happening that php-cgi.exe process is being killed by FastCGI because of inactivity and since php-cgi.exe got killed, the cache also got deleted. So keep sending request to the page and cache will be alive.

    BTW, if you are doing all this to get more performance, you won't get any. Scavanger runs in slices and takes a very little time while the request is being processed.

    Hope this explains. let me know if you want to know more.

    Thanks,

    Don.

    Saturday, July 10, 2010 2:32 PM
  • User-419366161 posted

    Ah, thanks for clearing that up, understand now it's linked to the php-cgi processes.

    My main reason for looking at this was to get more performance out of IIS (it's on a fairly low-spec VPS) so if you have any tips on where else I should look it would be very much appreciated

    Saturday, July 10, 2010 3:01 PM
  • User-1405480850 posted

    So far as WINCACHE is concerned just enabling it is sufficient. Tweaking any of it's setting is not going to boost up performance in a noticeable and significant way. BTW, which PHP application you are hosting. If you application supports user cache, you may be able to take advanatage of WINCACHE user/object cache.

    Thanks,

    Don.

    Sunday, July 11, 2010 12:25 PM
  • User-2048372337 posted

    Hate to hijack a thread, but Don, what is the user/object cache? I'm unfamilar with that aspect of wincache.

    Monday, July 12, 2010 8:22 AM
  • User-419366161 posted

     Not a PHP 'application' as such, just a PHP based website

    Monday, July 12, 2010 10:58 AM
  • User-1405480850 posted

    Hi,

    WINCACHE stores the op-codes/files etc. in shared memory. This shared memory is shared across different PHP processes (running under same application pool). Think about user/object cache as a space provided to you in this shared memory where you (meaning your application) can store it's own data. Example, let's see you have made a database query (which is expensive), you can store the value in the user cache. This means next time you do not need to query the database. You can just retrieve the value from the cache. User cache also has API to update the value/delete the value in the cache. So this makes it pretty powerful.

    Hope this explains. There are many PHP applications like Drupal, SugarCRM, Joomla, Wordpress which uses a PHP accelerator (xCache/eAccelerator/APC) user cache to store intermittent data. We have worked with them and now most of them support WINCACHE too.

    Hope this explains. Let me know in case you need more information.

    Thanks,

    Don.

    Monday, July 12, 2010 1:28 PM
  • User-1405480850 posted

     Not a PHP 'application' as such, just a PHP based website

    If your code uses PHP session you can set the handler to wincache.Details at http://us3.php.net/manual/en/wincache.sessionhandler.php. You can also see if you can leverage WINCACHE User cache by writing some custom code yourself.

    Thanks,

    Don.

    Monday, July 12, 2010 3:15 PM
  • User-2048372337 posted

    Already starting to write code for the user cache functions. Nice.

    Monday, July 12, 2010 3:31 PM
  • User-419366161 posted

    If your code uses PHP session you can set the handler to wincache.Details at http://us3.php.net/manual/en/wincache.sessionhandler.php. You can also see if you can leverage WINCACHE User cache by writing some custom code yourself.

    Thanks,

    Don.

     

    Thanks for your answer, PHP handler is already set to Wincache & not being a coder myself I've sent one of your previous answers to our webmaster to see if he'll do anything in that area.

    Monday, July 12, 2010 3:41 PM