faild with err pq: sorry, too many clients already #209
Labels
No Label
bug
critical
documentation
duplicate
enhancement
Epic
good first issue
help wanted
Integration tests
invalid
question
v5
wontfix
Copied from Github
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cerc-io/ipld-eth-server#209
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
While running a tool that executes a single eth_call, eth_blockNumber, eth_getStorageAt at a time after a few minutes of it looping, I observed repeated errors in the logs of the form:
Doesn't this mean: "postgresql won't accept any more connections"?
Yes, but I think it is actually on the geth side.
This code has the comment:
Which then makes a remote call:
The means the pq error is really coming in response to that RPC call.
In the DB container logs I see this:
From geth:
Could this be related? https://github.com/cerc-io/go-ethereum/issues/293
It looks highly likely.
A couple clarifying questions:
How many operations were looped through in those couple minutes? (approx, order of magnitude)
What Postgres database is this ipld-eth-server operating on top of and what geth node is it talking to?
What I suspect could be happening is:
statediff_writeStateDiffFor
on the proxy geth node when it is unable to satisfy these requests against the local database without errorstatediff_writeStateDiffFor
is overloading geth's Postgres connection pool, because creating and writing these statediffs is an expensive operation (especially over historical ranges where the geth node does not have an in-memory cache of most the trie nodes it needs to access) that has performance issues/missing optimizations to the Postgres connection pool and tx lifecycle e.g. https://github.com/cerc-io/go-ethereum/issues/294#221 and #223 should prevent this from the ipld-eth-server side now.