Try to limit cache size

We are trying to limit the size used by cache.ndk. If we compact and set limit from the workspace properties, it works. Problem is that setting “InitialCacheQuota=3072” doesn’t seems to work. When deleting the cache.ndk, it is recreated with a larger maximum than 5 Mb. We would prefer to reduce size of that file instead of deleting it at each login.

Any suggestions?

Subject: Try to limit cache size

Any special reason why you would want to do so, when the default value is 30 megs since Notes 6?

Subject: RE: Try to limit cache size

In our environnement we saw many cases were cache grows larger than 30 Mb. In these cases Notes becomes so slow. I read this IBM article : http://www-1.ibm.com/support/docview.wss?rs=0&uid=swg21155947 and it seems that the optimal setting would be a quota to 5 Mb.

We would prefer to limit the quota instead of adding one more script to the login script to delete this file.

Subject: RE: Try to limit cache size

Usually the file size of cache.ndk should not be an issue. Back in Notes 4, cache.dsk occasionally grew to insane size (> 150 MB), but this doesn’t happen any more. In any case, the cache should (noticeably) speed up server based databases, which is more effective, if there is enough space for caching.

Do you happen to keep your user’s data directories on network shares? If so, you might rather consider to place user’s cache.ndk on a local disk instead.

Note, that the default size of 5 MB mentioned in the technote you mentioned really just applies to versions up to 4.6. In Notes 5 the default size was increased to 10 MB and from Notes 6.0 on it is now 30 MB. By no means should reverting to 5 MB be considered an “optimum” in a standard setup.

Still, if you say, that InitialCacheQuota=3072 does not work, how did you check? Did you look at the actual OS file size or did you check the workspace properties setting? Even with this limit in place, Notes will always allow the cache.ndk to grow somewhat bigger, than the configured limit.

I’m still not totally convinced, that it is cache.ndk growing too big causing your clients to become slow. It usually just works the way it’s designed.

Subject: RE: Try to limit cache size

Hi,

I’ve recently posted a script on searchdomino.com.

Embed this LotusScript in a button or in the postopen sub of a database script. With it, users can clear their local caches without deleting their cache.ndk files.

http://searchdomino.techtarget.com/tip/0,289483,sid4_gci1340011,00.html

Here is the code :


Dim WorkSpace As New NotesUIWorkspace

    Dim DbCache As NotesDatabase

    Dim AllDocs As NotesDocumentCollection

    Dim Doc, nextDoc As NotesDocument

    Dim i As Integer



    On erreur Goto ErrorHandling



    Set DbCache = New NotesDatabase ("", "cache.ndk")

    Set AllDocs = DbCache.AllDocuments

    If AllDocs.Count > 0 Then

            Print "deleting documents from cache.ndk ..."

            Set Doc = AllDocs.GetFirstDocument

            While Not ( Doc Is Nothing )

                    i = i + 1

                    Set NextDoc = AllDocs.GetNextDocument ( Doc )

                    Print "deleting documents from cache (" & Cstr (i) & "/" & Cstr ( AllDocs.Count ) & ")"

                    Call Doc.RemovePermanently ( True )

                    Set Doc = NextDoc

            Wend

    End If

    Print "Compacting cache.ndk"

    Call DbCache.Compact



    Call WorkSpace.Prompt (1, "Cache.ndk Optimization", "Optimization ended with success. Ypu should restart Lotus Notes." )



    Exit Sub

ErrorHandling :

    Resume

    Call WorkSpace.Prompt (1, "Cache.ndk Optimization", "An error has occured." )

Pascal LUCAS

http://www.upteamind.fr