1 Introduction

Serverless computing, especially Function-as-a-Service (FaaS), has become increasingly attractive for edge and fog environments due to its promise of auto-scaling, low management overhead, and event-driven elasticity. Edge computing pushes computation closer to data and users, reducing network latency, improving responsiveness, and alleviating cloud bandwidth [1]. However, resource constraints at the edge (limited CPU, memory, energy) and heterogeneity among nodes pose serious challenges for traditional centralized scheduling models [2, 3]. In addition, privacy concerns or network unreliability often limit the possibility of aggregating raw execution data centrally, making local, collaborative or federated approaches more appealing [4, 5]. Furthermore, dynamic workloads, heterogeneity of hardware (different CPU speeds, memory, energy profiles), and variable network conditions complicate optimization in terms of both latency and energy consumption [6, 7].

Despite a number of recent works addressing scheduling in serverless edge and edge-cloud continuum, several gaps remain. Many existing energy-aware scheduling schemes focus on centralized or semi-centralized architectures, relying on a global controller that collects system state and makes scheduling decisions. Such approaches suffer from single points of failure, scalability bottlenecks, and communication overhead [8, 9].

Profiling and resource estimation are often done offline or assume homogeneous hardware, leading to suboptimal performance in heterogeneous or privacy-constrained settings [10, 11]. Load balancing often considers only CPU, memory, or network latency in isolation; seldom do methods integrate energy cost, node battery or power usage, and the long-term effects of scheduling decisions on hotspots or overloaded nodes [12]. Function orchestration across nodes (i.e., deciding not only “which node to place the task on”, but also when and how tasks are coordinated, e.g., bidding, consensus, or auction-based mechanisms) is relatively less explored in serverless edge environments with joint energy, latency, and load constraints [13,14,15]. Additionally, distributed or federated learning has been applied in some works, but often only for latency prediction (or resource usage), without jointly modeling energy, and is rarely integrated into the scheduling and orchestration loop.

These gaps indicate that a fully decentralized approach integrating federated resource modeling for both latency and energy, distributed task placement, dynamic bidding, node status awareness (CPU, memory, energy), and consensus-based fairness across heterogeneous edge nodes remains insufficiently explored in the literature.

To overcome these challenges, there is a need for a scheduling framework that decentralizes control to avoid single points of failure and improve scalability across edge nodes. Federated resource modeling enables nodes to locally estimate latency and energy consumption while sharing only model updates to preserve privacy and reduce communication overhead. Load-aware scheduling ensures that tasks are allocated based on current resource availability to prevent hotspots and improve system balance.

Dynamic cost-aware bidding mechanisms allow nodes to express execution preferences, enabling efficient multi-criteria optimization. Node status awareness (battery, CPU, memory) ensures energy-efficient orchestration, while distributed consensus mechanisms guarantee robust and fair scheduling decisions under failures or adversarial conditions.

In this paper, we propose BalanceFaaS, a decentralized load- and energy-aware serverless scheduling framework using federated resource modeling and distributed function orchestration. The key features of the BalanceFaaS framework include Federated Multi-Objective Gaussian Process Regression (FMOGPR), a federated learning-based regression model that jointly predicts latency and energy consumption across heterogeneous nodes while preserving data privacy through model sharing. A Decentralized Load-Aware Scheduling Algorithm (D-LASA) based on Ant Colony Optimization with Reinforcement Feedback (ACO-RF), a bio-inspired optimization mechanism in which pheromone updates are guided by both performance feedback and energy efficiency metrics, enabling adaptive and distributed task routing across edge nodes. A Combinatorial Auction-Based Bidding (CAB-B) mechanism within a Distributed Market-Based Scheduling (DMBS) framework, where nodes submit bids based on predicted execution cost, energy consumption, and resource availability, which are evaluated using Multi-Criteria Decision Analysis (MCDA), a weighted decision-making approach. A Hierarchical Context-Aware Orchestration Engine (H-CAOE) that employs Deep Q-Networks (DQN), a reinforcement learning model that learns optimal orchestration policies by mapping system states to scheduling actions through reward-driven updates, trained via Federated Reinforcement Learning (FRL) to enable distributed policy learning. A Multi-Agent Byzantine Fault-Tolerant (MA-BFT) consensus protocol enhanced with Load-Aware Weighted Voting (LA-WV), a reliability-aware voting mechanism that assigns higher influence to stable and lightly loaded nodes, ensuring robust and fault-tolerant agreement among distributed nodes.

Some of the most important contributions in this paper are as follows:

  • Federated Latency and Energy Modeling: Traditional centralized profiling methods fall short in heterogeneous and privacy-constrained edge environments. BalanceFaaS adopts a FMOGPR model to collaboratively estimate function execution latency and energy consumption across nodes without raw data sharing. Each node locally trains lightweight models and shares only model updates, preserving privacy and reducing communication overhead. FMOGPR captures both temporal variations (workload dynamics over time) and spatial heterogeneity (differences across edge nodes), enabling more accurate and context-aware predictions.

  • Distributed Load-Aware Task Placement: To ensure efficient utilization of edge resources, BalanceFaaS integrates a D-LASA based on ACO-RF. This algorithm dynamically routes serverless functions to underutilized nodes by considering CPU usage, memory availability, and I/O latency. The pheromone updates are driven by both performance feedback and energy efficiency metrics, ensuring a globally optimized but locally driven decision-making process.

  • Dynamic Resource Bidding and Cost-Aware Allocation: BalanceFaaS employs a DMBS mechanism wherein edge nodes engage in lightweight CAB-B to express their willingness to execute functions. Bids are evaluated using a MCDA approach incorporating latency, energy, and resource availability. This dynamic pricing model promotes fair resource competition, prevents overload, and adapts to volatile edge conditions.

  • Node Status-Aware Function Orchestration: To achieve fine-grained orchestration, the framework utilizes a H-CAOE that integrates DQN for policy learning. The engine continuously monitors node-level metrics (CPU, memory, battery level) and network conditions to make fine-tuned orchestration decisions. The DQN model is trained using FRL to avoid reliance on a global controller.

  • Consensus-Based Distributed Scheduling: To maintain global balance and consistency in function placement, BalanceFaaS incorporates a MA-BFT enhanced with LA-WV. This ensures that task placement decisions are made collectively by trustworthy nodes, resistant to failure or malicious behavior, and aligned with both load and energy goals.

The remainder of this paper is organized as follows: Sect.  2 reviews related work. Section  3 describes the proposed BalanceFaaS architecture and methodology. Section  4 presents the experimental setup. Section  5 discusses the results and comparative evaluation. Finally, Sect.  6 concludes the paper and outlines directions for future research.

2 Related work

Ghorbian et al. (2025) propose an energy-conscious scheduler selection framework for serverless edge computing that dynamically assigns functions based on IoT nodes’ residual energy to curtail overall energy usage and elevate service availability in heterogeneous environments. The core novelty lies in a MAPE-K control loop that continuously monitors, analyzes, plans, and executes scheduler decisions under changing energy conditions, achieving marked improvements in network uptime and reduced energy waste compared to baseline schemes. However, the framework is constrained by reliance on static workload models and lacks scalability evaluation at large deployment scales, leaving open the need for decentralized, adaptive scheduling mechanisms that respect FaaS latency requirements under volatile edge workloads [16].

Russo et al. (2024) propose a hybrid edge–cloud orchestration framework for offloading and migrating serverless functions to enhance responsiveness and load distribution across heterogeneous nodes. Their approach formulates dynamic strategies for selecting execution locations (edge or cloud) to balance latency and throughput effectively. While this work delivers valuable insights into hybrid execution decisions, its evaluation omits energy-aware scheduling baselines, and the decision logic lacks decentralization, thereby revealing a gap in energy-efficient, distributed task assignment for serverless edge environments [17].

Jin et al. (2023) propose FuncSched, a temporal-spatial characteristics based scheduling algorithm that jointly considers queuing and execution times to minimize end-to-end latency in serverless computing. It models scheduling as a multidimensional optimization, demonstrating significant responsiveness gains in cloud contexts. Nevertheless, the algorithm does not incorporate energy efficiency or decentralized consensus, emphasizing a research gap for frameworks that jointly optimize latency, load balance, and energy usage in edge-deployed serverless scenarios [18].

Carnero et al. (2023) propose latency components and resource consumption in serverless edge analytics, systematically modeling cold and warm start effects on response times in real deployments. Their analytical models elucidate latency behavior under realistic conditions. Despite offering foundational understanding, the work stops short of integrating proactive scheduling to mitigate cold start penalties under resource heterogeneity, suggesting potential for adaptive, cold-aware schedulers [19].

Russo et al. (2024) propose workload rescheduling across the cloud–edge continuum within the OSCAR serverless platform. Their results indicate that multi-tier scheduling can improve throughput in dynamic conditions. However, the focus remains on workload redistribution rather than on joint energy and load optimization, highlighting the need for multi-objective scheduling frameworks that simultaneously account for energy, latency, and load [20].

Polese et al. (2024) propose QoS-aware offloading policies for serverless functions, tailoring scheduling decisions to latency and reliability demands while navigating cloud–edge landscapes. Although user-centric QoS adaptation is well articulated, the framework does not integrate energy budgeting or decentralized resource modeling, key enablers for autonomous edge deployments facing fluctuating operational contexts [21].

faasHouse team (2024) propose faasHouse, a sustainable serverless edge computing solution with energy-aware resource scheduling framed as an online optimization problem informed by real renewable energy traces. Experimental results demonstrate substantial improvements in operational availability and throughput relative to conventional schedulers. Yet, the reliance on a centralized cluster view precludes exploration of fully decentralized consensus scheduling, underscoring a need for federated models tailored to large-scale edge networks [22].

Dankolo et al. (2025) propose a hybrid metaheuristic (FPA–TS) that combines Flower Pollination Algorithm and Tabu Search to optimize IoT resource allocation across edge–cloud environments, targeting makespan and cost reduction. While their approach is effective within simulation environments, it does not specifically address serverless function semantics or energy awareness, pointing to opportunities for embedding serverless objectives into metaheuristic search spaces [23].

Zhang et al. (2025) propose a reinforcement learning–based multi-objective scheduler that balances waiting time, energy consumption, and cost in cloud–edge systems via a deep Q-network with an adaptive reward function. The method achieves Pareto-optimal performance across composite metrics. However, its task abstraction is tailored to general workloads rather than event-driven FaaS functions, indicating potential for adaptation to serverless scheduling policies that require fine-grained latency and energy trade-offs [24].

Carnero et al. (2024) propose the design space of scheduler architectures for serverless data processing, demonstrating that architectural choices substantially influence task slowdown and resource efficiency. This architectural exploration, while insightful, does not propose specific algorithms for decentralized, energy-aware scheduling, revealing a gap for algorithm-level contributions in energy-sensitive serverless systems [25].

Zhuangbin Chen et al. (2025) propose Metronome, a differentiated delay scheduling framework that leverages online Random Forest regression to predict execution times and improve locality-aware scheduling for serverless functions. The work yields notable reductions in execution delays. Nevertheless, it omits energy metrics and decentralized coordination, motivating future research into synergistic load and energy objectives under distributed control [26].

Jiong Lou et al. (2023) propose efficient serverless function scheduling at the network edge, addressing cold starts and dynamic workloads with weighted heuristics. Their solution significantly optimizes response times. Yet, the heuristic excludes energy costs and multi-objective balancing, indicating research potential for integrated latency–energy scheduling strategies [27].

