[Tile-serving] [osm2pgsql-dev/osm2pgsql] Keep-alive for serverless environments (Discussion #2292)

Goncalo Oliveira notifications at github.com
Mon Jan 13 09:33:46 UTC 2025


When working with serverless database environments, it's easy for a connection to get dropped while waiting for `osm2pgsql` to read a file. When that happens, we'll see something like

```sh
[CRITICAL]: Exception during execution: SSL connection has been closed unexpectedly
```

One of such database providers is [Neon](https://neon.tech/docs/introduction/serverless)

> For the first issue related to the SSL connection being closed unexpectedly, this can occur when the application tries to reuse an idle connection after the Neon compute has been suspended due to inactivity. If you plan to leave a connection idle, it would be good to increment the auto-suspend timer to meet the duration needed, or disable it altogether. The default auto-suspend is 5 minutes, and looking at the endpoint activity, it is suspending roughly 5 minutes after opening.

Naturally it's possible to workaround this by changing the default inactivity timeout to a bigger value on Neon compute settings. However, it would be nice if there was some sort of keep-alive mechanism to prevent the timeout from triggering, even if an additional option like `--keep-alive` for example, was necessary.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/osm2pgsql-dev/osm2pgsql/discussions/2292
You are receiving this because you are subscribed to this thread.

Message ID: <osm2pgsql-dev/osm2pgsql/repo-discussions/2292 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20250113/5d5fd66b/attachment.htm>


More information about the Tile-serving mailing list