0

I have an external postgres database (using digital ocean); I am able to connect to it from my laptop but I get a connection timeout from my minikube kubernetes pod. This is in dotnet core (not sure if that matters)

fail: Program[0] identity-55595689b5-qb8gh identity Npgsql.NpgsqlException (0x80004005): Failed to connect to :25060

I also added external IP and external name service .. but still getting timeouts.. could anyone please let me know what I might be doing wrong

1
  • are you white listing local IP in postgres to connect ? Commented Mar 17, 2023 at 13:21

1 Answer 1

0

The below information derived from santiesuite Help portal

Cause: The cause lies with an overflow of connections against the PostgreSQL server. This is very common when hosting the IMS on AWS or other hosted providers which limit the number of concurrent connections to the server.

Below workarounds can help:

1)increasing the maximum connections settings in postgres.config

2)force-disconnect all clients on your database by running the following command

select pg_terminate_backend(pid)
from pg_stat_activity
where datname = 'yourdatabasename

'

3)disable multi-threaded fetches from the data store with the following setting on your element

 <openiz.persistence.data.ado>
         <connectionManager stm="true" 
              maxRequests="4"
              />

4)reduce the number of IMS instances contacting the particular database server

5)scale-out the database to introduce read-only nodes,reducing the load on the primary data server.

Sign up to request clarification or add additional context in comments.

3 Comments

I am using .net core (entity framework) let me see how the maxRequests can be enabled there; also the strange thing is .. the connection timesout and if I wait for 10 mins ... it starts working again; I am wondering if I should just host the database inside of kubernetes itself (since I am worried going live with not knowing the reason); many thanks for your suggestion (will try)
Actually I ended up spinning up my postgres inside my cluster for now; also for the external db; I created a "external" service -- it did work (but not sure if the timeout problem got solved because of it)
Many thanks for this -- I will try to get us a specific use case for us to debug; will let you know in some days

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.