We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36440
    • 87 Posts
    Like the title asks...what are optimal caching settings? Especially those where there are expiration times? Is 0 ideal? What are best practices?

    I ask because of the following:

    Out Of Memory Exceptions

    Most of the time when an Out Of Memory exception occurrs it is caused by a design problem, where either too much memory is stored in cache or session scope. Caching can be great for increasing performance if used in the right way, i.e. you cache the data that will be accessed the most and you don't cache it for longer than you need.
    http://blogs.msdn.com/b/tess/archive/2005/11/28/what-on-earth-caused-my-process-to-crash.aspx


    Im obviously actually grasping at straws here. This revo site constantly gets PHP Access Violation error and nothing is indicating what the heck is causing it. I do have to recycle application pool each time (Windows Server 2003, IIS6) and the only info I get is that the App Pool was recycled because Worker process reached its allowed processing time. The question then is why did it reach this limit?

    http://stackoverflow.com/questions/821911/worker-process-reached-its-allowed-processing-time
    • Unless you are able to capture information about what request is causing it to crash, it's going to be difficult to determine what is going on. Forget caching and optimization for a moment, and let's get past the errors which are crashing your web server. Do you have access to error logs for the IIS instance? Is PHP logging errors to another location?
        • 36440
        • 87 Posts
        Thanks for the speedy reply opengeek.

        There's nothing at all about the error in the IIS logs.

        PHP has never written anything to the system log, so I'm assuming that's a bug. We've made some changes accordingly but likely have to restart IIS. So no info to provide you at the moment. When the error happens again, hopefully we have something to go on, which I'll provide with the hopes you can help with this bugger

        To be accurate the web server is not crashing. PHP just goes tits up until the application pool is recycled, but the server itself is fine and non-php pages are not affected.
          • 36440
          • 87 Posts
          We got PHP logging errors. Many many many instances of the following:

          [30-Nov-2011 12:26:38] PHP Warning: Call-time pass-by-reference has been deprecated in D:\Inetpub\wwwroot\clientName\core\cache\includes\elements\modplugin\8.include.cache.php on line 214

          I dont know if this has anything to do with the PHP Access Violation errors, but at the moment, this is all the PHP error log shows.
            • 36440
            • 87 Posts
            Also, we can trigger the PHP Access Violation error by simply clicking navigation items repeatedly.
              • 36440
              • 87 Posts
              Quote from: opengeek at Nov 29, 2011, 04:55 PM
              Unless you are able to capture information about what request is causing it to crash, it's going to be difficult to determine what is going on. Forget caching and optimization for a moment, and let's get past the errors which are crashing your web server. Do you have access to error logs for the IIS instance? Is PHP logging errors to another location?

              Seeing as no logs are reporting anything, we've come to the conclusion that it's most likely one of the PHP extensions that is causing this memory fault. PHP version is 5.2.8. I guess we'll be looking here for a fix.

              Back to my original question...what are optimal caching/optimization settings? Mostly those 'expiration times'. Is 0 ideal? Thanks
              • Unfortunately you have IIS 6 - it sucks! I just got ride of my last IIS 6 server last night!

                I would assume you are running php as ISAPI which can have problems. Try to download the Microsoft Web Platform Installer: http://www.microsoft.com/web/downloads/platform.aspx and install PHP 5.3.* through it, it will be FastCGI. Make sure you install the PHP Manager to. Don't install MODX through the Web Platform as that is an old version.

                Then you need to make sure the PHP has write permissions. PHP uses the IIS_IURS for permissions on IIS6.

                Now set the PHP INI settings for error logging and memory limit. I would recommend at least 128mb for your memory limit.

                If something is still wrong with PHP read this: http://learn.iis.net/page.aspx/247/using-fastcgi-to-host-php-applications-on-iis-60/.

                Hope that helps.

                  • 36440
                  • 87 Posts
                  Thanks for the help jg.
                  Honestly, IIS6 has been problem free until recently....MODx Revo and a installation of latest Drupal are what trigger this memory fault regularly. No other PHP applications/sites cause this. We are running as ISAPI, as well our current memory limit is 128MB.

                  I will use the MS Web Platform Installer but on a new server which Im in the midst of sorting out. I'm not entirely comfortable making such changes in a production environment. Who knows what will crap out then! In the meantime Im hoping something a little less drastic will help, but something tells me a full bore upgrade of everything asap is what will be required sad