Heroku postgresql ecto db poolsize worries

Hi,

Any ideas on how to find the optimal db pool size on Heroku? We currently have it set to 10 on a Performance M dyno. The app receives between 50 - 200 req/s all going to the postgresql DB for a few DB calls per request.

The heroku DB can handle 400 connections but when we upped the poolsize to 30 the app starting behaving oddly. Backlog filling up, connections being dropped. Moved it back to 10 and things were fine again.

But 10 seems a very small number. Should I be worried?

How many Dynos are you running? Each dyno is a single core so there is probably a limit to how efficiently a high volume of connections can even be used.

1 performance M. But i’ve been thinking that since we only use about 250 MB we could run multiple smaller regular dyno’s for the same money and get more connection to the DB. But then we wouldn’t have a dedicated dyno, but that could be ok

Looks like two CPUs with one core each? (seems weird, for that kind of money)
It says 11x compute

but this says st else: cat /proc/cpuinfo:

processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 62
model name	: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
stepping	: 4
microcode	: 0x42c
cpu MHz		: 2800.078
cache size	: 25600 KB
physical id	: 0
siblings	: 2
core id		: 0
cpu cores	: 1
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology eagerfpu pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm retpoline kaiser fsgsbase smep erms xsaveopt
bugs		: cpu_meltdown spectre_v1 spectre_v2
bogomips	: 5600.15
clflush size	: 64
cache_alignment	: 64
address sizes	: 46 bits physical, 48 bits virtual
power management:

processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 62
model name	: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
stepping	: 4
microcode	: 0x42c
cpu MHz		: 2800.078
cache size	: 25600 KB
physical id	: 0
siblings	: 2
core id		: 0
cpu cores	: 1
apicid		: 1
initial apicid	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology eagerfpu pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm retpoline kaiser fsgsbase smep erms xsaveopt
bugs		: cpu_meltdown spectre_v1 spectre_v2
bogomips	: 5600.15
clflush size	: 64
cache_alignment	: 64
address sizes	: 46 bits physical, 48 bits virtual
power management:

I assumed standard. I haven’t ever actually dropped the money for performance M before, so it’s hard to say. Hopefully you’ll get a better answer elsewhere.

1 Like