Moakhar et al. (2024) propose an efficient mechanism for function scheduling and placement in FaaS edge environments, employing many-to-one assignment strategies to minimize request completion time in mobile edge computing. While the mechanism improves allocation efficiency, it does not consider energy awareness or decentralized decision logic, leaving open issues in combined load and energy scheduler design [28].

Zhou et al. (2025) propose a reinforcement learning solution for heterogeneous serverless clusters aimed at balancing workload and performance fairness. The method achieves enhanced throughput and fairness. However, it does not explicitly target energy efficiency or federated modeling, highlighting extensions toward energy-aware, decentralized frameworks [29].

Carnero et al. (2023) propose cold start impacts and resource metrics for serverless edge IoT workloads, offering analytical models for response components. Although the study clarifies key performance factors, it lacks concrete scheduling optimization techniques that simultaneously address load, energy, and latency, motivating development of decentralized, multi-objective schedulers [19].

Chen et al. (2024) propose a resilient collaborative caching framework for multi-edge systems that integrates robust federated deep learning to enhance data availability and system reliability. Their approach focuses on mitigating edge failures and improving caching efficiency through collaborative learning among distributed nodes. However, the framework primarily addresses caching and robustness, without explicitly considering serverless function scheduling, energy-aware orchestration in heterogeneous edge environments [30].

Chen et al. (2025) propose MC-2PF, a multi-edge cooperative framework for load prediction leveraging personalized federated deep learning. The model improves prediction accuracy by adapting to heterogeneous edge devices through personalized learning strategies. Nevertheless, the work mainly focuses on load forecasting and does not incorporate real-time scheduling decisions, consensus mechanisms, or energy-aware function placement in serverless edge computing environments [31].

Chen and Yu (2023) propose intelligent offloading strategies in blockchain-based mobile crowdsensing systems using deep reinforcement learning. Their method optimizes task offloading decisions to improve system efficiency under distributed conditions. However, the study is limited to mobile crowdsensing scenarios and does not consider multi-layer serverless architectures, federated resource modeling, or auction-based scheduling mechanisms in edge-cloud environments [32].

Chen et al. (2024) propose a scalable deep reinforcement learning approach for computation offloading in blockchain-enabled mobile crowdsensing systems. The framework enhances scalability and decision-making efficiency in distributed environments. However, it does not address fine-grained function orchestration, energy-aware load balancing, or consensus-driven scheduling required in serverless edge computing systems [33]. The comparative analysis of recent works relevant to serverless scheduling and energy-aware orchestration is summarized in Table 1.

Table 1 Comparative analysis of related works on serverless scheduling and energy-aware orchestration

Despite the promising advances summarized in Table I, several critical gaps remain unaddressed in state-of-the-art serverless scheduling and orchestration for edge environments. First, most existing methods continue to rely on centralized profiling or partial global controllers, which introduces single points of failure and limits scalability under highly dynamic edge conditions. Even approaches using reinforcement learning or auction-based mechanisms ([16,17,18,19]) often lack privacy-preserving resource modeling, forcing nodes to expose sensitive operational data or compromising adaptability to heterogeneous execution contexts. Second, energy–latency trade-offs are frequently oversimplified, focusing on static heuristics or single-metric optimization without integrating multi-objective decision-making under real-world volatility. Third, dynamic resource bidding and fairness mechanisms are underexplored in decentralized environments, leading to inefficient or unfair task placement under burst workloads. Furthermore, consensus protocols used in previous works are either absent or not tailored to load-aware decision-making, making them vulnerable to malicious nodes or inconsistent states. Finally, orchestration engines in prior studies often lack fine-grained, context-aware adaptation that accounts for CPU, memory, battery, and network fluctuations simultaneously, which is vital for resilient and sustainable serverless edge deployments.

The significance of BalanceFaaS lies in its ability to combine federated learning, decentralized optimization, dynamic bidding, and resilient consensus within a unified architecture. This synergy not only mitigates energy hotspots and latency spikes but also ensures fair, scalable, and privacy-preserving orchestration in heterogeneous and volatile edge environments an achievement that prior works have not fully realized. By bridging these gaps, BalanceFaaS positions itself as a next-generation framework for sustainable and high-performance serverless computing at the network edge.

3 Proposed framework: BalanceFaaS

This section introduces the BalanceFaaS architecture, a decentralized load and energy-aware serverless scheduling framework designed to optimize function placement, energy efficiency, and resource utilization across heterogeneous edge environments. Figure 1 illustrates the high-level architecture of BalanceFaaS.

The architecture is composed of five interdependent layers: (1) Edge Node Sensing and Monitoring Layer, (2) Federated Resource Modeling Layer, (3) Distributed Scheduling and Bidding Layer, (4) Consensus and Coordination Layer, and (5) Function Execution and Feedback Layer. Each layer performs specialized tasks while exchanging contextual information to enable adaptive and privacy-preserving orchestration.

At the foundation, each edge node is equipped with lightweight agents responsible for real-time monitoring of CPU utilization, memory consumption, I/O latency, battery level, and network bandwidth. These agents preprocess measurements locally to reduce communication overhead. Nodes maintain sliding windows of historical performance to capture temporal dynamics. This local monitoring ensures that BalanceFaaS reacts swiftly to rapid changes in resource availability or workload bursts.

The monitored data is utilized by the Federated Multi-Objective Gaussian Process Regression (FMOGPR) model to collaboratively predict latency and energy consumption across distributed nodes without sharing raw data. Nodes independently train lightweight Gaussian Process (GP) models and periodically exchange model updates to refine global predictions, enabling adaptive and privacy-preserving resource estimation in heterogeneous environments.

Fig. 1
Fig. 1
Full size image

BalanceFaaS architecture

Once resource predictions are available, scheduling decisions are made in a fully decentralized manner using two key mechanisms:

  • The Decentralized Load-Aware Scheduling Algorithm (D-LASA) with ACO-RF: Each node acts as an agent in an Ant Colony Optimization (ACO) paradigm, where virtual pheromone trails represent potential scheduling choices. Reinforcement signals, based on observed performance (latency and energy), continuously update pheromone levels to favor efficient routes. D-LASA considers multiple parameters such as CPU load, memory, predicted energy consumption, and network latency ensuring tasks are placed on nodes with sufficient resources without overloading them.

  • The Combinatorial Auction-Based Bidding (CAB-B) with MCDA Analysis: When multiple nodes compete to execute high-value or urgent functions, CAB-B is triggered. Nodes place dynamic bids representing their willingness to execute a function based on predicted cost, energy usage, and latency. The MCDA mechanism evaluates these bids using a weighted scoring function over latency, energy consumption, and resource availability to select the most suitable node. This approach introduces market-based fairness and allows nodes to adjust dynamically to volatile workload patterns.

These mechanisms operate in parallel to ensure efficient and balanced task allocation under dynamic edge conditions.

To maintain global consistency across a decentralized network, BalanceFaaS integrates a Multi-Agent Byzantine Fault-Tolerant Consensus Protocol (MA-BFT) enhanced with Load-Aware Weighted Voting (LA-WV). Each node contributes to consensus proportional to its reliability, historical performance, and current load. The LA-WV adjustment ensures that lightly loaded and historically trustworthy nodes exert greater influence in decision-making, preventing malicious or overloaded nodes from skewing outcomes. MA-BFT tolerates node failures and adversarial behavior while ensuring that function placement decisions remain consistent, reliable, and resilient across distributed nodes.

Once tasks are placed, selected nodes execute serverless functions within lightweight container runtimes such as Docker, using minimal startup latency. During and after execution, nodes report performance feedback including actual latency, energy consumption, and resource utilization back to the scheduling and modeling layers. This feedback closes the optimization loop, improving future predictions in FMOGPR and pheromone updates in D-LASA. BalanceFaaS also maintains execution logs for auditability and to support rollback or replication strategies in case of failures.

The Hierarchical Context-Aware Orchestration Engine (H-CAOE) leverages Deep Q-Networks (DQN) trained via Federated Reinforcement Learning (FRL) for adaptive policy optimization, enabling distributed decision-making across nodes without centralizing sensitive data and improving scalability under dynamic edge conditions.

3.1 Edge node sensing and monitoring layer

The Edge Node Sensing and Monitoring Layer serves as the foundation of the BalanceFaaS architecture, responsible for real-time monitoring, local preprocessing, and contextual data preparation at each edge node. This layer ensures that subsequent federated modeling and scheduling stages have accurate, up-to-date metrics. The primary objective is to provide fine-grained, temporally-aware observations of CPU utilization, memory consumption, I/O latency, battery level, and network bandwidth while minimizing communication overhead.

To achieve this, we adopt a Sliding Window Adaptive Sensing Algorithm (SWASA). SWASA continuously collects node-level metrics over a fixed time window W and applies Exponentially Weighted Moving Averages (EWMA) to smooth out short-term fluctuations. This ensures robust and noise-resistant metric estimation suitable for heterogeneous edge nodes.

CPU utilization estimation: Let \(\:{C}_{n}\left(t\right)\) denote the CPU utilization of node \(\:n\) at time \(\:t\). Using a sliding window of length \(\:W\), the smoothed utilization is calculated as Eq. 1:

$$\:{\stackrel{\sim}{C}}_{n}\left(t\right)=\alpha\:\cdot\:{C}_{n}\left(t\right)+\left(1-\alpha\:\right)\cdot\:\frac{1}{W}\:\sum\:_{i=t-W}^{t-1}{C}_{n}\left(i\right)$$
(1)

Where \(\:{\stackrel{\sim}{C}}_{n}\left(t\right)\) is Smoothed CPU utilization at time \(\:t\), \(\:{C}_{n}\left(t\right)\) is Raw CPU utilization at time \(\:t\), \(\:\alpha\:\in\:\left[\text{0,1}\right]\) are EWMA smoothing factor, and \(\:W\) is Sliding window size.

Memory utilization estimation: Memory consumption \(\:{M}_{n}\left(t\right)\)is normalized by node capacity \(\:{M}_{n}^{cap}\) using Eq. 2:

$$\:{\stackrel{\sim}{M}}_{n}\left(t\right)=\frac{{M}_{n}\left(t\right)}{{M}_{n}^{cap}}+\beta\:\cdot\:\frac{1}{W}\sum\:_{i=t-W}^{t-1}\frac{{M}_{n}\left(i\right)}{{M}_{n}^{cap}}$$
(2)

Where \(\:{M}_{n}\left(t\right)\:\)is Smoothed normalized memory utilization, \(\:\beta\:\in\:\left[\text{0,1}\right]\) is memory smoothing coefficient, and \(\:{M}_{n}^{cap}\) is Total memory capacity of node \(\:n\).

I/O latency estimation: I/O latency \(\:{L}_{n}\left(t\right)\)is dynamically estimated using a weighted moving average by Eq. 3:

$$\:{\stackrel{\sim}{L}}_{n}\left(t\right)=\gamma\:\cdot\:{L}_{n}\left(t\right)+\left(1-\gamma\:\right)\cdot\:{\stackrel{\sim}{L}}_{n}\left(t-1\right)$$
(3)

Where \(\:{L}_{n}\left(t\right)\) is Measured I/O latency at time \(\:t\), and \(\:\gamma\:\) is smoothing factor for latency.

Battery level dynamics: Battery level \(\:{B}_{n}\left(t\right)\) is updated using energy consumption \(\:{E}_{n}\left(t\right)\) and recharging rate \(\:{R}_{n}\left(t\right)\) by Eq. 4:

