# PostgreSQL Setup

To get the most out of your PostgreSQL database there are a number of tasks you will want to do after you have installed the PostgreSQL Server

## Increase PostgreSQL Memory Allocations

The default maximum memory allocated to a default PostgresQL is minuscule. Yes, this means that a stock PostgreSQL will run on a computer with less capability than a modern cell phone but it also means a lot of unnecessary disk swapping. There are a handful of parameters you will want to bump — all found in postgresql.conf.

The following table lists a few key default PostgreSQL parameters and the parameters used in Capstorm’s labs.

| Parameter              | Default | Capstorm PostgreSQL Servers |
| ---------------------- | ------- | --------------------------- |
| shared\_buffers        | 128MB   | 4GB                         |
| work\_mem              | 4MB     | 1GB                         |
| maintenance\_work\_mem | 64MB    | 1GB                         |
| effective\_cache\_size | 4GB     | 12GB                        |

For additional help see:

* <https://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.capstorm.com/best-practices/postgresql-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
