Overview
PgCache, the easy read cache for Postgres.
Eliminate Database Bottlenecks Without Code Changes: Database administrators need a solution that works immediately without disrupting existing workflows.
Drop-In Performance Acceleration: PgCache is a wire-compatible Postgres proxy that sits transparently between your applications and database. Simply update your connection string, and PgCache begins accelerating your most frequent queries, automatically. No application code changes, no Redis complexity, no data consistency nightmares.
Intelligent Cache Management: Unlike traditional query result caches, PgCache loads and caches actual table data, enabling it to serve complex queries with joins, aggregations, and dynamic WHERE clauses. Cached data is automatically refreshed using PostgreSQL Logical Replication, eliminating stale data concerns.
Highlights
- Easy, drop in read caching: Simply change your connection string (PgCache automatically caches read data for 80% of common SQL patterns)
- Generous free tier, transparent scaling: Your first 1M cache hits per month are free, then only pay for what you use (10 USD per 1M hits). No hidden infra markups, perfect for small and growing applications.
- Enterprise Pricing: Contact sales at aws-team@pgcache.com for private offer pricing.
Details
Introducing multi-product solutions
You can now purchase comprehensive solutions tailored to use cases and industries.
Features and programs
Financing for AWS Marketplace purchases
Pricing
Dimension | Description | Cost/unit |
|---|---|---|
Cache Hits | The number of queries served from cached data. | $0.00001 |
Vendor refund policy
For standard subscriptions, refund requests may be reviewed on a case-by-case basis within the applicable timeframe. Contact aws-team@pgcache.com
How can we make this page better?
Legal
Vendor terms and conditions
Content disclaimer
Delivery details
64-bit (Arm) Amazon Machine Image (AMI)
Amazon Machine Image (AMI)
An AMI is a virtual image that provides the information required to launch an instance. Amazon EC2 (Elastic Compute Cloud) instances are virtual servers on which you can run your applications and workloads, offering varying combinations of CPU, memory, storage, and networking resources. You can launch as many instances from as many different AMIs as you need.
Version release notes
0.4.7 - 2026-03-27
CDC connection resilience
when the replication connection is lost, pgcache now preserves the cache and transparently forwards all queries to the origin database. On reconnect, it verifies the replication slot's LSN hasn't advanced past its last acknowledged position; if safe, cache dispatch resumes without a full restart. If the slot was dropped or the LSN diverged, pgcache performs a clean restart. Reconnection uses exponential backoff (500ms - 30s).
Set TCP_NODELAY on sockets.
Additional details
Usage instructions
PgCache AMI Usage
PgCache is a transparent caching proxy for PostgreSQL. This AMI includes PgCache and an embedded PostgreSQL 18 cache database, managed as systemd services. On first boot, a bootstrap script fetches your database credentials from AWS SSM Parameter Store and starts the proxy.
Prerequisites
Origin PostgreSQL database with wal_level = logical enabled Database user with REPLICATION role attribute or superuser IAM role attached to the instance with ssm:GetParameter permission
Quick Start
- Store your database URL in SSM
aws ssm put-parameter --name "/pgcache/prod/upstream-url" \ --type SecureString \ --value "postgres://user:password@host:5432/dbname?sslmode=require"
- Launch with user-data
Pass a script that calls the bootstrap with your SSM prefix: #!/bin/bash /opt/pgcache/bootstrap.sh --ssm-prefix /pgcache/prod
- Connect your application
Use the instance's private IP on port 5432.
Use the same database credentials that you stored in SSM.
SSM parameters (under your prefix)
All parameter names below are relative to your SSM prefix (for example, /pgcache/prod).
upstream-url (Required): Origin database connection URL. Example name: /pgcache/prod/upstream-url
replication-url (Optional): Separate connection URL for CDC replication. Example name: /pgcache/prod/replication-url
tls-cert (Optional): PEM-encoded TLS certificate for client connections. Example name: /pgcache/prod/tls-cert
tls-key (Optional): PEM-encoded TLS private key for client connections. Example name: /pgcache/prod/tls-key
Bootstrap options
Non-secret settings can be passed as flags in user-data along with your SSM prefix:
/opt/pgcache/bootstrap.sh --ssm-prefix /pgcache/prod --workers 4 --cache-size 4294967296 --allowed-tables users,orders
Common flags:
--workers (default: half of vCPUs): Number of PgCache worker threads.
--cache-size (default: unlimited): Maximum cache size in bytes; enables eviction when set.
--cache-policy (default: clock): Eviction policy, one of "clock" or "fifo".
--admission-threshold (default: 2): Number of times a query must be seen before it is cached.
--allowed-tables (default: all): Comma-separated list of tables that may be cached.
--pinned-tables (default: none): Comma-separated list of tables that are always kept in cache.
--pinned-queries (default: none): Semicolon-separated list of queries that are always kept in cache.
Managing the service
Check status: sudo systemctl status pgcache
View logs: sudo journalctl -u pgcache -f
Edit config: sudo vi /etc/pgcache/config.toml
Restart after config changes: sudo systemctl restart pgcache
Metrics
Prometheus metrics endpoint: http://<instance>:9090/metrics
Ports
5432: PgCache proxy (configure access via security groups).
9090: Prometheus metrics (optional; restrict as needed).
5433: Embedded PostgreSQL (listens on localhost only, not externally accessible).
Security
Database credentials are stored in SSM SecureString parameters and fetched at boot, not passed in user-data.
The PgCache configuration file is readable only by root and the postgres user.
Restrict access to port 5432 to your application VPC or specific security group sources.
Further documentation
Full documentation, including advanced configuration, troubleshooting, and architecture details, is available at:
Support
Vendor support
contact aws-team@pgcache.com .
AWS infrastructure support
AWS Support is a one-on-one, fast-response support channel that is staffed 24x7x365 with experienced and technical support engineers. The service helps customers of all sizes and technical abilities to successfully utilize the products and features provided by Amazon Web Services.