Tuning PostgreSQL for Production
Default PostgreSQL settings are conservative. Adjust these based on your server resources.
Key Configuration Parameters
Edit `/etc/postgresql/14/main/postgresql.conf`:
shared_buffers
Set to 25% of system RAM.
TERMINAL
shared_buffers = 4GBeffective_cache_size
Set to 50-75% of system RAM.
TERMINAL
effective_cache_size = 12GBwork_mem
Complex queries per connection. Start small (e.g., 16MB) and monitor.
TERMINAL
work_mem = 16MBmaintenance_work_mem
For vacuuming and indexing.
TERMINAL
maintenance_work_mem = 512MBRestart PostgreSQL to apply changes:
bash
sudo systemctl restart postgresqlPage changelog
Last updated
- 2024-03-18—Initial or baseline update for this page.
Related articles
Configuration
API Reference — Patterns and Generation
How to design, document, and (when possible) auto-generate reference docs from OpenAPI and source code.
Configuration
Tailwind CSS — Utility-First Styling with Production Discipline
Install Tailwind, build consistent design tokens, and ship fast UI with real CSS examples, components, and best practices.
Configuration
Ant Design — Enterprise UI Components for React
A mature enterprise component library. Learn how to install, theme, and use components with predictable layout and form patterns.
Configuration
MUI (Material UI) — Component Library with Theme Tokens
Build consistent UI fast with MUI themes, component overrides, and practical examples for React/Next.js.
Configuration
Styled Components — CSS-in-JS with Real CSS Snippets
Write component-scoped styles with full CSS power, theming, and patterns for scaling safely.
Configuration
Sass/SCSS — Structured CSS for Large Codebases
Use variables, mixins, and partials to keep CSS maintainable. Includes SCSS examples you can copy/paste.
Was this page helpful?