All posts

How we fixed an estimating app that freezes after publishing

Made Right Software builds MVPs and custom software for founders and small business owners, and audits or rescues code that already exists. Fixed price. Delivered in 4 to 10 weeks.

A business owner came to us when their estimating app froze after publishing. It worked fine right after each publish, but it hung about four minutes later. The sign-in, the projects list, and project creation all stopped together. The app runs on Replit and stores its data in Postgres.

The business relied on it every day, and the owner had already paid for one round of fixes that didn’t solve it. They inquired about the cause and solution in writing for a fixed $1.2k. The payment was made in milestones.

Why the app looks healthy while it’s frozen

The first challenge was that every check said the app was fine. Its health check never touches the database, so it kept answering in under half a second even during a freeze.

The second was that earlier work had only tuned the app’s side, with pool settings, timeouts, and keepalives. None of it helped. That pointed us toward the link between the app and the database, which is where a Postgres connection timeout would show up. We started with limited access and couldn’t see the connection settings or the database provider’s console. The production queries only reached a read-only copy of the data.

How we found the cause, diagnosing before changing settings

We diagnosed before we changed anything. We reproduced the freeze on a development copy and watched the app’s connections next to the database’s activity until it stalled. The owner had ruled out simply raising the pool size or timeouts, and we agreed with that rule.

Those changes can hide a problem for a week without explaining it. We counted a cause as found only when removing it stopped the freeze and putting it back brought the freeze back. The cause was the database’s idle pause. After a few quiet minutes, the database paused itself and closed the app’s open connections. The app kept handing those dead connections to sign-in and project requests, which hung until they failed. Turning the pause off stopped the freeze. Turning it back on brought the freeze back. We switched the app to the provider’s connection pooler and set the production database to stay awake. The fix went onto the development copy first, and the owner approved the production publish in writing.

How we proved it worked, and what to do if your app does the same

Before anything went live, we made sure that we fixed all the issues the owner hired us for. Sign-in and the projects list had to stay fast for a full day, tested once a minute, and there shouldn’t be any slow answers or errors. Then came the everyday jobs. Could someone create a project? Could they upload a stack of PDFs? Did a saved job still total up to the owner’s own figures? The pricing and estimating rules stayed exactly as they were. We performed all these functions. Sign-in and the projects list answered in under a second on each of the 1,440 checks across the full day. Creating a project worked every time. The test upload of four PDFs turned 47 pages into 46 sheets. The saved job still matched the owner’s figures.

If your app freezes while everything looks healthy, this is the kind of software project rescue we do. Book a call with Made Right Software, and we will start with the diagnosis.

Frequently asked questions

Why does my app work after I publish, then hang a few minutes later?

Usually something between the app and its database is closing connections while the app still thinks they’re open. Common causes include an idle timeout, a database that pauses when it’s quiet, or a proxy that drops quiet connections. The logs from the moment of the freeze are the best place to start.

Why does my app say it’s healthy when it’s clearly not working?

Most health checks only confirm that the app is running, not that it can reach its database. A check that runs a simple database query will catch this kind of failure. Be careful, though, because a check that’s too strict can restart an app that only needed a moment.

Will increasing the database connection pool size fix a timeout?

Sometimes, but often it only delays the problem. If the cause is a connection being dropped, a bigger pool just fills with more dead connections. Find the cause first, then decide whether the pool needs changing.

Can a developer give me a fixed price before they know what’s wrong?

They can price the investigation, because reading logs and reproducing the problem has a known size. The fix is harder to price until the cause is found. Ask what happens to the quote if the cause turns out bigger than expected.