Az üzemeltethetőség próbája
Monitorozhatóság, költség, terheléselosztás egy multitenant AI-rendszerben
monitoring, cost and load balancing in a multi-tenant AI system
An English version of this article follows below. Jump to the English version.
A sorozat előző részében a megfelelésről írtam: a szabályozási elvárásokról, amelyek nélkül egy AI-ügynökrendszer be sem léphet egy komoly vállalati környezetbe. A megfelelés viszont csak a belépő. Ami utána eldönti, hogy egy rendszer valóban beilleszthető-e, az a napi működtethetőség: látom-e, mi történik benne, tudom-e, mennyibe kerül, és bírja-e a terhelést anélkül, hogy egy ügyfél elvinné a másik elől az erőforrást. Ez a rész erről a három kérdésről szól, és ugyanolyan őszintén nézem meg a saját rendszeremet, mint az elsőben: mi az, ami éles, mi részleges, és mi hiányzik még.
- Biztonság és megfelelés: GDPR, NIS2, EU AI Act (szeptember 9.)
- Üzemeltethetőség: monitorozhatóság, költség, terheléselosztás (ez a rész, szeptember 11.)
- Szabványosodás: MCP, OpenTelemetry, human-in-the-loop (szeptember 13.)
- Összegzés és a vízionált vállalati fejlesztési irányok (szeptember 15.)
1. Miért az üzemeltethetőség a második kapu
Egy vállalati üzemeltető nem attól alszik nyugodtan, hogy a rendszer elvileg biztonságos, hanem attól, hogy baj esetén látja, mi történik, és be tud avatkozni. Egy AI-ügynökrendszernél ez a kérdés élesebb, mint a hagyományos szoftvernél, mert az ügynökök viselkedése nem determinisztikus, a költségük pedig nem fix: ugyanaz a feladat egyszer olcsó, máskor egy elszabaduló gondolatmenet miatt sokszorosa. Ezért az üzemeltethetőséget három lábon nézem: látom-e a rendszert, uralom-e a költségét, és elbírja-e a terhelést.
2. Monitorozhatóság: mit látok a rendszerről
A mérés az a terület, ahol a rendszerem a legjobban áll. Minden ügynök token-felhasználását nyomon követem, ügynökönként és munkamenetenként, méghozzá két rétegben: valós időben egy figyelő rögzíti az aktuális állapotot, és egy néhány perces összegzés adja a pontos képet, kiszűrve a duplikációkat. Egy közös állapottáblán bármikor látszik, melyik ügynök épp mivel foglalkozik. Minden ügynöki eszközhívás naplózott, és minden biztonsági kapu eredménye is, azzal az alapelvvel, hogy ezek a kapuk hiba esetén tiltással, nem átengedéssel zárnak. Egy korábbi üzemzavar tanulsága nyomán külön figyelem az egyes munkavégző folyamatok életben létét is.
A hiányokat viszont nem szépítem. Az elosztott nyomkövetés, vagyis az, hogy egy kérés útját végig lehessen követni a komponenseken, mostanra éles: a szabványos szerkezet megvan, és a nyomvonalakat OpenTelemetry-protokollon külső gyűjtőbe (Tempo) vezetem ki, a metrikákat egy Prometheus-kompatibilis backendbe, minden kérést tenant-azonosítóval és az MCP-hívások korrelációs attribútumaival bélyegezve. Automatikus riasztás viszont nincs: ha egy érték elszáll, azt ma nekem kell észrevennem, nem egy rendszer szól helyettem. És nincs vállalati napló-integráció, tehát egy biztonsági műveleti központ (SOC) ma nem tudná közvetlenül bekötni a rendszert. A tapasztalatom szerint épp ez az a pont, ahol a legtöbb hasonló rendszer elhasal egy komoly átvilágításon: a belső mérés jó, de a külső integráció hiányzik.
3. Költség: mit mérek és mit kontrollálok
A költség egy AI-rendszernél nem mellékes tétel, hanem az egyik fő kockázat, mert nem fix. A token-felhasználás kumulatív: minél hosszabb egy munkamenet, annál drágább minden újabb lépés, a bővülő kontextus miatt. A rendszerem ügynökönként dollárban becsli a költséget, a használt modell és a gyorsítótár-találatok figyelembevételével, mert a kettő között akár tízszeres különbség is lehet. A legfontosabb kontroll viszont nem a mérés, hanem a megelőzés: egy figyelő valós időben követi a kontextus növekedését, és amikor az elér egy küszöböt, proaktívan átadja a munkát egy friss munkamenetnek, mielőtt a költség elszállna. Ezt egészíti ki egy külön őr, amely a túl nagyra hízott munkameneteket tömöríti.
Amit egy pénzügyi vezető ezen felül elvárna, abból a küszöb-alapú, tenantonkénti budget-riasztás időközben elkészült, de automatikus költségplafon, amely magától megállítaná a rendszert egy kereten túl, még nincs, és historikus költség-trend vagy előrejelzés sem. Vagyis a jelenlegi eszközök a költség elszállását futásidőben előzik meg, ami a legfontosabb, de a klasszikus pénzügyi kontrolling, a keret, az attribúció ügyfél és feladat szintjén, az előrejelzés, még nem áll össze egyetlen képbe. Ez a következő természetes fejlesztési irány.
4. Terheléselosztás: hogyan bírja a terhet
A terheléskezelésnél a rendszer a prioritásra épít. A munkát két külön munkavégző sáv kezeli, gyors és lassú útvonalra osztva, hogy egy hosszú feladat ne fogja fel a gyors válaszokat. Minden állandó ügynök a saját, izolált környezetében fut, amit egy korábbi ütközés tanulsága formált ilyenné, és a folyamatokat egy felügyeleti mechanizmus tartja életben, egy független időzítő pedig figyeli, ha egy csatorna elakadna. Ez a felállás egyetlen gépen megbízhatóan és kiszámíthatóan működik.
A korlát is innen ered. A rendszer ma nem skálázódik vízszintesen, vagyis nem lehet egyszerűen több gép között szétteríteni, mert az adattároló architektúrája ezt nem engedi. Nincs automatikus kapacitásbővítés, és nincs technikai szintű védelem az ellen, hogy egy nagyon aktív ügyfél elvigye az erőforrást a többi elől, ez ma inkább a prioritás-kezelésen múlik, mint kikényszerített elkülönítésen. Őszintén: ez a réteg egy egygépes, megbízható működésre van hangolva, a valódi több-ügyfeles, nagy volumenű skálázás egy külön, komolyabb architekturális lépés lenne.
5. Az üzemeltethetőségi kép egyben
Az alábbi táblázat összefoglalja, hol tartok a három pillér leglényegesebb elvárásainál. Ugyanaz az elv, mint az első részben: nem pontozok, hanem megmondom, mi éles, mi részleges, és mi hiányzik.
| Elvárás | Pillér | Állapot a rendszeremben |
|---|---|---|
| Token- és erőforrás-mérés | Monitorozás | Éles: ügynökönként és munkamenetenként, valós idejű + összegző |
| Munka- és folyamat-felügyelet | Monitorozás | Éles: közös állapottábla, eszközhívás-napló, folyamat-életesség |
| Elosztott nyomkövetés (tracing) | Monitorozás | Éles: OTLP push-export, a nyomvonalak Tempo-ba, a metrikák Prometheus-ba, tenant-azonosítóval és MCP-korrelációs attribútumokkal |
| Riasztás és SLA-figyelés | Monitorozás | Hiányzik: nincs automatikus riasztás, nincs SIEM-integráció |
| Per-ügynök költség-becslés | Költség | Éles: modell- és gyorsítótár-tudatos dolláros becslés |
| Proaktív költségvédelem | Költség | Éles: kontextus-figyelő átadás + munkamenet-tömörítés |
| Budget-plafon és előrejelzés | Költség | Hiányzik: nincs automata keret, trend vagy forecast |
| Prioritásos terheléskezelés | Skálázás | Éles: gyors/lassú sáv, izolált környezet, folyamat-felügyelet |
| Vízszintes skálázás / autoscaling | Skálázás | Hiányzik: egygépes, az adattároló architekturális korlátja miatt |
6. Őszinte mérleg
A kép itt más, mint az első résznél. A megfelelésben az alap erős volt, néhány pontos réssel. Az üzemeltethetőségben a belső képességek, a mérés és a proaktív költségvédelem, kifejezetten erősek, a hiányok viszont mind egy irányba mutatnak: a külső világ felé. A külső metrika- és nyomvonal-gyűjtő most már éles, OpenTelemetry-protokollon a nyomvonalak Tempo-ba, a metrikák Prometheus-ba mennek. Ami hiányzik: nincs vállalati napló-integráció egy biztonsági műveleti központ (SOC) felé, nincs automatikus riasztás és keret, és nincs több gép közötti skálázás. Ez nem véletlen: a rendszer ma egy megbízható, egygépes, jól megfigyelhető működésre van optimalizálva, és a következő szint pont az lenne, hogy ezt a belső érettséget kivezessük a szabványos vállalati eszközök felé.
Ez itt is saját, önállóan továbbfejlesztett rendszeren végzett elemzés, nem termékbejelentés. A számok és a mechanizmusok, amikről írok, a rendszer valós működéséből származnak, a hiányokat is beleértve. A célom az önismeret, nem a marketing.
A következő részben a szabványosodás felé fordulok: az agentic rendszerek épp most alakuló közös nyelvéhez, az eszközök egységes kezeléséhez (MCP), a nyomonkövetés szabványához (OpenTelemetry) és az emberi felügyelet bevett mintáihoz (human-in-the-loop). Megnézem, ezekből mit hoz már most a rendszerem, és hol illeszkedik a formálódó iparági irányokhoz. Mert ami ma egyedi megoldás, azt holnap a szabvány fogja számonkérni.
Van kérdésed, vagy beszélgetnél a témáról? Írj emailben: info@jonasgergo.hu, vagy keress meg LinkedInen.
English version
In the previous part of the series I wrote about compliance: the regulatory expectations without which an AI agent system cannot even step into a serious enterprise environment. Compliance, however, is only the entry ticket. What decides afterwards whether a system can really be integrated into an enterprise environment is day-to-day operability: can I see what happens inside it, do I know what it costs, and can it bear the load without one customer taking resources away from another. This part is about these three questions, and I look at my own system as honestly as in the first: what is live, what is partial, and what is still missing.
- Security and compliance: GDPR, NIS2, EU AI Act (9 September)
- Operability: monitoring, cost, load balancing (this part, 11 September)
- Standardisation: MCP, OpenTelemetry, human-in-the-loop (13 September)
- Summary and the envisioned enterprise development directions (15 September)
1. Why operability is the second gate
An enterprise operator does not sleep soundly because the system is secure in theory, but because when something goes wrong, they can see what is happening and can step in. With an AI agent system this question is sharper than with traditional software, because the behaviour of agents is not deterministic and their cost is not fixed: the same task is cheap one time and, when an agent's reasoning spirals out of control, many times more expensive the next. That is why I look at operability from three angles: can I see the system, do I control its cost, and can it bear the load.
2. Monitoring: what I can see of the system
Measurement is the area where my system is strongest. I track the token consumption of every agent, per agent and per session, in two layers: in real time a watcher records the current state, and a summary run every few minutes gives the exact picture, filtering out duplicates. On a shared status board I can see at any time which agent is busy with what. Every agent tool call is logged, and so is the result of every security gate, on the principle that these gates fail closed. Following the lesson of an earlier outage, I also separately watch whether each worker process is alive.
I do not sugarcoat the gaps, though. Distributed tracing, that is, being able to follow the path of a request through the components, is live by now: the standard structure is in place, and I send the traces to an external collector (Tempo) over the OpenTelemetry protocol and the metrics to a Prometheus-compatible backend, stamping every request with a tenant identifier and with the correlation attributes of MCP calls. There is no automatic alerting, though: if a value spikes, I have to notice it myself today; no system alerts me. And there is no enterprise log integration, so a security operations centre (SOC) could not plug the system in directly today. In my experience this is exactly the point where most similar systems fail a serious due-diligence review: the internal measurement is good, but the external integration is missing.
3. Cost: what I measure and what I control
Cost is not a side item in an AI system but one of the main risks, because it is not fixed. Token consumption is cumulative: the longer a session, the more expensive every further step, because of the growing context. My system estimates the cost in dollars per agent, taking the model used and the cache hits into account, because there can be up to a tenfold difference between the two. The most important control, however, is not measurement but prevention: a watcher follows the growth of the context in real time, and when it reaches a threshold, it proactively hands the work over to a fresh session before the cost runs away. A separate guard complements this by compressing sessions that have grown too large.
A finance lead would expect more than that. The threshold-based, per-tenant budget alert has meanwhile been built, but an automatic cost ceiling that would stop the system by itself beyond a limit does not exist yet, nor does a historical cost trend or a forecast. That is, the current tools prevent cost from running away at runtime, which is the most important thing, but classic cost management (budgeting, attribution by customer and task, forecasting) has not yet come together in a single picture. This is the next natural direction of development.
4. Load balancing: how it bears the load
For load handling the system builds on priority. The work is handled by two separate worker lanes, split into a fast and a slow route, so that a long task does not tie up the fast responses. Every permanent agent runs in its own isolated environment, which was shaped this way by the lesson of an earlier clash, and the processes are kept alive by a supervision mechanism, while an independent timer watches whether a channel might get stuck. This setup works reliably and predictably on a single machine.
The limit comes from the same place. Today the system does not scale horizontally, that is, it cannot simply be spread across several machines, because the architecture of the data store does not allow it. There is no automatic capacity expansion, and there is no technical protection against one very active customer taking resources away from the others; today this depends more on priority handling than on enforced separation. Honestly: this layer is tuned for reliable single-machine operation, and genuine multi-customer, high-volume scaling would be a separate, more serious architectural step.
5. The operability picture at a glance
The table below summarises where I stand on the most essential expectations of the three pillars. The same principle as in the first part: I do not score, I say what is live, what is partial, and what is missing.
| Expectation | Pillar | Status in my system |
|---|---|---|
| Token and resource measurement | Monitoring | Live: per agent and per session, real-time plus summary |
| Job and process supervision | Monitoring | Live: a shared status board, a tool-call log, process liveness |
| Distributed tracing | Monitoring | Live: OTLP push export, traces to Tempo, metrics to Prometheus, with a tenant identifier and MCP correlation attributes |
| Alerting and SLA monitoring | Monitoring | Missing: no automatic alerting, no SIEM integration |
| Per-agent cost estimate | Cost | Live: a model- and cache-aware estimate in dollars |
| Proactive cost protection | Cost | Live: handover by the context watcher plus session compression |
| Budget ceiling and forecast | Cost | Missing: no automatic budget, trend or forecast |
| Priority-based load handling | Scaling | Live: a fast and a slow lane, an isolated environment, process supervision |
| Horizontal scaling / autoscaling | Scaling | Missing: a single machine, because of an architectural limit of the data store |
6. An honest scorecard
The picture here is different from the first part. In compliance the foundation was strong, with a few precisely located gaps. In operability the internal capabilities, the measurement and the proactive cost protection, are decidedly strong, but the gaps all point in one direction: towards the outside world. The external metric and trace collector is now live: over the OpenTelemetry protocol, traces go to Tempo and metrics go to Prometheus. What is missing: there is no enterprise log integration towards a security operations centre (SOC), no automatic alerting and budget, and no scaling across several machines. This is no accident: today the system is optimised for reliable, single-machine, well-observable operation, and the next level would be exactly to carry this internal maturity out to standard enterprise tools.
This too is an analysis done on my own system, which I have developed further on my own, not a product announcement. The figures and mechanisms I write about come from the real operation of the system, gaps included. My aim is self-knowledge, not marketing.
In the next part I turn to standardisation: the common language of agentic systems that is just taking shape, the uniform handling of tools (MCP), the standard for traceability (OpenTelemetry) and the established patterns of human oversight (human-in-the-loop). I look at how much of these my system already delivers, and where it fits the industry directions now forming. Because what is a bespoke solution today, the standard will demand tomorrow.
Do you have a question, or would you like to talk about the topic? Write to me by email: info@jonasgergo.hu, or find me on LinkedIn.