Installing and upgrading help

OPcache and WinCache working together, or can only one or the other be used at once

 
Picture of Paul L
OPcache and WinCache working together, or can only one or the other be used at once
 

Currently using OPcache on Windows 2008\IIS server Moodle 3.1, looking to upgrade moodle to 3.3 and read documentation recommending WinCache be enabled for better moodle performance. php.net seems to suggest both be enabled as well.

Can I use OPcache and WinCache together for any benefit?

I thought using OPcache made WinCache redundant but now it looks like WincCache offers some additional benefits? Is there any downside to having both enabled?


---

currently php 5.6 but also looking to upgrade to 7.1 soon

 
Average of ratings: -
Wellingtonia Tree
Re: OPcache and WinCache working together, or can only one or the other be used at once
 

Hi

did you get anywhere with this?

I was just looking at the same thing and wondering do I put both on or will that just make the two of them fight with each other?

Regards

Heather

 
Average of ratings: -
Picture of Usman Asar
Re: OPcache and WinCache working together, or can only one or the other be used at once
Particularly helpful Moodlers

Heather/Paul, 

Both have different uses, where OpCache speeds up page loads and reduces memory required as it keeps static content in it's cache, WinCache shines when server gets under load (database fetches), both work together absolutely fine in fact they compliment each other, OpCache use to come as a part of winCache module until PHP 5.4 I believe, later when OpCache become part of PHP extensions they are installed separately. 

Only downside is the plug-in available on Moodle is old (https://moodle.org/plugins/pluginversions.php?plugin=cachestore_wincache), and doesnt work with latest versions of Moodle (confirmed working until Moodle 3.0 (may work for higher versions as well), but hadn't worked with Moodle 3.4 and above. 

 
Average of ratings: Useful (2)
Wellingtonia Tree
Re: OPcache and WinCache working together, or can only one or the other be used at once
 

Thank you.

As I'm on php7.2 and Moodle 3.5 having looked at your mentioned plugin I've abandoned that. I've gone for a manual install and now have both opcache and wincache on my site.

Opcache did come as part of the 7.2 install, but is not enabled by default.

I only got opcache to work yesterday but I can say that now that I have enabled opcache and wincache it does seem to be picking up speed on the log in or maybe that is optimism, but it certainly hasn't made it worse.

Heather

 
Average of ratings: -
Picture of Usman Asar
Re: OPcache and WinCache working together, or can only one or the other be used at once
Particularly helpful Moodlers
Heather, I am not very sure of WinCache working on its own, as i remember that plug-in I mentioned above is installed in Moodle, and then WinCache is setup using Moodle cache configuration, for moodle to make use of WinCache, though it can be installed on server, but will it work like the way it should, I am not sure (havent tested on latest versions of moodle).


enabling OpCache does drastically improves page load times and reduces memory required to load the page, I have done extensive testing of both OpCache and WinCache (enabling both together, and enabling them separately), the immediate effect on performance of moodle page loads can be instantly seen by OpCache (you can test yourself by turning on performance and see for page load times and memory required), winCache however wont make you feel that something has improved, but like I mentioned WinCache shines when server is under load, the developers of WinCache had released versions for PHP 7+ means it does work for them to release latest verions, but again, if it works on moodle without using that cache plug-in or not, I am not sure. 


you can visit following pages to see how WinCache is setup in moodle.

https://sunithamk.wordpress.com/2015/11/12/enable-wincache-with-moodle-web-app/

and

https://ttcshelbyville.wordpress.com/2013/11/10/speeding-up-moodle-lms-on-windows-iis-7-5/

 
Average of ratings: Useful (2)
Wellingtonia Tree
Re: OPcache and WinCache working together, or can only one or the other be used at once
 

Hi

thank you.

I didn't think it was doing particularly well.

I've looked at the plugin and it is for an older version of php and an older version of Moodle.

I tried putting it in the cache folder to install it and all that did was break Moodle.

I need to find some other way of configuring it into Moodle.

Thank you

Heather

 
Average of ratings: -
Picture of Paul L
Re: OPcache and WinCache working together, or can only one or the other be used at once
 

Just read the following from php.net, suggests using both php opcache and wincache


http://php.net/manual/en/install.windows.recommended.php

'Recommended that you use WinCache if using IIS, especially if in a shared web hosting environment or using networked file storage (NAS). All PHP Applications automatically benefit from WinCache's file cache feature. File system operations are cached in memory. WinCache also can cache user objects in memory and share them between php.exe or php-cgi.exe processes (share objects between requests). Many major web applications have a plugin or extension or configuration option to make use of the WinCache user object cache.'


Seems to suggest IIS would automatically benefit to some degree by enabling both opcache and wincache in php, are you suggesting without the moodle wincache plugin IIS and moodle cannot benefit, or just to a lesser extent (no 'user object cache', but 'file system operations' benefit)?


 
Average of ratings: -
Picture of Paul L
Re: OPcache and WinCache working together, or can only one or the other be used at once
 

Thanks for all the great info on wincache.

Since we are on moodle 3.3 and the caching plugin doesnt appear to be supported beyond v3.0 I wasnt planning on pursuing this.

I am looking into other caching options though. Just reviewed Redis for sessions but it appears that is not fully supported on windows although developers have made some workarounds, Windows not getting a lot of love these days ! Any recommendations for a moderately busy (400 simultaneously logged in) Windows environment?

 
Average of ratings: -
Picture of Usman Asar
Re: OPcache and WinCache working together, or can only one or the other be used at once
Particularly helpful Moodlers

Paul, just OpCache would work fine on its own as it's recommended  by moodle developers as well, rest depends on your own server configuration, if you have SSD drives then raw PHP 7 would even suffice. if you have combination of drives (mechanical and SSD), then prefer keeping temp files directory on SSD drives. 

 
Average of ratings: Useful (2)
Picture of Paul L
Re: OPcache and WinCache working together, or can only one or the other be used at once
 

thanks I will continue looking into SSD, my initial requests were met with a luke warm response, seemed to be cost prohibitive at the time.

 
Average of ratings: -
Picture of Paul L
Re: OPcache and WinCache working together, or can only one or the other be used at once
 

Revisiting the SSD as we are going to build a new server shortly.

If a combination of hdd and ssd presents itself I was trying to figure out how to use a smaller SSD drive for temp files as you suggested above.

Would the following 3 config.php values be updated to the new SSD drive location to implement SSD for caching temp (and cache?) files or does your solution involve the creation of cache store in MUC (ie create File Cache for Application mode and map definitions to the new store...havent used MUC before, still intimidated!))?