$$\:{B}_{n}\left(t+1\right)={B}_{n}\left(t\right)-{E}_{n}\left(t\right)\cdot\:\varDelta\:t+{R}_{n}\left(t\right)\cdot\:\varDelta\:t$$
(4)

Where \(\:{B}_{n}\left(t\right)\) is Battery percentage at time \(\:t\), \(\:{E}_{n}\left(t\right)\) is instantaneous energy consumption, \(\:{R}_{n}\left(t\right)\) is Recharging rate (if connected to power source), and \(\:\varDelta\:t\) is Time step interval.

Network bandwidth monitoring: Let \(\:{BW}_{n,m}\left(t\right)\) denote the available bandwidth between node \(\:n\) and node \(\:m\) by Eq. 5:

$$\:B{\stackrel{\sim}{W}}_{n,m}\left(t\right)=\frac{1}{W}\sum\:_{i=t-W}^{t-1}{BW}_{n,m}\left(i\right)$$
(5)

Where \(\:B{\stackrel{\sim}{W}}_{n,m}\left(t\right)\:\) is Smoothed bandwidth estimate.

Composite node health index: Finally, all metrics are aggregated into a composite node health index \(\:{H}_{n\left(t\right)}\), which serves as the primary input to subsequent layers. The \(\:{H}_{n\left(t\right)}\) calculated by Eq. 6:

$$ \begin{aligned} \:H_{n} \left( t \right) = & w_{c} \cdot \:\left( {1 - \mathop C\limits^{\sim } _{n} \left( t \right)} \right) + w_{m} \cdot \left( {1 - \mathop M\limits^{\sim } _{n} \left( t \right)} \right) \\ & + w_{l} \cdot \:\left( {1/\mathop L\limits^{\sim } _{n} \left( t \right)} \right) + w_{b} \cdot \:B_{n} \left( t \right) + w_{{bw}} \cdot \:B\mathop W\limits^{\sim } _{n} \left( t \right) \\ \end{aligned} $$
(6)

Where \(\:{w}_{c},{w}_{m},{w}_{l},{w}_{b},{w}_{bw}\) are normalized weighting coefficients for CPU, memory, latency, battery, and bandwidth respectively. \(\:B{\stackrel{\sim}{W}}_{n}\left(t\right)=\:\frac{1}{\left|\mathcal{N}\right|}{\sum\:}_{m\in\:\mathcal{N}}B{\stackrel{\sim}{W}}_{n,m}\left(t\right)\:\)is average bandwidth to neighbor nodes and \(\:{H}_{n}\left(t\right)\in\:\left[\text{0,1}\right]\) quantifies overall node suitability for task execution.

3.2 Federated resource modeling layer

The Federated Resource Modeling Layer provides predictive insights on function execution latency and energy consumption across heterogeneous edge nodes while preserving node-level privacy. Unlike centralized profiling, this layer uses FMOGPR, which allows nodes to collaboratively estimate performance metrics without sharing raw workload or node data. This layer is critical for context-aware and energy-efficient scheduling in the decentralized BalanceFaaS framework.

The FMOGPR integrates temporal dynamics, spatial variance across nodes, and multiple optimization objectives (latency and energy), ensuring predictions remain accurate under volatile workloads and heterogeneous hardware.

Local node GP model: Each edge node \(\:n\) maintains a local multi-objective GP model for function execution latency \(\:\mathcal{l}\) and energy as Eq. 7:

$$\:\left[\begin{array}{c}{\mathcal{l}}_{n}\left(\text{{\rm\:X}}\right)\\\:{e}_{n}\left(\text{{\rm\:X}}\right)\end{array}\right]\sim\mathcal{G}p\left({\varvec{m}}_{n}\left(x\right),{K}_{n}\left(x,x{\prime\:}\right)\right)$$
(7)

Where \(\:x\in\:{\mathbb{R}}^{d}\) is input feature vector capturing node metrics (CPU, Memory, I/O, Battery, Bandwidth) and function characteristics (size, execution complexity), \(\:{m}_{n}\left(x\right)\) is mean function (can be zero or linear), and \(\:{K}_{n}\left(x,x{\prime\:}\right)\) Is covariance (kernel) matrix representing correlations between inputs.

Radial Basis Function (RBF) kernel for spatial and temporal variance: We employ a RBF kernel to capture similarity across inputs and time that show in Eq. 8:

$$\:{K}_{n}\left({\mathbf{x}}_{i}\:,{\mathbf{x}}_{j}\right)={\sigma\:}_{f}^{2}\:\text{e}\text{x}\text{p}\left({-\frac{1}{2}\left({\mathbf{x}}_{i}-{\mathbf{x}}_{j}\right)}^{T}{\varvec{\Lambda\:}}^{-1}\left({\mathbf{x}}_{i}-{\mathbf{x}}_{j}\right)\right)+{\sigma\:}_{n}^{2}{\delta\:}_{ij}$$
(8)

Where \(\:{\sigma\:}_{f}^{2}\) is signal variance, \(\:\varLambda\:\) is diagonal matrix of length-scales for each feature, \(\:{\sigma\:}_{n}^{2}\) is noise variance, and \(\:{\delta\:}_{ij}\:\)is Kronecker delta.

Federated aggregation of GP Hyperparameters: Each node shares hyperparameter updates instead of raw data. Let \(\:{\theta\:}_{n}=\left\{{\sigma\:}_{f}^{2},\varLambda\:,{\sigma\:}_{n}^{2}\right\}n\) be the local GP Hyperparameters. Federated aggregation is performed as Eq. 9:

$$\:{\theta\:}_{\text{g}\text{l}\text{o}\text{b}\text{a}\text{l}}=\frac{1}{N}\sum\:_{n=1}^{N}{\theta\:}_{n}$$
(9)

Where \(\:{\theta\:}_{global}\) is global Hyperparameters, and \(\:N\) is total number of participating edge nodes.

Prediction for latency and energy: Given a new input \(\:{x}_{*}\) the predicted mean and variance for latency and energy are calculated by Eq. 10:

$$ \begin{gathered} \:\widehat{{\text{y}}}\left( {{\text{x}}^{{\text{*}}} } \right) = \left[ {\begin{array}{*{20}c} {\widehat{\ell }} & {\:\left( {{\text{x}}^{{\text{*}}} } \right)} \\ {\:\hat{e}} & {\left( {{\text{x}}^{{\text{*}}} } \right)} \\ \end{array} } \right] = K^{{{\text{*T}}}} \:{\text{K}}^{{ - 1}} {\text{y}},\:\: \hfill \\ {\text{Var}}\left[ {{\text{y}}\left( {\text{x}} \right)} \right] = K^{{{\text{**}}}} - K^{{\text{T}}} {\text{K}}^{{ - 1}} K^{{\text{*}}} \hfill \\ \end{gathered} $$
(10)

Where \(\:{K}_{*}\) is covariance vector between \(\:{x}_{*}\:\)and training points, \(\:K\) is covariance matrix of training points, and \(\:y\) is vector of observed latency and energy at node \(\:n\).

Multi-Objective optimization: The node fitness for scheduling combines normalized predictions for latency and energy calculated by Eq. 11:

$$\:{F}_{n}\left({\text{x}}_{*}\right)={\omega\:}_{\mathcal{l}}\frac{{\widehat{\mathcal{l}}}_{n}\left({\text{x}}_{*}\right)}{{\mathcal{l}}_{\text{m}\text{a}\text{x}}}+{\omega\:}_{e}\frac{{\widehat{e}}_{n}\left({\text{x}}_{*}\right)}{{e}_{\text{m}\text{a}\text{x}}}$$
(11)

Where \(\:{\omega\:}_{\mathcal{l}}\:,{\omega\:}_{e}\:\) are weighting coefficients for latency and energy, and \(\:{\mathcal{l}}_{\text{m}\text{a}\text{x}}\:,{e}_{\text{m}\text{a}\text{x}}\) are maximum observed latency and energy for normalization. Nodes with smaller \(\:{F}_{n}\left({x}_{*}\right)\) are preferable for task execution.

3.3 Distributed scheduling and bidding layer

The Distributed Scheduling and Bidding Layer in BalanceFaaS ensures adaptive, decentralized task placement across heterogeneous edge nodes while optimizing latency, energy consumption, and load balancing.

This layer integrates two main mechanisms:

  • The D-LASA algorithm with ACO-RF.

  • The CAB-B with MCDA Analysis.

D-LASA intelligently routes tasks to nodes based on predicted node health and resource availability, while CAB-B ensures fair, cost-aware allocation under dynamic and competing workload conditions. Together, these mechanisms guarantee energy-efficient, low-latency scheduling in a decentralized manner.

Priority-Aware task scoring mechanism: To incorporate task urgency into the scheduling and bidding process, BalanceFaaS introduces a priority-aware scoring mechanism. Each task is assigned a priority value based on deadline urgency, resource demand, and user-defined importance.

$$\:{{\Pi\:}}_{f}=\alpha\:\cdot\:\frac{1}{{D}_{f}-t}+\beta\:\cdot\:\frac{{R}_{f}}{{R}_{max}}+\gamma\:\cdot\:{U}_{f}$$
(12)

where \(\:{\varPi\:}_{f}\) represents the priority score of task \(\:f\), \(\:{D}_{f}\) is the task deadline, \(\:t\) is the current time, \(\:{R}_{f}\) denotes resource demand, \(\:{R}_{max}\) is maximum system capacity, and \(\:{U}_{f}\) indicates user-defined priority. The weighting factors \(\:\alpha\:\), \(\:\beta\:\), \(\:\gamma\:\) control the influence of each component.

The computed priority score is incorporated into both the ACO-based transition probability (Eq. 15) and the CAB-B bidding function (Eq. 16), influencing node selection and bid evaluation.

Node pheromone update: Each node maintains a pheromone value \(\:{\tau\:}_{n}\left(t\right)\) representing its suitability for task execution at time t by Eq. 13:

$$\:{\tau\:}_{n}\left(t+1\right)=\left(1-\rho\:\right)\cdot\:{\tau\:}_{n}\left(t\right)+\varDelta\:{\tau\:}_{n}\left(t\right)$$
(13)

Where \(\:\rho\:\in\:\left[\text{0,1}\right]\) is pheromone evaporation rate, and \(\:\varDelta\:{\tau\:}_{n}\left(t\right)\)is reinforcement feedback based on observed performance. The reinforcement feedback combines multi-objective utility from latency and energy calculated by Eq. 14:

$$ \Delta \:\tau \:_{n} \left( t \right) = \eta \: \cdot \:\left( {\frac{1}{{\widehat{\ell }_{n} \left( t \right) + \in }} + \frac{1}{{\hat{e}_{n} \left( t \right) + \in }}} \right) $$
(14)

Where \(\:\eta\:\) is reinforcement scaling factor, \(\:{\widehat{\mathcal{l}}}_{n}\left(t\right)\),\(\:\:{\widehat{e}}_{n}\left(t\right)\) are predicted latency and energy from FMOGPR, and \( \in \) is small constant to avoid division by zero.

Transition probability for task assignment: The probability of assigning task \(\:f\) to node \(\:n\) is defined as Eq. 15:

$$\:{P}_{n,f}\left(t\right)=\frac{{\tau\:}_{n}{\left(t\right)}^{\alpha\:}\cdot\:{\text{H}}_{n}{\left(t\right)}^{\beta\:}}{{\sum\:}_{m\in\:\mathcal{N}}{\tau\:}_{m}{\left(t\right)}^{\alpha\:}.{\text{H}}_{m}{\left(t\right)}^{\beta\:}}$$
(15)

