Within Patroni, is it possible to have replicas with different specs than the leader? For example: the leader has max_connections set to 800 and shared_buffers to 8GB, but 2 replicas with 100 and 2 GB, respectively.
When you setup patroni , etcd and postgres, your changes are kept in sync. You have to manage your settings via patroni at this point. So when you run patronictl -c configfile edit-config
and make your changes, that gets update across all servers in the cluster so they all match.
Even if you take patroni out of the picture, you cannot have 800 max connections on one and 100 on a replica. You will get an error like this
FATAL: hot standby is not possible because max_connections = 100 is a
lower setting than on the master server (its value was 800)
Hello,
Please take a look at the official documentation.
https://patroni.readthedocs.io/en/latest/patroni_configuration.html
There are some parameters that can be different across the nodes, but there are also some that has to be changed via “patronictl edit-config” to keep them on the same values cluster-wide as Jorge mentioned. Also this is a good practice, to keep them on the same value, so in case of failover, you can expect to have the same performance.
In your specific case, where replica specs are lower than leader, you could change some of the parameters to lower values, but then it is recommended to disable automatic failover for those nodes by adding an appropriate tags, and allow automatic failover only to replicas with same specs as primary.