3 Replies Latest reply on Jun 9, 2012 5:38 PM by taylorsharpe

    FileMaker Server RAM Cache - Under the Hood

    Jeremiah_Hammond

      Does anyone here have knowledge of the ins and outs of exactly how the RAM Cache works in FileMaker Server? Kinds of answers I'm looking for include:

       

      1. If the cache size is greater than the combined total of all hosted files, will Filemaker Server put all files into memory the moment they're opened?
      2. If the cache size is smaller than the combined total of all hosted files, how does FileMaker Server determine which parts of files are put into memory?
      3. Does FileMaker Server fill up the cache the moment the files are opened, or does it wait until the 1st time a record is requested? Even then, does it put *just* that record into cache? The entire table where the record came from? The table's index only? The entire file?

       

      One of the main reasons I'd like to know this behavior is that it's informative as to what kind of gains there will be if you throw an SSD at FileMaker Server if "everything" is in cache. You wouldn't expect there to be many benefits to speeding up the storage system in that environment, but it truly depends on how Server manages the cache.

       

      Links to white papers, references to DevCon presentations, etc. would be wonderful.

       

      Thanks!

        • 1. Re: FileMaker Server RAM Cache - Under the Hood
          taylorsharpe

          This from FileMaker on cache optimization.  One falacy is to think more is always better.  That is not the case.  It is a balance and the cache hit ratio percentage needs to be kept between 95 and 100, but not always pegged on 100%.  The following are the optimization recommendations that come from <http://help.filemaker.com/app/answers/detail/a_id/5874/~/optimizing-network-performance-for-shared-databases>:  Keep in mind that FileMaker 12 Server is all new, 64 bit, and can address a lot more memory than 11 and there may be new guidance forthcoming on how to set the FileMaker 12 Server cache. 

           

           

           

          OPTIMIZE THE HOST COMPUTER
          Most of the following tips are not specific to FileMaker Pro or FileMaker Pro Server, and can be applicable to any application.  Nevertheless, these tips for speeding up your host computer can help to speed up your usage of FileMaker Pro.

          1. Use a fast computer with a fast hard drive.  Just about any current computer is more than fast enough.
          2. Turn off File Sharing.  If you use File Sharing to access databases for administration, turn off File Sharing when you're done. File Sharing does not specifically effect FileMaker Pro performance, but it does slow down the computer overall, which effects running FileMaker Pro.
          3. Use the latest operating system and make sure to have all the OS updates/patches.
          4. Disable all unnecessary applications/features: screen savers, peer to peer networks, web sharing, etc.
          5. Be sure to change the Energy Saver (Mac OS X) or Power Options (Windows) to never turn off/spin down the computer's hard drive(s).
          6. Make sure you have all the latest updates for FileMaker.
          7. For FileMaker Pro, increasing the cache size may help but there is a trade off as explained in step 8.  This is set in Preferences.
          8. For FileMaker Server: Turn the statistic logging on and make sure on average that the % cache hit ratio is somewhere between 95% to 100 %.  If it's always hitting 100 % regardless of how many users and files are open then too much memory is allocated and the RAM cache for FileMaker Server should be set lower than the current setting.  If it's hitting less than 95 % then you will want to raise the database cache size.  The trade off in increasing the cache size whether it is in FileMaker Server or FileMaker Pro, is that the larger the cache size the less is written to disk until the cache is flushed.  This means if the application crashes then it can cause a loss of data as big as your cache setting.  "Distribute cache flush" setting for server should also be adjusted accordingly.  The longer the time period, the more time it'll take for the information to get saved to the file.  It is recommended to set that at 1 minute in most cases.  You can find this setting within the configuration/properties of the Server under the databases tab
          9. For FileMaker Server - turn down the number of clients that can connect as well as the maximum number of files to be hosted.  This will help distribute the resources for FileMaker Server more effectively.
          • 2. Re: FileMaker Server RAM Cache - Under the Hood
            Jeremiah_Hammond

            Taylor,

             

            My understanding is that the only harm to having "too much" cache is that the memory reserved for cache isn't available for other programs, which is normally not a concern since best practice is to have FileMaker Server on its own, dedicated machine. As long as the OS has available memory to do its job, no true harm here. The bigger harm is hitting disk, which is roughly 5 orders of magnitude slower than RAM (~10 milliseconds versus ~80 nanoseconds, roughly 100,000x slower). I'd much rather avoid disk at all costs. A 1 minute exposure time isn't much of a concern for small business systems. If we were running Amazon on FileMaker Server, I'd think twice about that, but that's not a typical FileMaker environment (at least, from my experience).

             

            The other potential negative is that Server has to flush more data through every interval, but apparently that's a negligible concern with today's hardware. Especially since Server only flushes changes.

             

            From FileMaker Server 11 Configuration Guide for Windows and Macintosh:

             

            The common misconception regarding caching is that one can tune the cache for best performance by reducing the cache size to some optimal number. In reality, setting the cache to the maximum makes that amount available to FileMaker Server when it needs it. In low usage situations the cache is unused. There is no performance loss associated with a large cache setting, especially when compared to the performance loss associated with too small a setting.

             

            ...With the proper hardware in place [the flush interval setting] becomes irrelevant. Given the cache limits of FileMaker Server, the flush interval is trivial on today’s hardware. In the extreme cases of very large databases or databases with a lot of activity, the administrator may consider moving the flush interval up by a few minutes. In all but the extreme case, set the cache to flush fully every minute rather than leaving data in volatile memory.

             

            • 3. Re: FileMaker Server RAM Cache - Under the Hood
              taylorsharpe

              Actually, having too much cache does adversely impact performance and I know this is contrary to what we are told about most other programs.  And the guidance of how to adjust memory based on the hit ratio is based on Server 11, I assume similar guidance will be out on Server 12.  But Server 11 took a performance hit if you gave it too much cache. 

               

              Ref:  http://forums.filemaker.com/posts/f278d12093

               

               

              PS:  Remember that FileMaker 12 Server is supposedly a re-write and 64 bit program now.  Some of the memory rules may be completely different in it since it can address more than 4 Gigs of RAM.