We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

Function reroute not workingRSS

7 replies

Last post Jun 05, 2014 03:23 AM by vansante

  • Function reroute not working

    Jun 03, 2014 09:25 AM|vansante|LINK

    Hello,

    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:

    [wincache]
    wincache.fcenabled=1
    wincache.fcachesize=64
    wincache.ocenabled=0
    wincache.ucenabled=0
    wincache.rerouteini="reroute.ini"
    

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

    [FunctionRerouteList]
    file_exists=wincache_file_exists
    file_get_contents:2=wincache_file_get_contents
    filesize=wincache_filesize
    readfile:2=wincache_readfile
    is_readable=wincache_is_readable
    is_writable=wincache_is_writable
    is_writeable=wincache_is_writable
    is_file=wincache_is_file
    is_dir=wincache_is_dir
    realpath=wincache_realpath

    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):

    wincache
    Opcode cache 	disabled
    File cache 	enabled
    Version 	1.3.5.0
    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?

    Thanks!

  • DropPhone DropPhone

    360 Posts

    Microsoft

    Moderator

    Re: Function reroute not working

    Jun 03, 2014 04:38 PM|DropPhone|LINK

    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?

        --E.

  • DropPhone DropPhone

    360 Posts

    Microsoft

    Moderator

    Re: Function reroute not working

    Jun 03, 2014 05:08 PM|DropPhone|LINK

    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.

    Thx!

        --E. 

  • DropPhone DropPhone

    360 Posts

    Microsoft

    Moderator

    Re: Function reroute not working

    Jun 03, 2014 07:08 PM|DropPhone|LINK

    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.

    Thx!

        --E.

  • Re: Function reroute not working

    Jun 04, 2014 03:29 AM|vansante|LINK

    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!

  • DropPhone DropPhone

    360 Posts

    Microsoft

    Moderator

    Re: Function reroute not working

    Jun 04, 2014 01:37 PM|DropPhone|LINK

    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...

    Thx!

        --E.

  • DropPhone DropPhone

    360 Posts

    Microsoft

    Moderator

    Re: Function reroute not working

    Jun 04, 2014 01:42 PM|DropPhone|LINK

    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.

    Thx!

        --E.

  • Re: Function reroute not working

    Jun 05, 2014 03:23 AM|vansante|LINK

    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.