Engineering insights from Tim Koopmans examine the performance hurdles of real-time AI at scale.
Discover how high-throughput financial machine learning workloads face latency spikes from concurrent data lookups and vector index degradation.
Koopmans shared his lessons learned in a discussion with the ScyllaDB article author. He initially thought the model was at fault. But in practice, data queries were lagging behind database changes when multiple users were making requests at the same time.
Delays increase with increased usage
As the application approached 740.000 operations per second, the slowest 1% of responses reached three seconds.
According to Koopmans, Postgres wasn't generally slow. It was just that in this particular application, it was receiving more changes and queries than it could handle quickly. So the queries were waiting in the queue behind the changes.
Old data affects results
User profile information, such as their digital wallet addresses, was hours behind, despite the goal of being updated within five minutes. The digital content descriptions the app used to find similar items were also out of date.
↳
READ ALSO
HACKS.GR / RELATED
AI Unlocked
How MasTec prevents dangerous AI mistakes in corporate jobs
↗
Offline evaluation metrics showed good results, but performance deteriorated with real data coming into the app. Koopmans also found that every time the team re-created these descriptions as they refined the model, the quality of the search list decreased. The percentage of relevant results it found dropped to 42%, and searches became slower.
Koopmans suggests monitoring recall accuracy and results. Catalog reconstruction can be done piecemeal or in batches. The search structure also needs to be rebuilt when the comparison method, search settings, or the way the model describes the data changes.
Model training puts a strain on the computer
In Koopmans' implementation, a computer trained the model and served user requests at the same time. The graphics card, processor, and memory competed for the same resources. Searching for similar items was primarily a burden on the processor, because it had to follow connections between the data.
Koopmans believes that the model needs retraining when the data or user behavior changes. A model trained three months ago may already be performing worse. To transition to a new model, he suggests running the old and new models side by side for a while, and making the change gradually, through the application.
Delays, stale data, a decline in accuracy, and training pressure can reinforce each other, creating a cycle that makes the system slower and its results less reliable.
The ScyllaDB approach
ScyllaDB suggests monitoring how recent the data is, how many jobs are pending, and how well the search catalog is performing. It also suggests testing with a higher load than you would normally expect.
The company says its system handles multiple concurrent changes without locking data, and prioritizes fast requests so they aren't delayed by tasks like retraining the model or populating data.
In ScyllaDB's search service, changes are first stored in the main database. Then, a separate service updates the search catalog. If that service lags or stops working, the digital descriptions needed for the search remain in the main database and the changes are not lost, according to the company.
In a test with a billion digital descriptions, ScyllaDB reports that 99% of responses came in under 10 milliseconds, with 300 concurrent connections. The test reached about 150.000 searches per second, with a modest goal of finding relevant results. The company clarifies that as the percentage of relevant results found increases, the speed and number of searches served can decrease.
Finally, ScyllaDB says it can increase a system’s capacity by about ten times in minutes, instead of hours. The key lesson from Koopmans’ experience is that problems in AI applications are not always about the model itself. They can also be due to the data or the way computing resources are shared.
>Stay connected with Hacks.gr
Set us as a preferred source on Google and find us on social media.
Preferred source
↗
end of article
Top comments (0)