Skip to content
Rowsafe
Docs

Tuning: your database's settings

See the settings that matter, tune them for your server in one click, and undo any change.

A fresh PostgreSQL uses settings for a tiny machine: 128 MB of cache, whatever your server has. Tuning explains the settings that matter and sets them for your server when you click.

Open a database, then Tuning. This page shows PostgreSQL; see MySQL and MariaDB, MongoDB and ClickHouse and Redis and Valkey for differences.

What you see

  • Your server: memory, CPUs, disk type (SSD or spinning).
  • The settings that matter, by group: what each does, its value and default, where it's set, and whether it needs a restart.
  • Other settings from configuration files.
  • Changes made through Rowsafe, with Undo.

Refreshed every 5 minutes.

Tune for this server

Tune for this server lists each recommended change with the current value, the new one, and why. Click Apply, check the list, and confirm.

Rowsafe saves a Mark (on a backed-up database).

The agent rechecks each value, sets it with ALTER SYSTEM, and reloads. Apps keep working.

Start-only settings (like shared_buffers) wait for a restart. Nothing restarts now. Click Restart PostgreSQL now when it suits you (where restarts are allowed), or wait for the next restart.

More options sets the workload (Web app, Analytics or Mixed, the default) and the disk type: cloud disks often say "spinning" on SSDs.

Change one setting

Click the pencil next to a setting, enter a value (like 512MB or 30s), and click Change it. Reset to default removes Rowsafe's value. Same safety: a Mark, the checks below, undo.

Undo

Undo (in the success message, or under Changes made through Rowsafe) restores the previous values. Restart-only settings go back at the next restart. You can undo a setting's latest change, once.

What Rowsafe refuses

Rowsafe changes nothing when a change:

  • touches what Rowsafe relies on: backups (archive_mode, archive_command, archive_timeout, archive_library), restores and standbys (restore_command, recovery_target*, primary_conninfo, primary_slot_name), or the agent's connection (port, unix_socket_directories);
  • could stop PostgreSQL from starting: shared_buffers above 60% of memory, a missing shared_preload_libraries library, huge_pages = on where it isn't already, max_connections not above the admin-reserved ones, wal_level = minimal;
  • lets a few queries eat memory: work_mem above a quarter of memory, maintenance_work_mem above half;
  • is a restart-only setting Rowsafe can't check (like listen_addresses);
  • is overridden on the command line (for example -c in Docker);
  • comes while the config already has an error that would stop the next start, or on a standby.

If PostgreSQL rejects a value or reports a config error after the reload, the agent puts the old values back.

Pulse

FindingFix
PostgreSQL is using default memory settings on a server with 4 GB or moreTune for this server
Query statistics are off: pg_stat_statements is installed but not loadedTurn on query statistics (takes effect after a restart; Rowsafe also creates the extension)
Changed settings are waiting for a restartRestart PostgreSQL

From a terminal

rowsafe settings app                      # the settings that matter, by group
rowsafe settings app shared_buffers       # one setting, explained
rowsafe tune app --workload web           # the recommendations; asks before applying
rowsafe settings set app work_mem=64MB    # change one (VALUE "default" resets it)
rowsafe settings undo app                 # undo the latest change
rowsafe restart app                       # apply restart-only settings

See the CLI reference. AI agents read settings with database_settings (MCP) and apply recommendations as the person who connected them, an owner or admin (a Mark first).

MySQL and MariaDB

Same page: buffer pool, redo log, connections, temporary tables, disk speed, timeouts, slow query log. Tune for this server gives the buffer pool about 70% of memory (8 GB or more), a bigger redo log and SSD-sized disk speed. A Mark first; undo works.

  • MySQL keeps changes with SET PERSIST; start-only settings use SET PERSIST_ONLY.
  • MariaDB keeps them in /etc/rowsafe/mysql/server.cnf and applies them live (SET GLOBAL). In Docker, set them in the container's command instead.
  • Rowsafe never touches the binary log settings restores need, and never makes commits wait less for the disk (innodb_flush_log_at_trx_commit, sync_binlog).
  • Start-only settings wait for a Restart you choose (where root allowed restarts).

MongoDB and ClickHouse

Their settings files belong to root. Where root allowed it (sudo rowsafe-allow tuning, or yes at install), root's copy of the agent writes your changes, from a fixed list of plain values, into Rowsafe's own file only. A Mark first; undo restores the old file.

  • ClickHouse: memory per query and per server, spilling big GROUP BY and ORDER BY to disk, concurrent queries and connections, threads, merges, the longest query. In config.d/rowsafe-tuning.xml and users.d/rowsafe-tuning.xml; picked up within seconds, except a few that say they need a restart.
  • MongoDB: WiredTiger cache, connections, longest transaction, slow operation threshold, profiler. Written to its YAML config (a copy is kept). Cache, transaction limit and slow threshold also apply live; the rest at restart.

Restarts are yours (Restart, where root allowed it). In Docker, set these in the container's configuration.

Redis and Valkey

Every setting applies live (CONFIG SET), no restart. Changes made together all apply or none do.

  • Memory: maxmemory, maxmemory-policy, activedefrag.
  • Persistence: save, appendonly, appendfsync. The replication backlog and min-replicas-to-write are locked (Rowsafe's link needs them).
  • Connections: max connections, idle timeout, tcp-keepalive.
  • Slow log and latency: threshold, length, latency monitor, per-command latency.

Passwords, port, address and data folder aren't shown; Rowsafe never reads passwords.

Tune for this server asks: Cache, Store or queue (no key may be lost), or Not sure (almost all keys expiring means cache). It proposes:

  • A memory limit if none: about 75% of memory, shared equally with other databases Rowsafe protects there. The rest leaves room for snapshots. Nothing if the data already needs more.
  • Eviction: allkeys-lru for a cache on noeviction; noeviction for a store or queue that evicts (writes are refused rather than keys lost).
  • Snapshots for a store with nothing on disk, so a restart doesn't empty it. Never persistence off, never the append-only file: your backups keep every change.
  • Keepalives if off, the latency monitor at 100 ms, the slow log at 10 ms if off.

Refused: a memory limit above 90% of memory, below current use, or under 64 MB; an idle timeout under 10 seconds; a slow log of every command; fewer than 32 connections.

Surviving a restart (the page tells you first):

  • Where root allowed Tuning, root's agent also writes it to redis.conf or valkey.conf, replacing only those lines (a copy is kept; undo restores them).
  • Otherwise the server saves it with CONFIG REWRITE, if it may write its config.
  • Without a config file (common in Docker), the change lasts until restart. Put it in the container's command or a config file.

A Mark first, except on a server Rowsafe can't follow. A replica's settings are changed on its primary.

Limits

  • Changes are server-wide (ALTER SYSTEM, postgresql.auto.conf). ALTER DATABASE and ALTER ROLE settings override them and aren't shown.
  • PostgreSQL in Docker: memory and CPUs are the host's, the disk type is unknown (set it under More options), and Rowsafe can't restart the container.
  • Recommendations assume PostgreSQL is the main thing on the server. If your app shares it, keep memory lower.
  • A standby follows its primary: change settings there.
Edit on GitHub