I just started experiencing some write-heavy load on a PostgreSQL 11.2 system running inside a Docker container on an Ubuntu 18.04 server. PostgreSQL is receiving about 1-4k INSERT queries/second.
How can one determine whether this amount of load is too high for the system? Are there some metrics to monitor, like one that shows the number of queries being queued up at any one time?
System Specs
- Intel® Atom™ C2750 (8-Core, 2.4GHz)
- 8GB DDR3
- 240 GB SSD
Output of htop
2 node.js app concurrently sending queries to PostgreSQL. Both app and database are running on the same server.
Output of iotop
Output of iostat -c 5 999
Output of vmstat 1
pgAdmin
Best Answer
Unless you have insert triggers that do complex stuff, an
INSERT
is probably bottlenecked by either CPU or I/O.Use
vmstat 1
to determine what is the case: High CPU utilization is obvious, high I/O load manifests asiowait%
at 10 or higher. This assumes that you have not set CPU or I/O limits on the container.If both values look fine, you are probably not maxed out.