//$CFG->tempdir = '/var/www/moodle/temp';    
//$CFG->cachedir = '/var/www/moodle/cache';  
//$CFG->localcachedir = '/var/local/cache';   

There's a 'cache' folder in the application and data files directory of moodle, Im not sure which is being referenced in the config values above?

 
Average of ratings: -
Picture of AL Rachels
Re: OPcache and WinCache working together, or can only one or the other be used at once
Core developersParticularly helpful MoodlersPlugin developersTesters

Hi Paul,

As part of your SSD decision making process, let me suggest you go to Site administration > Development > Debugging, place a checkmark in the box for Performance info, then click Save changes. Visit various pages in your Moodle site and look at the page footer each time. You will start to see what parts of Moodle get hammered the most when going to each page, which might help you decide what will receive the most benefit from being on a an SSD.

Back when I made the switch, I realized that with my small Moodle site, it was possible to move everything on my server to SSD.

NOTE: Everyone will see the performance info in the footer, until you turn it back off, so you might want to give them a warning.

 
Average of ratings: Useful (1)
Picture of Visvanath Ratnaweera
Re: OPcache and WinCache working together, or can only one or the other be used at once
Particularly helpful Moodlers
Hi

> //$CFG->tempdir = '/var/www/moodle/temp';
> //$CFG->cachedir = '/var/www/moodle/cache';
>
> There's a 'cache' folder in the application and data files directory of moodle

You saw the problem. These paths are not /path/to/moodle/something rather /path/to/moodledata/something.

Don't touch /path/to/moodle/cache!

Edit: I saw that your OS is Windows. I was talking of Linux, so my comment may not apply.
 
Average of ratings: Useful (1)