Function reroute not working RRS feed

  • Question

  • User-1165521811 posted


    I just installed WinCache to improve performance in combination with Symfony2 on Windows 8.1. But the main feature to improve performance (The file function rerouting) is not working :(.

    My php.ini looks like this:


    And my reroute.ini (in the same directory) looks like this:


    There seems to be no entry at all either for the rerouting in my phpinfo().

    This is what it says about wincache (sorry for the lousy formatting):

    Opcode cache 	disabled
    File cache 	enabled
    Owner 	iisphp@microsoft.com
    Build Date 	Jul 30 2013 09:33:20
    Directive	Local Value	Master Value
    wincache.apppoolid	no value	no value
    wincache.chkinterval	30	30
    wincache.debuglevel	0	0
    wincache.enablecli	Off	Off
    wincache.fcachesize	64	64
    wincache.fcenabled	On	On
    wincache.fcenabledfilter	no value	no value
    wincache.fcndetect	On	On
    wincache.filecount	4096	4096
    wincache.ignorelist	no value	no value
    wincache.internedsize	4	4
    wincache.localheap	0	0
    wincache.maxfilesize	256	256
    wincache.namesalt	no value	no value
    wincache.ocachesize	96	96
    wincache.ocenabled	Off	Off
    wincache.ocenabledfilter	no value	no value
    wincache.scachesize	8	8
    wincache.ttlmax	1200	1200
    wincache.ucachesize	8	8
    wincache.ucenabled	Off	Off

    Does anyone know how to make it work?


    Tuesday, June 3, 2014 9:25 AM

All replies

  • User409000176 posted

    I just looked at the source code, and apparently the rerouting stuff is only enabled when #ifdef WINCACHE_TEST, so it isn't enabled on the bits that are available from SourceForge.  You'd have to pull down the source and build it for yourself if you wanted this enabled.

    I'm investigating if this was always the case, or if I broke this during the massive PHP 5.4 "interned strings" push.  I've tried just moving the rerout.ini setting out of #ifdef WINCACHE_TEST, and I can say the functionality is *clearly* broken on PHP 5.5.  When trying to fixup the opcode, wincache AVs becase the zend_op doesn't use op2 for ZEND_DO_FCALL on PHP 5.5.  So, this may have been broken for a while...

    If I can get this working and moderately tested, I'll ask you to pick up a private and verify it works in your environment.

    I'm assuming you're on PHP 5.5.x, is this correct?


    Tuesday, June 3, 2014 4:38 PM
  • User409000176 posted

    After some research with the code change list, it appears the rerouteini was moved to #ifdef WINCACHE_TEST in 1.1.630.0, back in June of 2010, and hasn't been tested or fixed since PHP 5.2.

    It looks like the opcode definition has changed since PHP 5.2, and the way that WinCache is implementing the function hook stuff seems rather sketchy. 

    If I might ask, how were you intending to use wincache rerouting?  I'm curious to see if there's a business case for keeping (and investing in) the rerouting feature.



    Tuesday, June 3, 2014 5:08 PM
  • User409000176 posted

    I checked with the original dev: Turns out the reroute feature had some app compat problems, and was disabled (but the documentation was never removed).  I'll figure out how to remove the documentation so folks won't get confused by this feature.



    Tuesday, June 3, 2014 7:08 PM
  • User-1165521811 posted

    Yes, Im on the very latest version of PHP, 5.5.13.
    My use case is the Symfony2 development environment, which is quite slow (over 1 second for each request) because it does loads of file checking (to see if files have been changed) each request. I got the WinCache solution from StackOverflow. Id say there is a use for it if theres still a 5x speedup to be gained from the function reroute :). Too bad it doesnt work any longer. Thanks for looking into it anyway!

    Wednesday, June 4, 2014 3:29 AM
  • User409000176 posted

    Very interesting!  Thank you for the info.  I'll look into it, but I'm guessing from the hassles the previous devs had with app compat, I'm sure this is probably not the best option for you.

    Where did you get the 5x speedup number?  In speaking with the previous Wincache devs, they never mentioned that part of it...



    Wednesday, June 4, 2014 1:37 PM
  • User409000176 posted

    Ah, now that I read the StackOverflow article you mentioned, I see where the 5x comes from.  If use Symfony + (Wincache for Opcode + User + Session + Filecache), you'll get a 5x speedup.  You don't requre the reroutes to get the 5x.



    Wednesday, June 4, 2014 1:42 PM
  • User-1165521811 posted

    The 5x speedup is because apparently PHP's file functions on windows are very slow compared to on *nix. One post above the one I linked to on stackoverflow someone descibes these differences. Because the Symfony2 dev environment makes extensive use of those, the performance difference is huge. But if the compatibility is difficult and the functions don't work any longer it is indeed not a very good option.

    Thursday, June 5, 2014 3:23 AM