Postgres error: could not send startup packet SQLSTATE[08006]

Hi,

I’m getting the error below from time to time and not sure what is causing this.

SQLSTATE[08006] [7] could not send startup packet: Resource temporarily unavailable (Connection: pgsql <query>)

I assume it has something to do with my postgres server configuration but can’t figure out what it is. My Postgres server is always up and has this configuration:

NAME                      	VALUE  	UNIT	DESCRIPTION                                                                                	PENDING RESTART
log-statement             	none   	    	Sets the type of statements logged. [none, ddl, mod, all]                                  	false          	
shared-preload-libraries  	repmgr 	    	Lists shared libraries to preload into server.                                             	false          	
wal-level                 	replica	    	Sets the level of information written to the WAL. [minimal, replica, logical]              	false          	
max-wal-senders           	10     	    	Sets the maximum number of simultaneously running WAL sender processes. (0, 262143)        	false          	
work-mem                  	4096   	kB  	Sets the maximum memory to be used for query workspaces. (64, 2147483647)                  	false          	
shared-buffers            	32768  	8kB 	Sets the number of shared memory buffers used by the server. (16, 1073741823)              	false          	
log-min-duration-statement	-1     	ms  	Sets the minimum execution time above which all statements will be logged. (-1, 2147483647)	false          	
max-replication-slots     	10     	    	Sets the maximum number of simultaneously defined replication slots. (0, 262143)           	false          	
max-connections           	300    	    	Sets the maximum number of concurrent connections. (1, 262143)                             	false          	
maintenance-work-mem      	65536  	kB

I’m using Postgres 15.2 (image flyio/postgres-flex:15.2 (v0.0.40)), PHP 8.3.9 and Laravel 10.48.4.

Any help is much appreciated.

Thank you,

Floris

PS: I accidentally closed my original topic and could not restore it. Sorry for double posting.

Anything interesting in your Postgres App logs when you hit that error? I would also check the Metrics tab within the Fly Dashboard to see if anything looks awry.

Ah, yes of course. Sorry I didn’t check that myself upfront. I see this:

Health check for your postgres vm has failed. Your instance has hit resource limits. Upgrading your instance / volume size or reducing your usage might help.
[✗] cpu: system spent 1.44s of the last 10 seconds waiting on cpu (23.3µs)

In the metrics I don’t see the CPU, memory or volume limits are hit (not even close). What else could this be?

Do you happen to see a spike in the number of PG connections being made?

Not really, no. The average over the last 6 hours is 7.4, with a maximum of 20. The error occurred 13 times in this time period.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.