Skip to content

Slow pages and AI costs even with the project paused

A platform built with AI was slow and kept spending even with the project paused: what was behind it and what I fixed.

Author

G. Tempesta

Published

Reading

3 min

Updated

Written with AI assistance, reviewed by Giovanni Tempesta

Slow pages and AI costs even with the project paused

Details have been changed to protect the client's confidentiality.

In short: the pages were slow because the APIs downloaded far more data than they displayed, and the app kept spending while idle because some automated processes went on calling the AI after the project had been paused.

What the platform did

A platform built with AI tools processed data with artificial intelligence and sent notifications to users. The idea worked, but the app was hard to use.

What the symptoms were

  • Very slow pages.
  • A search filter that never found anything, even when the data was there.

Why the app was slow and the search found nothing

The APIs downloaded everything, every time. A list needed only a few fields; far more arrived, for every item. It is a typical mistake in generated code: it works with ten test rows and collapses with the real ones.

The filter did not know the real format of the data. The codes used for classification had a slightly different format from the one the code expected. The comparison always failed without showing any error, and the search returned zero results.

What I fixed in the code

  • Lighter APIs: each page asks only for the data it shows.
  • Optimised data loading.
  • Filter corrected to the real format of the codes.
  • Reading of the details of individual items fixed.

Why the app kept spending while idle

Reading the code brought other issues to light, which I reported:

  1. Automated processes that kept running. At regular intervals, data collection and AI calls started up, even after the project had been paused. Every run cost money, and nobody was watching.
  2. Some functions could be called by anyone, without authentication.
  3. A problem with domain management on the platform, which meant the app had to be moved.

Why this happens in AI-built apps

When AI creates an automated process, it takes care of starting it and making it work. How and when to stop it is left out of the code, and nobody thinks about what happens when the app is needed less or not at all. And the bills for AI and cloud services arrive at the end of the month, when it is too late to work out where they come from.

What you can take away

  • Make a list of everything that runs on its own in your app: scheduled jobs, scheduled functions, webhooks. For each one, ask yourself: is it still needed? How much does it cost?
  • If a page is slow, look at how much data it downloads. The answer is often there.
  • If a filter «finds nothing», compare the format of the real data with that of the test data.

Is your app slow, or are costs rising for no reason? With the AI Code Check-up I also look at the performance and costs of your cloud services, and tell you where to act. Fixed price. The AI Code Check-up page

  • Performance
  • Costi cloud
  • OpenAI
  • Caso di studio