solidDB Help : Configuring and administering : Performance tuning : Controlling memory consumption : Managing the database cache
  
Managing the database cache
The information managed by the solidDB server is stored either in memory or on disk. Since memory access is faster than disk access, it is desirable for data requests to be satisfied by access to memory rather than access to disk. The database cache uses available memory to store information that is read from the hard disk. The database cache is also used to buffer the database pages while the server is executing a checkpoint. When an application requests information that was previously stored in the cache, the data can be read from memory instead of the hard disk.
Changing database cache size
The default size of the cache depends on the platform. You can change the cache size by using the IndexFile.CacheSize parameter, see IndexFile section. Typically, you need to increase the cache size when there are several concurrent users.
If a database is primarily disk-based, either of the following estimates can be used to determine the cache size:
0.5 MB per each concurrent user of the system,
2-5% of the database size.
When estimating the necessary cache size by using these values, use the larger value.
Cache size is not limited, you can also configure cache sizes that exceed the database size, which might increase performance.
In order to facilitate efficient checkpoint activity, you cannot decrease the cache size of an in-memory database below 8 MB.
Be careful, if you increase the value of IndexFile.CacheSize. The cache must fit into available RAM; swapping between memory and disk leads to severe performance penalties. If the cache size is too small, the cache hit rate remains poor. The symptoms of poor cache performance are database queries that seem to be slower than expected and excessive disk activity during queries.
You can verify whether the server is retrieving most of the data from disk instead of memory by checking the cache hit rate by using the command ADMIN COMMAND 'status'. Alternatively, check the overall cache and file ratio statistics by using ADMIN COMMAND 'perfmon'. Typically, the cache hit rate needs to be better than 95%.
The solidDB server uses a hash table to ease access to the cache. The hash table size equals the number of pages in the cache. This guarantees almost collision-free access. If the cache size is increased dynamically, the hash table is not automatically enlarged, which results in a higher collision probability. To avoid collision, use the IndexFile.ReferenceCacheSizeForHash parameter to accommodate the enlarged cache.
Notes
If you are using a diskless server with disk-based tables, the database cache size has to be configured to contain the whole database. This is because a diskless server does not use any disk storage space, it maintains all D-tables in the database cache.
You can increase the database cache dynamically (by using the ADMIN COMMAND 'parameter' command, see PARAMETER), but to decrease the cache size, you must edit the parameter value in the solid.ini configuration file and restart the server.
Go up to
Controlling memory consumption