4 ms·
I understand disabling CoW for databases, as the DB itself will manage it, but why disable caching?
by pezezin 6y ago
I understand disabling CoW for databases, as the DB itself will manage it, but why disable caching?
- Uberphallus 6y agoDepends on the RDBMS, but for big ones it's common practice to tune[0] them to allocate a big chunk of memory (or all of it) and let them manage caching by themselves. After all, they know better about the structure of the db files than the OS. [0]https://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server https://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Serv... Relevant parameters: effective_cache_size/shared_buffers/work_mem
- chasil 6y agoOracle offers a document for running their database on ZFS. https://www.oracle.com/technetwork/server-storage/solaris10/config-solaris-zfs-wp-167894.pdf https://www.oracle.com/technetwork/server-storage/solaris10/... "The number one rule for setting up an Oracle database on ZFS is to set ZFS recordsize equal to the database block size for the file systems that contain the Oracle data files." "Starting with Oracle Solaris 11.1, blocks that are referenced from either the snapshot or from the database image actually share ZFS cache buffers for a reduced memory footprint." "Taking a snapshot of a database can involve placing the database in hot-backup mode just for the instant necessary to capture the ZFS snapshot. The database can then be returned to normal operation." "A clone is a full read/write accessible fork of the original database. Therefore, by using either the primary or a replicated storage system, you can cheaply create hundreds of copies of your up-to-date database to run test and development workloads under real data conditions." They also allow compression of the archived (intent) logs.
- nix23 6y agoIn case of Postgres it knows better what to cache, you can let zfs additionally cache but it's a bit of waste, better give that ram to postgres than to Arc.
- chousuke 6y agoI think PostgreSQL actually is a bit of an odd one in that it relies on the OS to do proper caching of whatever data is read from disk. It has its own buffers for various things, but I'm pretty sure it doesn't (yet) implement its own disk cache.