Where \(\:\alpha\:,\beta\:\) are influence weights for pheromone and node health,\(\:\:{H}_{n}\left(t\right)\) composite node health index (from Edge Node Sensing and Monitoring Layer), and \(\:\mathcal{N}\) is set of candidate nodes. Where task priority \(\:{\varPi\:}_{f}\) is implicitly integrated into node selection probability through workload weighting.

Combinatorial Auction Bidding (CAB-B): Each node submits a bid \(\:{b}_{n}\left(f\right)\) for executing task \(\:f\) based on predicted cost by Eq. 16:

$$\:{b}_{n}\left(f\right)={\lambda\:}_{\mathcal{l}}{\widehat{\mathcal{l}}}_{n}\left(f\right)+{\lambda\:}_{e}{\widehat{e}}_{n}\left(f\right)+{\lambda\:}_{\tau\:}\frac{{\mathcal{R}}_{n}}{{C}_{n}^{\text{a}\text{v}\text{a}\text{i}\text{l}}}$$
(16)

Where \(\:{\lambda\:}_{\mathcal{l}}\),\(\:\:{\lambda\:}_{e}\),\(\:\:{\lambda\:}_{\tau\:}\) are weights for latency, energy, and resource availability, \(\:{\mathcal{R}}_{n}\) is remaining resources (CPU, memory), \(\:{C}_{n}^{\text{a}\text{v}\text{a}\text{i}\text{l}}\) available capacity, and \(\:{\widehat{\mathcal{l}}}_{n}\left(f\right)\), \(\:{\widehat{e}}_{n}\left(f\right)\) are predicted latency and energy.

Task selection via MCDA analysis: The winner node \(\:{n}^{\text{*}}\) is selected by minimizing a weighted multi-objective cost function as Eq. 17:

$$\:{n}^{*}=\text{arg}\underset{n\in\:\mathcal{N}}{\text{max}}\left({w}_{\tau\:}\cdot\:\:{P}_{\left(n,f\right)}-{w}_{b}\cdot\:{b}_{n}\left(f\right)\right)$$
(17)

Where \(\:{w}_{\tau\:}\),\(\:\:{w}_{b}\) are weighting coefficients for ACO probability and bid cost and \(\:{b}_{n}\left(f\right)\) represents the execution cost. therefore, it is subtracted to reflect cost minimization. \(\:{P}_{\left(n,f\right)}\) denotes the normalized probability of assigning task \(\:f\) to node \(\:n\), derived from node status metrics such as CPU utilization, memory availability, and latency estimation. To ensure a unified minimization formulation, the inverse of the assignment probability \(\:{P}_{\left(n,f\right)}^{-1}\) is used. This transformation converts the maximization of assignment likelihood into a minimization objective, thereby prioritizing nodes with higher suitability for task execution. Therefore, the objective does not minimize the assignment probability; instead, it implicitly maximizes it through inverse transformation.

Load balancing constraint: To prevent node overload, each candidate node must satisfy by Eq. 18:

$$\:{\text{C}}_{n}^{used}+{C}_{f}\le\:{\text{C}}_{n}^{max},\:\:{M}_{n}^{used}+{M}_{f}\le\:{M}_{n}^{max}$$
(18)

Where \(\:{C}_{f}\), \(\:{M}_{f}\) are CPU and memory requirements of task \(\:f\), \(\:{\text{C}}_{n}^{used}\) ,\(\:\:{M}_{n}^{used}\) are current utilization, and \(\:{\text{C}}_{n}^{max}\), \(\:{M}_{n}^{max}\) are node capacity limits.

Although the Distributed Scheduling and Bidding Layer determines a preliminary winner node based on multi-objective optimization, the selection process is explicitly influenced by the task priority score \(\:{\varPi\:}_{f}\), ensuring that urgent tasks receive higher scheduling preference. However, this decision is still subject to validation in the Consensus Layer to guarantee global consistency and fault tolerance.

3.4 Consensus and Coordination layer

The Consensus and Coordination Layer ensures consistent and reliable scheduling decisions in a fully decentralized environment without task reassignment. It employs the Multi-Agent Byzantine Fault-Tolerant (MA-BFT) protocol, which enables distributed nodes to collectively validate the selected execution node while detecting Byzantine or overloaded nodes and resolving conflicts arising from concurrent scheduling decisions.

To enhance decision fairness and stability, Load-Aware Weighted Voting (LA-WV) assigns higher influence to reliable and lightly loaded nodes, ensuring that consensus outcomes remain balanced and resilient under dynamic and heterogeneous edge conditions.

Weighted node voting for consensus: Each node n casts a vote \(\:{\mathcal{v}}_{n}^{f}\in\:\left\{\text{0,1}\right\}\)for executing task \(\:f\). The weighted consensus score is computed as Eq. 19:

$$\:{S}_{f}=\frac{{\sum\:}_{n\in\:\mathcal{N}}{\mathcal{w}}_{n}.{\mathcal{v}}_{n}^{f}}{{\sum\:}_{n\in\:\mathcal{N}}{\mathcal{w}}_{n}}$$
(19)

Where \(\:{S}_{f}\) is normalized consensus score for task \(\:f\),\(\:\:{\mathcal{w}}_{n}\) is weight of node \(\:n\) based on composite health \(\:{H}_{n}\left(t\right)\) and past reliability\(\:{R}_{n}\left(t\right)\), \(\:{\mathcal{v}}_{n}^{f}\) is binary vote of node n for executing task f, and \(\:\mathcal{N}\) is set of participating nodes.

Load-Aware weight: Node weights \(\:{\mathcal{w}}_{n}\:\)are dynamically computed to favor underutilized, healthy nodes by Eq. 20:

$$\:{\mathcal{w}}_{n}=\alpha\:{H}_{n}\left(t\right)+\beta\:{R}_{n}\left(t\right)+\gamma\:\left(1-\frac{{U}_{n}\left(t\right)}{{U}_{n}^{\text{m}\text{a}\text{x}}}\right)$$
(20)

Where \(\:{H}_{n}\left(t\right)\) is composite node health index from Edge Node Sensing and Monitoring Layer, \(\:{R}_{n}\left(t\right)\) is historical reliability score of node \(\:n\) (fraction of successful task completions), \(\:{U}_{n}\left(t\right)\:\) is current utilization, \(\:{U}_{n}^{\text{m}\text{a}\text{x}}\) is maximum allowable utilization, and \(\:\alpha\:,\beta\:,\gamma\:\in\:\left[\text{0,1}\right],\alpha\:+\beta\:+\gamma\:=1\) are weighting coefficients.

Byzantine Fault-Tolerant decision rule: For consensus, a task \(\:f\) is accepted if:

