RDS postgres logs

0

We have an RDS PostgreSQL instance with logs streamed to CloudWatch. We want to minimize the amount of memory occupied by logs in the RDS instance itself. One solution we considered was changing the "log_truncate" parameter, but this parameter is immutable. Are there any solutions that allow us to store logs only in CloudWatch and not in RDS?

1 Answer
2

The logs don't reside in memory in RDS, logs are stored in the DB instance local storage. The size of the local storage will vary according to the DB instance class.

That being said, one way to reduce the local storage utilization by the logs is to reduce the retention period of the logs to the minimum value of 1 day and have the logs exported to CloudWatch then.

The parameter that controls the time for retention is rds.log_retention_period. PostgreSQL logs that are older than the specified number of minutes are deleted. The default value of 4320 minutes deletes log files after 3 days.

If you reduce to 1 day and have the setting "export to CloudWatch" enabled, that will export the logs every 24 hours and will reduce the local storage usage. (1 day (1,440 minutes)).

It's important to note you can't modify the parameter settings of a default parameter group. If you wish to adjust the value of a given parameter, such as 'rds.log_retention_period' you can do so by using a "Custom Parameter Group

RDS for PostgreSQL database log files - https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.Concepts.PostgreSQL.html

profile picture
EXPERT
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions