  Code offloading refers to partitioning software and migrating the mobile
codes to other computational entities for processing. Often when a large number
of mobile codes need to be distributed to many heterogenous hosts, this can
easily lead to poor system performance if one host gets too many mobile codes
to process while others are almost idle. To resolve such situation, we proposed
a proposed a load balancing algorithm to ensure fairness in the distribution of
the mobile codes. The algorithm is based on the popular Weighted
Least-Connections (WLC) scheduling algorithm while taking into consideration
the dynamic recalculation of the hosts weights and system attributes such as
CPU idle rate and memory idle rate which the WLC algorithm does not take into
consideration. Using simulation, various number of mobile codes were
distributed to the hosts/servers and the proposed algorithm outperform existing
Least-Connections and Weighted Least-Connections scheduling algorithms thus
improving system efficiency.