$$\:{\text{T}\text{a}\text{s}\text{k}\text{A}\text{c}\text{c}\text{e}\text{p}\text{t}\text{e}\text{d}}_{f}=\left\{\begin{array}{c}1,\:\:\:\:\:\:\:{S}_{f}\ge\:\theta\:\:\\\:0\:\:\:\:\:\:\:\:\:{S}_{f}<\theta\:\end{array}\right.$$
(21)

Where \(\:\theta\:\in\:\left[\text{0.5,1}\right]\) is quorum threshold ensuring resilience against up to \( \left\lfloor {\frac{{N - 1}}{3}} \right\rfloor \) Byzantine nodes. To ensure the feasibility of the consensus process under all system conditions, an adaptive quorum mechanism is incorporated into the decision rule. In cases where no candidate task satisfies the condition \(\:{S}_{f}\ge\:\theta\:\), the quorum threshold is dynamically relaxed as Eq. 22:

$$\:{\theta\:}^{{\prime\:}}=\text{max}\left({\theta\:}_{min},\:\alpha\:\cdot\:\theta\:\right),\:\:\:\:\:\:\:\:\:\:0<\alpha\:<1$$
(22)

Where \(\:{\theta\:}_{min}=0.5\) preserves the Byzantine fault tolerance property, and \(\:\alpha\:\) is a scaling factor controlling the degree of relaxation. If no candidate still satisfies the relaxed threshold, a fallback selection is applied by choosing the task with the highest score based-on Eq. 23:

$$\:{f}^{*}=\text{arg}\underset{f}{\text{max}}{S}_{f}$$
(23)

This mechanism guarantees that the consensus process always produces a valid decision while maintaining robustness, fairness, and resilience against Byzantine or overloaded nodes in dynamic edge environments.

Weighted aggregation for conflicting decisions: If multiple candidate nodes propose conflicting task placements \(\:\{{f}_{1},\dots\:,{f}_{k}\}\), the final selection is calculated by Eq. 24:

$$\:{f}^{*}=\text{arg}\underset{{f}_{i}}{\text{max}}\sum\:_{n\in\:\mathcal{N}}{\mathcal{w}}_{n}\cdot\:{\mathcal{v}}_{n}^{{f}_{i}}$$
(24)

Where \(\:{f}^{\text{*}}\) is task assignment that maximizes weighted support. Ensures fair distribution and resilience against malicious nodes.

Consensus feedback update: Once consensus is reached, node reliability is updated by Eq. 25:

$$\:{R}_{n}\left(t+1\right)={R}_{n}\left(t\right)+{\eta\:}_{c}\cdot\:\mathbb{I}\left[{\mathcal{v}}_{n}^{f}={\text{T}\text{a}\text{s}\text{k}\text{a}\text{c}\text{c}\text{e}\text{p}\text{t}\text{e}\text{d}}_{f}\right]$$
(25)

Where \(\:{\eta\:}_{c}\) is reliability increment factor, \(\:\mathbb{I}\left[\cdot\:\right]\)is indicator function (1 if true, 0 otherwise). This feedback ensures trustworthy nodes gain more influence over time, aligning consensus decisions with node reliability and performance.

3.5 Function Execution and feedback layer

While Layers 3 and 4 focus on decision-making, the Function Execution and Feedback Layer provides a continuous learning mechanism that adapts the system over time. This layer captures real execution outcomes and updates the scheduling policy using federated reinforcement learning. Without this layer, the system would remain static and unable to adapt to dynamic workload patterns and changing resource conditions.

The Function Execution and Feedback Layer is responsible for actual execution of serverless functions on assigned edge nodes and for collecting feedback metrics to continuously improve scheduling and orchestration. This layer integrates FRL with DQN to adjust scheduling policies dynamically based on observed latency, energy consumption, and node resource utilization.

The layer closes the feedback loop in BalanceFaaS, ensuring that the predictions from FMOGPR, the scheduling decisions from D-LASA + CAB-B, and the consensus decisions from MA-BFT + LA-WV are continuously refined.

Function execution time and energy modeling: For a function \(\:f\) executed on node \(\:n\), the observed latency and energy consumption are shown in Eq. 26:

$$ \begin{gathered} \:\ell _{n}^{{{\text{obs}}}} \left( f \right) = \ell _{n}^{{{\text{base}}}} \left( f \right) \cdot \:\phi \:_{n} \left( t \right) + \in _{\ell } \hfill \\ e_{n}^{{{\text{obs}}}} \left( f \right) = e_{n}^{{{\text{base}}}} \left( f \right) \cdot \psi \:_{n} \left( t \right) + \in _{e} \hfill \\ \end{gathered} $$
(26)

Where \(\:{\mathcal{l}}_{n}^{\text{o}\text{b}\text{s}}\left(f\right)\),\(\:\:{e}_{n}^{\text{o}\text{b}\text{s}}\left(f\right)\) are observed latency and energy, \(\:{\mathcal{l}}_{n}^{\text{o}\text{b}\text{s}}\left(f\right)\), \(\:{e}_{n}^{\text{b}\text{a}\text{s}\text{e}}\left(f\right)\) are baseline execution, metrics from FMOGPR, \(\:{\phi\:}_{n}\text{}\left(t\right),{\psi\:}_{n}\text{}\left(t\right)\) are temporal scaling factors capturing current node load and network conditions, and \( \in _{\ell } , \in _{e} \) are Gaussian noise to model measurement uncertainty.

The \(\:{\mathcal{l}}_{n}^{\text{o}\text{b}\text{s}}\left(f\right)\) models the observed latency as a function of the baseline latency adjusted by a temporal scaling factor \(\:{\phi\:}_{n}\left(t\right)\), while the \(\:{e}_{n}^{\text{o}\text{b}\text{s}}\left(f\right)\:\)models the observed energy consumption using a similar formulation with scaling factor \(\:{\psi\:}_{n}\left(t\right)\). The noise terms \( \: \in _{\ell } \) and \( \in _{e} \) capture stochastic variations in execution conditions.

Reward Function for FRL (FRL-DQN): Each node computes a reward \(\:{r}_{n}\left(f\right)\) for task execution based on latency, energy, and resource utilization by Eq. 27:

$$\:{r}_{n}\left(f\right)=-\left({\omega\:}_{\mathcal{l}}\frac{{\mathcal{l}}_{n}^{\text{o}\text{b}\text{s}}\left(f\right)}{{\mathcal{l}}_{\text{m}\text{a}\text{x}}}+{\omega\:}_{e}\frac{{e}_{n}^{\text{o}\text{b}\text{s}}\left(f\right)}{{e}_{\text{m}\text{a}\text{x}}}+{\omega\:}_{u}\frac{{U}_{n}^{\text{p}\text{o}\text{s}\text{t}}\left(f\right)}{{U}_{n}^{\text{m}\text{a}\text{x}}}\right)$$
(27)

Where \(\:{\omega\:}_{\mathcal{l}},{\omega\:}_{e},{\omega\:}_{u}\in\:\left[\text{0,1}\right],{\omega\:}_{\mathcal{l}}+{\omega\:}_{e}+{\omega\:}_{u}=\)1are weights for latency, energy, and utilization, \(\:{U}_{n}^{\text{p}\text{o}\text{s}\text{t}}\) node resource utilization after task execution, and \(\:{\mathcal{l}}_{\text{m}\text{a}\text{x}},{e}_{\text{m}\text{a}\text{x}},{U}_{n}^{\text{m}\text{a}\text{x}}\) are normalization constants.

DQN update rule: The Q-value update for state \(\:{s}_{t}\) and action \(\:{\alpha\:}_{t}\) is calculated by Eq. 28:

$$ {\mathcal{Q}}_{n} \left( {s_{t} ,a_{t} } \right) \leftarrow {\mathcal{Q}}_{n} \left( {s_{t} ,a_{t} } \right) + \alpha \:\left( \begin{gathered} r_{n} \left( f \right) + \gamma \:\mathop {{\text{max}}}\limits_{{a^{{\prime {\kern 1pt} }} }} {\mathcal{Q}}_{n} \left( {s_{{t + 1}} ,a^{{\prime \:}} } \right) \hfill \\ - {\mathcal{Q}}_{n} \left( {s_{t} ,a_{t} } \right) \hfill \\ \end{gathered} \right) $$
(28)

Where \(\:\alpha\:\) is learning rate, \(\:\gamma\:\) is discount factor, \(\:{s}_{t}\) is state vector of node metrics and task features, and \(\:{\alpha\:}_{t}\) is action (accept task or reject task).

Federated aggregation of Q-Networks: Each node shares local Q-network updates instead of raw experience by Eq. 29:

$$\:{\mathcal{Q}}_{\text{g}\text{l}\text{o}\text{b}\text{a}\text{l}}=\frac{1}{N}\sum\:_{n=1}^{N}{\mathcal{Q}}_{n}$$
(29)

Where \(\:{\mathcal{Q}}_{\text{g}\text{l}\text{o}\text{b}\text{a}\text{l}}\) is federated Q-network parameters, and \(\:N\) is number of participating edge nodes.

Feedback integration for scheduling layers: The updated Q-values are fed back to:

  • D-LASA: adjust task routing probabilities \(\:{P}_{n,f}\).

  • CAB-B: refine bid computations \(\:{b}_{n}\left(f\right)\).

  • MA-BFT + LA-WV: update node reliability \(\:{R}_{n}\).

This continuous feedback loop ensures self-adaptation under dynamic workloads and heterogeneous edge environments.

In summary, Layer 3 performs local decision-making, Layer 4 ensures global agreement and robustness, and Layer 5 enables adaptive learning, making all three layers complementary rather than redundant. The Algorithm 1 presents the complete operational flow of the proposed BalanceFaaS framework, integrating all five layers from sensing to feedback.

In line 1–2, Initialize the edge nodes’ computing, memory, battery, and network metrics. Setup local FMOGPR models for latency and energy prediction. In line 3, Initialize pheromone values \(\:\tau\:\)n for ACO with Reinforcement Feedback. In line 4, Initialize reliability scores \(\:{R}_{n}\:\)for consensus layer. In line 5, Initialize local DQN models \(\:{Q}_{n}\) for FRL. In line 6, Populate the scheduler queue with pending tasks. In line 7–9, Set parameters for ACO-RF, CAB-B bidding, and MCDA scoring. In line 10, Define quorum threshold \(\:\theta\:\) for Byzantine consensus. In line 11, Set interval for federated aggregation of Q-network updates.

In line 12–13, Begin main scheduling loop and pop the next task from the queue. In line 14–19, Layer 1, Each node senses CPU, memory, battery, and I/O latency; computes health \(\:{H}_{n}\); updates node status metrics. In line 20–26, Layer 2, Each node trains local FMOGPR models; predicts latency and energy; sends model updates for federated aggregation; update global model. In line 27–38, Layer 3, Update pheromone values, compute assignment probabilities, CAB-B bids, check load constraints, compute MCDA score, select winner node, assign task, and update node resource utilization.

In line 38–51, Layer 4, Compute load-aware weighted votes, perform consensus score calculation, check quorum threshold, update node reliability, and broadcast consensus decision.

In line 56–65, Layer 5, If consensus accepts the task, execute function on winner node, measure observed latency and energy, compute reward, store experience, update local DQN with mini-batch, perform federated aggregation periodically, and send feedback to the scheduler.

In line 67, Log all task assignments, node metrics, latency, and energy metrics for auditing. In line 67–71, Monitor node failures or Byzantine behavior; Re-Queue tasks if nodes fail. In line 77, Update scheduler queue with any newly generated tasks. In line 72–73, End loop and output final task assignments, updated node metrics, and federated models.

Algorithm 1
Algorithm 1
Full size image

BalanceFaaS framework pseudocode

4 Experimental results

In this section, we present the experimental evaluation of the proposed BalanceFaaS framework. The evaluation is structured into several key subsections:

  • System Specifications: This subsection outlines the hardware and software configurations utilized in the experiments, ensuring reproducibility and transparency.

  • Evaluation Metrics: Here, we define the performance metrics employed to assess the effectiveness of the BalanceFaaS framework, including latency, energy consumption, and resource utilization.

  • Datasets: This part describes the datasets used for benchmarking, detailing their characteristics and relevance to the experiments.

  • Comparative Analysis: We provide a comparative study between BalanceFaaS and existing state-of-the-art frameworks, highlighting the improvements and advantages offered by our approach.

Each of these subsections contributes to a comprehensive understanding of the framework’s performance and its potential impact on serverless computing environments.

4.1 System specifications

Table 2, illustrate system specifications for simulation the BalanceFaaS proposed framework.

Table 2 System specifications

4.2 Datasets

To ensure a realistic and reproducible evaluation of task scheduling in edge and edge–cloud computing environments, this study employs four widely recognized real-world datasets such as Alibaba Cluster TraceFootnote 1, Google Cluster TraceFootnote 2, Azure Serverless Function TraceFootnote 3, and Smart City IoT Edge WorkloadFootnote 4 datasets.

Although Alibaba and Google cluster traces are not originally designed as Serverless workloads, they are widely adopted in the literature to emulate function-level execution patterns. In this study, each task instance is mapped to an independent Serverless function invocation, where execution latency, resource usage, and scheduling constraints are preserved.

This function-level abstraction has been widely adopted in recent Serverless and edge scheduling studies to ensure fair and scalable evaluation.

This transformation enables realistic modeling of large-scale Serverless scheduling scenarios while maintaining reproducibility and diversity of workloads.

  1. 1.

    The Alibaba Cluster Trace (2018/2020) dataset consists of large-scale production traces collected from Alibaba data centers and has been extensively used in scheduling and resource management research. It provides detailed records of job and task executions, including CPU utilization, memory consumption, disk and network usage, as well as task submission and completion timestamps. The dataset contains approximately 1.3 billion task instances with around 10–15 workload-related features, enabling comprehensive analysis of large-scale and dynamic scheduling scenarios.

  2. 2.

    The Google Cluster Trace (Borg/Kubernetes) dataset captures real scheduling behaviors observed in Google’s production clusters. It includes information on task priorities, resource requests, execution durations, and scheduling classes, comprising nearly 25 million task samples described by 12–18 features. This dataset is particularly suitable for evaluating latency-aware and hierarchical scheduling mechanisms in edge–cloud systems.

  3. 3.

    In addition, the Azure Serverless Function Trace dataset is used to represent real serverless workloads executed in distributed cloud and edge infrastructures. It records function invocation patterns, execution latencies, memory usage, and deadline constraints, covering approximately 4 million function invocations with 8–12 descriptive features, and is well suited for assessing Service-level agreement (SLA) and decentralized scheduling strategies. This dataset serves as the primary benchmark for validating the Serverless characteristics of the proposed framework.

  4. 4.

    Finally, a Smart City IoT Edge Workload dataset is employed, which contains real task traces collected from smart city deployments and edge gateways. This dataset reflects realistic IoT task generation patterns, including task sizes, generation times, processing delays, and device identifiers. It consists of approximately 1.2 million edge task samples with 6–10 features, making it appropriate for evaluating energy-efficient and latency-sensitive task scheduling at the network edge. The Smart City dataset complements the evaluation by introducing highly dynamic and latency-sensitive edge workloads, which are critical for decentralized scheduling validation.

Therefore, the combination of transformed cluster traces, native Serverless traces, and IoT edge workloads provides a comprehensive and realistic evaluation environment for decentralized Serverless scheduling.

4.3 Evaluation metrics

To comprehensively assess the performance of the proposed BalanceFaaS framework, as well as to benchmark against related works such as [34,35,36], multiple evaluation metrics are considered. These metrics capture system efficiency, energy consumption, latency, load balancing, and federated learning performance, providing a holistic view of the framework’s effectiveness in heterogeneous serverless edge environments.

Latency is a critical metric for serverless edge computing, representing the total time required for a task to complete from submission to execution. latency for a task \(\:f\) executed on node \(\:n\) can be defined as Eq. 30:

$$\:{L}_{n}\left(f\right)={T}_{\text{q}\text{u}\text{e}\text{u}\text{e}}\left(f,n\right)+{T}_{\text{e}\text{x}\text{e}\text{c}}\left(f,n\right)+{T}_{\text{c}\text{o}\text{m}\text{m}}\left(f,n\right)$$
(30)

Where \(\:{T}_{\text{q}\text{u}\text{e}\text{u}\text{e}}\left(f,n\right)\) represents the waiting time in the node’s task queue before execution, \(\:{T}_{\text{e}\text{x}\text{e}\text{c}}\left(f,n\right)\) is the actual execution time of the function f on node \(\:n\), and \(\:{T}_{\text{c}\text{o}\text{m}\text{m}}\left(f,n\right)\) denotes the communication delay incurred for data transfer to and from the node. All components are measured in seconds, and the sum provides the end-to-end task latency.

Energy consumption is evaluated to determine the efficiency of task execution with respect to node power utilization. The energy consumed for executing task f on node \(\:n\) is given by Eq. 31:

$$\:{E}_{n}\left(f\right)={P}_{CPU}\left(n\right)\cdot\:{T}_{exec}\left(f,n\right)+{P}_{mem}\left(n\right)\cdot\:{T}_{exec}\left(f,n\right)$$
(31)

Here, \(\:{P}_{CPU}\left(n\right)\:\)represents the average power consumption of the CPU of node \(\:n\) in watts, \(\:{P}_{mem}\left(n\right)\:\)denotes the power consumed by memory operations, and \(\:{T}_{exec}\left(f,n\right)\)is the execution time of task \(\:f\) on node \(\:n\). This metric provides an estimate of the total energy required for completing the function.

One of the most important metric is TSR that measures the fraction of tasks successfully executed within a deadline. TSR calculated by Eq. 32:

$$\:{S}_{rate}=\frac{{N}_{\text{s}\text{u}\text{c}\text{c}\text{e}\text{s}\text{s}}}{{N}_{\text{t}\text{o}\text{t}\text{a}\text{l}}}\times\:100$$
(32)

Where \(\:{N}_{\text{s}\text{u}\text{c}\text{c}\text{e}\text{s}\text{s}}\) indicates the number of tasks completed within the specified SLA deadline, and \(\:{N}_{\text{t}\text{o}\text{t}\text{a}\text{l}}\) denotes the total number of submitted tasks. The result is expressed as a percentage and reflects the reliability of task execution under serverless scheduling constraints.

Resource utilization quantifies how efficiently CPU and memory resources are employed during task execution. It can be expressed as Eq. 33:

$$\:{U}_{n}=\frac{{CPU}_{used}\left(n\right)}{{CPU}_{total}\left(n\right)}+\frac{{Mem}_{used}\left(n\right)}{{Mem}_{total}\left(n\right)}$$
(33)

Here, \(\:{CPU}_{used}\left(n\right)\) and \(\:{Mem}_{used}\left(n\right)\:\)are the actual CPU and memory resources consumed by all tasks on node \(\:n\), while \(\:{CPU}_{total}\left(n\right)\) and \(\:{Mem}_{total}\left(n\right)\) represent the total available CPU and memory capacity of the node. The sum of these fractions indicates overall resource utilization efficiency.

Load balancing (LB) efficiency evaluates how evenly tasks are distributed among nodes in heterogeneous edge environments. The load balancing metric calculated by Eq. 34:

$$\:LB=1-\frac{\sigma\:\left({U}_{n}\right)}{\stackrel{-}{{U}_{n}}}$$
(34)

Where \(\:\sigma\:\left({U}_{n}\right)\:\)represents the standard deviation of resource utilization across all nodes, and \(\:\stackrel{-}{{U}_{n}}\) is the average utilization. A value closer to \(\:1\) indicates better load balancing and minimal overload on individual nodes.

For evaluating federated learning performance in edge environments, we employ model Federated Learning Accuracy (FLAcc) by Eq. 35:

$$\:Acc=\frac{{N}_{\text{c}\text{o}\text{r}\text{r}\text{e}\text{c}\text{t}}}{{N}_{\text{t}\text{o}\text{t}\text{a}\text{l}}}\times\:100$$
(35)

Where \(\:{N}_{\text{c}\text{o}\text{r}\text{r}\text{e}\text{c}\text{t}}\) is the number of correctly predicted labels by the federated model, and \(\:{N}_{\text{t}\text{o}\text{t}\text{a}\text{l}}\) is the total number of test samples. Accuracy is expressed as a percentage, reflecting the effectiveness of federated training across distributed edge nodes.

One of the most important evaluation metrics are Jain’s Fairness Index (JFI) and Gini Coefficient. JFI is employed to quantitatively evaluate the degree of fairness in workload distribution among edge nodes. This metric reflects how evenly tasks or resources are allocated, ensuring that no individual node is disproportionately overloaded or underutilized. JFI calculated by Eq. 36:

$$\:JFI=\frac{{\left({\sum\:}_{i=1}^{N}{x}_{i}\right)}^{2}}{N\cdot\:{\sum\:}_{i=1}^{N}{x}_{i}^{2}}$$
(36)

Where \(\:{x}_{i}\) represents the amount of workload assigned to node \(\:i\), which can be quantified as the number of executed tasks, CPU utilization share, or allocated resource fraction. \(\:N\) denotes the total number of participating edge nodes. The numerator reflects the square of the aggregate allocation, while the denominator normalizes the distribution across all nodes. The value of \(\:J\) ranges between \(\:0\) and \(\:1\), where values closer to \(\:1\) indicate highly balanced and fair resource allocation among nodes, and lower values indicate imbalance or resource skewness.

The Gini Coefficient is utilized to measure the inequality in workload distribution across nodes. Unlike JFI, which emphasizes uniformity, the Gini coefficient captures the degree of imbalance, providing a complementary perspective on fairness in distributed scheduling. Gini Coefficient calculated by Eq. 37:

$$\:G=\frac{{\sum\:}_{i=1}^{N}{\sum\:}_{j=1}^{N}\left|{x}_{i}-{x}_{j}\right|}{2N{\sum\:}_{i=1}^{N}{x}_{i}}$$
(37)

Where, \(\:{x}_{i}\) and \(\:{x}_{j}\) denote the workload or resource allocation for nodes \(\:i\) and \(\:j\), respectively, while \(\:N\) is the total number of nodes. The numerator captures the sum of absolute pairwise differences between allocations, representing inequality in distribution. The denominator normalizes this value relative to the total allocated workload. The Gini coefficient ranges from \(\:0\) to \(\:1\), where values closer to \(\:0\) indicate perfect fairness (equal distribution), and values closer to \(\:1\) indicate high inequality.

4.4 Experimental results of BalanceFaaS

In this section, we analyze the performance of the proposed BalanceFaaS framework in detail, comparing its results with baseline methods and related studies, specifically Automouse [34], FL-DE [35], and EALO [36] with 10-1000 edge nodes.

To ensure reproducibility and clarity of the proposed BalanceFaaS framework, the weighting coefficients used in Eq. (6), Eq. (11), and Eq. (20) are explicitly defined based on empirical tuning and prior studies. Specifically, in Eq. (6), the weights are set as \(\:\alpha\:\:=\:0.5\), \(\:\beta\:\:=\:0.3\), and \(\:\gamma\:\:=\:0.2\), assigning higher importance to latency while still considering energy and resource demand.

In Eq. (11), the coefficients are configured as \(\:{\omega\:}_{l}=0.4\), \(\:{\omega\:}_{e}=0.35\), and \(\:{\omega\:}_{r}=0.25\), balancing latency and energy while incorporating resource availability.

Furthermore, in Eq. (17), the decision weights are set to \(\:{w}_{\tau\:}=0.6\) and \(\:{w}_{b}=0.4\), prioritizing scheduling probability while still accounting for bidding cost.

These values were selected after preliminary sensitivity analysis to achieve a balanced trade-off between latency minimization, energy efficiency, and load distribution across heterogeneous edge nodes.

The evaluation is conducted across all datasets and metrics discussed previously, including latency, energy consumption, TSR, resource utilization, LBE, and FLAcc, in heterogeneous serverless edge environments. Figure 2, illustrates the Accuracy of BalanceFaaS with the number of 10-1000 edge nodes for the datasets.

Fig. 2
Fig. 2
Full size image

The latency of BalanceFaaS with the number of 10-1000 edge nodes for the datasets

Fig. 3
Fig. 3
Full size image

The energy of BalanceFaaS with the number of 10-1000 edge nodes for the datasets

Fig. 4
Fig. 4
Full size image

The TSR of BalanceFaaS with the number of 10-1000 edge nodes for the datasets

As can be seen from Fig. 2, the proposed BalanceFaaS framework has the best performance in terms of latency on the Alibaba dataset. With 10 edge nodes, it processes tasks sent from IoT devices with a delay of 60 milliseconds, and then with increasing the number of edge nodes, the latency decreases and reaches the optimal value with the number of nodes of 850 nodes, and the latency is constant with increasing the number of edge nodes. Therefore, the improvement rate of the proposed BalanceFaaS framework compared to other datasets such as SmartCIoT, AZURE, GOOGLE CLUSTER dataset is improved by an average of about 0.9, 1.9, and 2.1 milliseconds, respectively. Figure 3, illustrates the latency of BalanceFaaS with the number of 10-1000 edge nodes for the datasets.

As can be seen from Fig. 3, the proposed BalanceFaaS framework has the best performance in terms of energy consumption on the Alibaba dataset. With 10 edge nodes, it processes tasks sent from IoT devices with 25 joules of energy consumption, and then with increasing the number of edge nodes, the energy consumption decreases and reaches the optimal value with 850 edge nodes, and the energy consumption remains constant with increasing the number of edge nodes. Therefore, the energy consumption improvement of the proposed BalanceFaaS framework compared to other datasets such as SmartCIoT, AZURE, GOOGLE CLUSTER dataset is improved by an average of about 0.2, 0.9, and 1.6 joules, respectively. Figure 4, illustrates the Accuracy of BalanceFaaS with the number of 10-1000 edge nodes for the datasets.

Fig. 5
Fig. 5
Full size image

The resource utilization of BalanceFaaS with the number of 10-1000 edge nodes for the datasets

Fig. 6
Fig. 6
Full size image

The LB of BalanceFaaS with the number of 10-1000 edge nodes for the datasets

Fig. 7
Fig. 7
Full size image

The accuracy of BalanceFaaS with the number of 10-1000 edge nodes for the datasets

As can be seen from Fig. 4, the proposed BalanceFaaS framework has the best performance in terms of TSR on the Alibaba dataset. With 10 edge nodes, it processes tasks sent from IoT devices with a 95% TSR, and then with increasing the number of edge nodes, the TSR increases and reaches the optimal value with 850 edge nodes, and the TSR remains constant with increasing the number of edge nodes. Therefore, the TSR improvement of the proposed BalanceFaaS framework compared to other datasets such as SmartCIoT, AZURE, GOOGLE CLUSTER dataset has improved by an average of about 1.5%, 1%, and 0.5%, respectively. Figure 5, illustrates the resource utilization of BalanceFaaS with the number of 10-1000 edge nodes for the datasets.

As can be seen from Fig. 5, the proposed BalanceFaaS framework has the best performance in terms of TSR on the Alibaba dataset. With 10 edge nodes, it processes tasks sent from IoT devices with 93% resource utilization, and then with increasing the number of edge nodes, the resource utilization rate increases and reaches the optimal value with 850 edge nodes, and the TSR remains constant with increasing the number of edge nodes. Therefore, the TSR improvement of the proposed BalanceFaaS framework has improved by an average of about 1.3%, 1.5%, and 0.2% compared to other datasets such as SmartCIoT, AZURE, and GOOGLE CLUSTER dataset, respectively. Figure 6, illustrates the LB of BalanceFaaS with the number of 10-1000 edge nodes for the datasets.

As can be seen from Fig. 6, the proposed BalanceFaaS framework has the best performance in terms of LB on the Alibaba dataset. With 10 edge nodes, it processes tasks sent from IoT devices with 94% LB, and then with increasing the number of edge nodes, the LB rate increases and reaches the optimal value with 850 edge nodes, and the LB rate remains constant with increasing the number of edge nodes. Therefore, the LB improvement of the proposed BalanceFaaS framework compared to other datasets such as SmartCIoT, AZURE, GOOGLE CLUSTER dataset has improved by an average of about 1.3%, 0.9%, and 0.8%, respectively. Figure 7, illustrates the accuracy of BalanceFaaS with the number of 10-1000 edge nodes for the datasets.

As can be seen from Fig. 7, the proposed BalanceFaaS framework has the best performance in terms of accuracy on the Alibaba dataset. With 10 edge nodes, it processes tasks sent from IoT devices with 96% accuracy, and then with increasing the number of edge nodes, the accuracy increases and reaches the optimal value with 850 edge nodes, and the accuracy remains constant with increasing the number of edge nodes. Therefore, the accuracy improvement of the proposed BalanceFaaS framework compared to other datasets such as SmartCIoT, AZURE, GOOGLE CLUSTER dataset is about 0.9%, 0.7%, and 0.5% on average, respectively.

Figure 8, illustrates the relationship between stability and convergence over 1–50 iterations, highlighting the optimal performance achieved within the final iterations.

Fig. 8
Fig. 8
Full size image

Relationship between stability and convergence over 1–50 iterations

In the presented plots, the top graph demonstrates the observed stability across 1–50 iterations, showing a steady increase until iteration 45, after which stability remains constant. This indicates that the solution has reached a stable point, suggesting efficient convergence characteristics in the applied method. The bottom graph illustrates the corresponding convergence, which decreases as stability increases. Notably, the convergence stabilizes along with stability from iteration 45 to 50, confirming that iteration 50 represents the optimal iteration for this analysis. This behavior emphasizes the effectiveness of the chosen approach in achieving a stable and convergent result.

In Table 3, performance results of proposed BalanceFaaS framework of 10-1000 edge nodes and 50 iterations is shown.

Table 3 Performance results of proposed balancefaas framework of 10-1000 edge nodes and 50 iterations

For the Alibaba dataset, the proposed BalanceFaaS framework achieved a latency of 48.3 ms, which is significantly lower than the baseline Automouse [34] framework. Energy consumption was measured at 12.7 J per task, indicating improved energy efficiency compared to conventional energy-aware schedulers. TSR reached 99.5%, reflecting high reliability in task execution under SLA constraints. Resource utilization and LBE were recorded at 98% and 99%, respectively, demonstrating near-optimal use of heterogeneous edge node resources. The results show that federated latency and energy modeling combined with distributed load-aware scheduling enables superior coordination of tasks and resource allocation.

On the Google Cluster dataset, BalanceFaaS achieved 52.4 ms latency and 14.3 J energy consumption, outperforming the FL-DE [35] framework. TSR was 99.0%, while resource utilization and LB efficiency reached 99.1% and 99.0%, respectively. The FLAcc of 99.2% illustrates that the framework effectively preserves local model privacy while maintaining high global model performance. These improvements are attributed to the FMOGPR-based federated resource modeling and the D-LASA scheduling with ACO-RF reinforcement feedback.

For the AZURE dataset, latency was 50.1 ms with an energy consumption of 13.6 J. TSR was 99.2%, and resource utilization and LBE were 98.5% and 98.8%, respectively. FLAcc reached 99%. The consistent high performance across GOOGLE CLUSTER and AZURE datasets confirms the scalability and robustness of BalanceFaaS in handling diverse federated learning workloads in edge environments.

In heterogeneous edge computing scenarios, BalanceFaaS achieved 49.2 ms latency, 12.9 J energy consumption, and a TSR of 98.0%. Resource utilization and LBE were 98.0% and 98.5%, respectively, while FLAcc was 98.8%. These results demonstrate that the framework efficiently manages dynamic workloads and heterogeneous resource capacities, ensuring fair task distribution and minimal energy hotspots.

The superior performance of BalanceFaaS can be attributed to several key architectural innovations. First, the FMOGPR enables accurate and collaborative estimation of task latency and energy consumption without sharing raw data, preserving privacy and reducing communication overhead. Second, the D-LASA based on ACO with ACO-RF intelligently routes tasks to underutilized nodes while minimizing energy hotspots. Third, the CAB-B mechanism ensures fair and dynamic resource allocation, promoting balanced utilization across heterogeneous nodes. Fourth, the H-CAOE integrates FRL to fine-tune function placement based on node status, CPU, memory, and battery levels. Finally, the MA-BFT consensus with LA-WV guarantees consistent and resilient scheduling decisions even in the presence of node failures or malicious behaviors. Collectively, these features enable BalanceFaaS to achieve high TSRs, efficient resource utilization, minimal latency, and high FLAcc across all tested datasets.

Table 4 presents the fairness evaluation results of the proposed BalanceFaaS framework using JFI and Gini Coefficient across all datasets.

Table 4 Fairness evaluation results of the proposed BalanceFaaS framework

The fairness evaluation results demonstrate that the proposed BalanceFaaS framework achieves consistently high levels of workload distribution fairness across all datasets. Specifically, the JFI values exceed 0.98 in all scenarios, indicating near-optimal load balancing among participating edge nodes. This highlights the effectiveness of the integrated CAB-B bidding mechanism and LA-WV consensus strategy in preventing resource monopolization and ensuring equitable task allocation.

From a complementary perspective, the Gini Coefficient values remain significantly low (below 0.025), further confirming the uniformity of workload distribution. The slightly higher Gini value observed in the Hetero-Edge dataset can be attributed to inherent heterogeneity in node capabilities, where certain nodes possess higher computational capacity and thus handle slightly more workload. Nevertheless, the inequality remains minimal, demonstrating the robustness of the proposed framework in heterogeneous environments.

These results validate that BalanceFaaS not only optimizes latency and energy consumption but also ensures fairness in distributed scheduling decisions. The CAB-B and LA-WV mechanisms plays a critical role in achieving this balance, enabling adaptive and equitable orchestration even under dynamic and resource-constrained edge conditions.

4.5 The proposed BalanceFaaS performance comparison

In this section, the performance of the proposed BalanceFaaS framework is compared against recently proposed baseline methods in serverless and edge computing environments. The baseline methods include Greedy-FaaS [37], EdgeSim-Sched [38], DAG-Orch [39], EcoSched [40], LoadAware-FaaS [41], FireFly [42], HHO-ACO [43], and FOSO-GA [44]. The comparison is conducted across all evaluation metrics and Alibaba, GOOGLE CLUSTER, AZURE, and SmartCIoT datasets. In Fig. 9, Alibaba dataset performance comparison of BalanceFaaS framework with other methods is shown.

Fig. 9
Fig. 9
Full size image

Alibaba dataset performance comparison of BalanceFaaS framework with other methods

BalanceFaaS achieves a latency reduction of 4.2–5.9 ms relative to the baseline methods, indicating superior task routing and scheduling efficiency. Energy consumption is reduced by 0.8–1.5 J, reflecting enhanced energy-aware function placement. TSR improves by 1.7–2.8%, while resource utilization and LBE are 2–3% higher than all baselines. FLAcc surpasses baseline methods by 2.6–3.7%, demonstrating effective model training across nodes while preserving privacy. In Fig. 10, GOOGLE CLUSTER dataset performance comparison of BalanceFaaS framework with other methods is shown.

Fig. 10
Fig. 10
Full size image

GOOGLE CLUSTER dataset performance comparison of BalanceFaaS framework with other methods

BalanceFaaS shows 3–5% improvement across all metrics compared to baseline methods. Latency reduction is 4.4–5.6 ms, energy efficiency improves by approximately 1–1.2 J, and TSR increases by 2–3.5%. Resource utilization and LBE surpass the baselines by 2–3%, and FLAcc reaches 99.2%, demonstrating the effectiveness of the FMOGPR and D-LASA combined with CAB-B bidding and H-CAOE orchestration. In Fig. 11, AZURE dataset performance comparison of BalanceFaaS framework with other methods is shown.

Fig. 11
Fig. 11
Full size image

AZURE dataset performance comparison of BalanceFaaS framework with other methods

BalanceFaaS achieves a latency reduction of 5–5.4 ms, energy savings of 1–1.4 J, and increases TSR by 2–3.2% over the baseline methods. Resource utilization and LBE improve by 2–3%, while FLAcc reaches 99.0%, demonstrating consistent high performance across image-based edge workloads. In Fig. 12, SMARTCIOT dataset performance comparison of BalanceFaaS framework with other methods is shown.

Fig. 12
Fig. 12
Full size image

SMARTCIOT dataset performance comparison of BalanceFaaS framework with other methods

In heterogeneous edge scenarios, BalanceFaaS reduces latency by 3.6–4.8 ms compared to baseline methods. Energy consumption is decreased by 0.9–1.4 J per task, while TSR improves by 1.7–2.8%. Resource utilization and LBE are enhanced by 2–3%, indicating better coordination of heterogeneous nodes. FLAcc is also improved by 2.6–3.5%, showcasing robustness across dynamic workloads.

The proposed BalanceFaaS framework demonstrates significant improvements over baseline methods, including Greedy-FaaS [37], EdgeSim-Sched [38], DAG-Orch [39], EcoSched [40], LoadAware-FaaS [41], FireFly [42], HHO-ACO [43], and FOSO-GA [44]. One of the primary reasons for this superior performance is the FMOGPR used for resource modeling. Unlike traditional centralized approaches, FMOGPR enables edge nodes to collaboratively estimate function latency and energy consumption without sharing raw data. This preserves privacy, reduces communication overhead, and provides adaptive, context-aware predictions that capture both temporal and spatial variance in node workloads. As a result, BalanceFaaS can make more informed scheduling decisions, which directly contributes to lower latency and higher TSRs.

Another major advantage stems from the D-LASA algorithm based on ACO-RF. This algorithm dynamically routes tasks to underutilized nodes while considering CPU, memory, and energy availability. The use of pheromone-based reinforcement feedback ensures that scheduling decisions continuously improve over time, promoting both efficiency and fairness. Compared to baseline methods, which often rely on static or centralized scheduling, D-LASA effectively prevents overload and balances tasks across heterogeneous nodes, leading to higher resource utilization and improved LBE.

The CAB-B mechanism further contributes to BalanceFaaS superiority. By allowing nodes to dynamically bid for function execution based on their current state and resource availability, CAB-B facilitates a market-driven, cost-aware allocation of tasks. This prevents bottlenecks and ensures that high-priority or resource-intensive functions are placed on suitable nodes, enhancing overall system throughput and energy efficiency compared to baseline methods that do not incorporate such dynamic bidding.

Moreover, the H-CAOE leverages FRL to fine-tune function placement in real-time. By continuously monitoring node-level metrics, network conditions, and historical execution feedback, H-CAOE optimizes orchestration policies to minimize energy hotspots, reduce latency, and maximize overall system reliability. This contrasts with conventional orchestration methods that often lack adaptive intelligence, especially in dynamic and heterogeneous edge environments.

Finally, the inclusion of the MA-BFT consensus with LA-WV ensures that all scheduling and orchestration decisions are resilient to failures and malicious behaviors. This fault-tolerant coordination layer guarantees consistency and fairness across all nodes, which is critical for large-scale deployments. Most baseline methods lack this level of distributed fault tolerance, making BalanceFaaS not only more efficient but also more reliable under adverse conditions.

Collectively, these integrated features enable BalanceFaaS to outperform all eight baseline methods across multiple evaluation metrics. The framework achieves 3–5% improvements in latency reduction, energy efficiency, TSR, resource utilization, LBE, and FLAcc. The combination of federated modeling, adaptive scheduling, dynamic bidding, intelligent orchestration, and fault-tolerant consensus provides a holistic solution that addresses both the computational and operational challenges of serverless edge computing environments, making BalanceFaaS a state-of-the-art framework for decentralized, load- and energy-aware function scheduling.

This section presents a comprehensive comparison of the proposed BalanceFaaS framework against three baseline studies, namely Automouse [34], FL-DE [35], and EALO [36], across multiple datasets and evaluation metrics. The objective is to highlight the performance improvements of BalanceFaaS in terms of latency, energy efficiency, TSR, resource utilization, LBE, and FLAcc under heterogeneous edge computing environments. In Table 5, the comparison of the proposed BalanceFaaS framework with other baseline study is shown.

Table 5 Comparison of the proposed balancefaas framework with other baseline study

BalanceFaaS reduces latency by 6.6–7.5 ms compared to Automouse [34], FL-DE [35], and EALO [36], demonstrating the efficiency of the D-LASA and ACO-RF-based scheduling. Energy consumption is reduced by 1.5–1.8 J due to FMOGPR-driven resource estimation. TSR increases by 2.1–2.6%, while resource utilization and LBE improve by 2.3–3.7%, showing superior load distribution and energy-aware allocation. FLAcc exceeds baselines by 3–3.4%, confirming effective collaborative model training.

In image-based workloads, BalanceFaaS achieves a latency reduction of 5.4–6.1 ms. Energy efficiency improves by 0.7–1.0 J, while TSR is 2.3–2.7% higher than baseline methods. Resource utilization and LBE show gains of 2.5–3.4%, while FLAcc is improved by 3.4–3.8%. These improvements highlight the effectiveness of CAB-B bidding and H-CAOE orchestration in dynamic environments.

BalanceFaaS reduces latency by 5.5–6.1 ms relative to baseline methods, with energy consumption reduced by 1.1–1.3 J. TSR improves by 2.2–2.6%, while resource utilization and LBE are 2.8–3.2% higher than Automouse [34], FL-DE [35], and EALO [36]. FLAcc reaches 99.0%, highlighting the robustness of the FMOGPR and FRL mechanisms for efficient function execution and feedback.

In heterogeneous edge scenarios, BalanceFaaS achieves a latency reduction of 4.2–4.9 ms, energy reduction of 0.8–1.0 J, and TSR improvement of 2.2–2.6%. Resource utilization and LBE are 2.5–3.3% higher than baseline methods, while FLAcc improves by 3.5–3.7%. This demonstrates that BalanceFaaS effectively handles heterogeneous nodes with dynamic workloads, outperforming existing methods in both computational efficiency and reliability.

Baseline methods, including Automouse [34], FL-DE [35], and EALO [36]. One of the most prominent reasons for this improvement is the FMOGPR mechanism used for latency and energy modeling. Unlike conventional centralized approaches in Automouse [34] and EALO [36], FMOGPR allows edge nodes to collaboratively estimate task execution latency and energy consumption without sharing raw data. This not only preserves data privacy but also significantly reduces communication overhead, enabling adaptive and context-aware predictions that reflect both spatial and temporal variations in edge workloads. Consequently, BalanceFaaS achieves lower latency, higher TSRs, and improved energy efficiency compared to traditional methods.

In addition, the impact of weighting coefficients on system performance was analyzed through sensitivity observations during preliminary experiments. The selected configuration demonstrates that assigning higher weight to latency (e.g., \(\:\alpha\:\) = 0.5 and \(\:{w}_{\tau\:}\) = 0.6) significantly improves response time without adversely affecting energy efficiency. Meanwhile, maintaining balanced weights for energy and resource utilization (e.g., \(\:{\omega\:}_{e}\) = 0.35, and \(\:{\omega\:}_{r}\)= 0.25) ensures that the system avoids excessive energy consumption and prevents node overloading.

The results indicate that the chosen weighting scheme provides a stable trade-off between latency, energy efficiency, and load balancing, outperforming alternative configurations tested during the tuning phase. This confirms the robustness of the proposed BalanceFaaS framework under varying workload conditions.

5 Time complexity

The overall time complexity of BalanceFaaS defined as Eq. 38:

$$ \begin{aligned} \:T_{{BalanceFaaS\:}} = & O(N \cdot \:M \cdot \:I) + O(K \cdot \:P \cdot \:{\text{log}}P\:) \\ & + O(A \cdot \:B) + O(C \cdot \:L) \\ \end{aligned} $$
(38)

Where \(\:N\) is number of edge nodes in the network, \(\:M\) is number of local function models per node (FMOGPR models), \(\:I\) is number of iterations for local model convergence, \(\:K\) is number of tasks to schedule, \(\:P\) is number of candidate nodes per task, \(\:A\) is number of auction rounds in CAB-B, \(\:B\) is number of bids processed per auction,\(\:C\) is number of nodes participating in consensus (MA-BFT), and \(\:L\) is number of weighted voting steps in LA-WV.

For comparison, the time complexity of existing methods can be approximated as follows:

The time complexity of Automouse [34] defined as Eq. 39:

$$\:{T}_{Auto-EA}=O(N\cdot\:{K}^{2})+O(N\cdot\:{M}_{centralized})\:)$$
(39)

