Modern applications are built from many small services that work together. In these systems, an API gateway plays a key role in routing requests, balancing the load, and processing events. Most API gateways use fixed rules that do not change with shifting workloads, causing delays as high-priority events may be blocked by less critical tasks. In this paper, we propose a new method that uses reinforcement learning to create adaptive API gateways. Our system learns from real-time performance data such as CPU usage, memory usage, event latency, arrival rates of high-priority events, and throughput of low-priority events. By using multiple metrics, the system adjusts its settings to respond to changing conditions. It processes high-priority events immediately while grouping low-priority events into batches for efficient processing. We use the Proximal Policy Optimization (PPO) algorithm because it is stable and effective for learning the best settings. We evaluated our method using simulations that mimic real-world conditions. The results show that our approach reduces the delay for high-priority events by about 41% and significantly lowers the delay for low-priority events. The system also uses fewer resources than rule-based gateways. These improvements demonstrate that considering multiple performance metrics can lead to smarter, more adaptive API gateways. Our approach adapts very quickly to varying workloads, ensuring remarkably reliable operation during sudden spikes. Our work shows that reinforcement learning can improve API gateway performance for modern applications. This is important for fields such as finance, healthcare, and emergency systems, where fast and reliable responses are critical.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Adaptive Event Processing in API Gateways: A Reinforcement Learning Approach for Optimizing Latency and Throughput

  • Mohammadmahdi Ghobadi,
  • Renee Bryce

摘要

Modern applications are built from many small services that work together. In these systems, an API gateway plays a key role in routing requests, balancing the load, and processing events. Most API gateways use fixed rules that do not change with shifting workloads, causing delays as high-priority events may be blocked by less critical tasks. In this paper, we propose a new method that uses reinforcement learning to create adaptive API gateways. Our system learns from real-time performance data such as CPU usage, memory usage, event latency, arrival rates of high-priority events, and throughput of low-priority events. By using multiple metrics, the system adjusts its settings to respond to changing conditions. It processes high-priority events immediately while grouping low-priority events into batches for efficient processing. We use the Proximal Policy Optimization (PPO) algorithm because it is stable and effective for learning the best settings. We evaluated our method using simulations that mimic real-world conditions. The results show that our approach reduces the delay for high-priority events by about 41% and significantly lowers the delay for low-priority events. The system also uses fewer resources than rule-based gateways. These improvements demonstrate that considering multiple performance metrics can lead to smarter, more adaptive API gateways. Our approach adapts very quickly to varying workloads, ensuring remarkably reliable operation during sudden spikes. Our work shows that reinforcement learning can improve API gateway performance for modern applications. This is important for fields such as finance, healthcare, and emergency systems, where fast and reliable responses are critical.