Automouse [34] relies on a centralized scheduling mechanism that iteratively evaluates all tasks across all nodes, resulting in quadratic scaling with respect to the number of tasks \(\:K\). The centralized model training \(\:{M}_{centralized}\) also increases communication overhead. The time complexity of FL-DE [35] defined as Eq. 40:

$$\:{T}_{ModRFL}=O(N\cdot\:{M}_{federated}\cdot\:I)+O(K\cdot\:N)$$
(40)

FL-DE [35] performs federated learning but uses semi-centralized orchestration for task allocation, leading to linear overhead in the number of tasks and nodes. While the federated modeling is efficient, task placement is not fully optimized, resulting in higher scheduling latency. The time complexity of EALO [36] defined as Eq. 41:

$$\:{T}_{LBHSEC}=O(K\cdot\:N\cdot\:\text{log}N)+O\left({N}^{2}\right)$$
(41)

EALO [36] utilizes hierarchical scheduling combined with heuristic load balancing. The \(\:O\left(K\cdot\:N\cdot\:\text{log}N\right)\)term arises from task assignment using priority queues, and \(\:O({N}^{2}\)) emerges from node coordination and hierarchical aggregation, making it less scalable in dense networks.

The BalanceFaaS framework achieves superior computational efficiency due to its fully decentralized and parallelized architecture. Key advantages include:

  • Local Model Training: FMOGPR models are trained locally at each node, significantly reducing communication overhead compared to Automouse [34] centralized approach. Iterations \(\:I\) are performed in parallel across \(\:N\) nodes, decreasing overall convergence time.

  • Task Scheduling Optimization: The ACO-RF based D-LASA algorithm evaluates only a subset \(\:P\) of candidate nodes for each task, rather than all nodes, leading to \(\:O(K\cdot\:N\cdot\:\text{log}N)\) instead of \(\:O({N}^{2}\)) complexity as in EALO [36].

  • Dynamic Bidding Efficiency: CAB-B auction rounds \(\:A\) handle only active bids \(\:B\), reducing unnecessary computation compared to static or exhaustive search allocation in baseline methods.

  • Fault-Tolerant Consensus: MA-BFT with LA-WV is designed for scalability, with linear complexity in \(\:C\cdot\:L\), whereas hierarchical or semi-centralized coordination in EALO [36] or Automouse [34] scales quadratically in nodes, making BalanceFaaS more suitable for large-scale deployments.

  • Scalability: Overall, the distributed nature of BalanceFaaS ensures that complexity grows linearly or near-linearly with the number of nodes and tasks, whereas Automouse [34], FL-DE [35], and EALO [36] exhibit quadratic scaling in at least one component.

In summary, BalanceFaaS provides a computationally efficient and scalable solution, outperforming baseline methods not only in performance metrics such as latency, energy, and TSR but also in execution time and scalability, which are critical in large, heterogeneous edge computing environments.

6 Conclusion

This study presents BalanceFaaS, a fully decentralized, load- and energy-aware serverless scheduling framework designed for heterogeneous edge computing environments. BalanceFaaS integrates FMOGPR, D-LASA with ACO-RF, CAB-B, H-CAOE, and MA-BFT with LA-WV to achieve efficient, reliable, and adaptive function execution. The experimental evaluation demonstrates that BalanceFaaS consistently outperforms state-of-the-art baseline methods across multiple metrics such as latency, energy consumption, TSR, resource utilization, LBE, and FLAcc. In particular, the framework achieves improvements of 4% over these baselines, highlighting its ability to optimize both computational performance and energy efficiency in dynamic, heterogeneous edge environments.

The key factors behind this performance are the combination of local, federated model training, decentralized scheduling with reinforcement feedback, dynamic resource bidding, context-aware orchestration, and robust consensus for distributed decision-making. These integrated mechanisms enable BalanceFaaS to adaptively balance workloads, allocate resources efficiently, and maintain consistency and reliability even under volatile network conditions. Additionally, the framework demonstrates excellent scalability and fault tolerance, as the complexity grows near-linearly with network size and task volume, unlike many existing centralized or semi-centralized approaches. Overall, BalanceFaaS provides a holistic solution for serverless edge computing, addressing the critical challenges of energy-efficient, latency-aware, and fault-tolerant task scheduling.

Despite its strong performance, BalanceFaaS exhibits several limitations that should be considered in practical deployments. First, the framework requires sufficient computational capability at edge nodes to support local FMOGPR training and ACO-RF iterations; in extremely resource-constrained IoT devices, this may lead to increased local processing latency and reduced responsiveness. Second, although the MA-BFT consensus mechanism ensures robustness against Byzantine behavior, its communication and coordination overhead may increase non-linearly in very large-scale deployments (e.g., thousands of nodes), potentially impacting real-time decision latency. Third, the dynamic combinatorial bidding process introduces additional communication rounds between nodes, which may slightly increase scheduling latency under highly volatile workload conditions where frequent reallocation is required.

Nevertheless, the framework offers several notable capabilities: it ensures privacy-preserving federated modeling, dynamic and adaptive load balancing, energy-efficient task execution, context-aware orchestration, and robust fault-tolerant decision-making. The modular architecture allows for flexible integration of additional optimization or AI-driven components, making it suitable for a wide range of edge computing scenarios.

To further enhance BalanceFaaS and address its current limitations, several future research directions are proposed. First, lightweight federated learning techniques such as split learning or adaptive model compression can be integrated to reduce computational overhead on resource-constrained nodes, enabling deployment in ultra-low-power IoT devices. Second, graph neural networks (GNNs) can be explored for more intelligent and predictive task allocation, taking into account complex spatial-temporal relationships among nodes, which may improve latency and energy efficiency in highly dynamic networks. Third, hybrid consensus mechanisms, combining MA-BFT with probabilistic or blockchain-based approaches, can be employed to further enhance fault tolerance and reduce coordination overhead in extremely large-scale edge environments. These future directions aim to expand the scalability, efficiency, and applicability of BalanceFaaS, while directly addressing the current limitations related to computation, communication, and consensus overhead, ultimately enabling deployment in more challenging and large-scale industrial and IoT scenarios.