  Fog computing is becoming a vital component for Internet of things (IoT)
applications, acting as its computational engine. Mission-critical IoT
applications are highly sensitive to latency, which depends on the physical
location of the cloud server. Fog nodes of varying response rates are available
to the cloud service provider (CSP) and it is faced with a challenge of
forwarding the sequentially received IoT data to one of the fog nodes for
processing. Since the arrival times and nature of requests is random, it is
important to optimally classify the requests in real-time and allocate
available virtual machine instances (VMIs) at the fog nodes to provide a high
QoE to the users and consequently generate higher revenues for the CSP. In this
paper, we use a pricing policy based on the QoE of the applications as a result
of the allocation and obtain an optimal dynamic allocation rule based on the
statistical information of the computational requests. The developed solution
is statistically optimal, dynamic, and implementable in real-time as opposed to
other static matching schemes in the literature. The performance of the
proposed framework has been evaluated using simulations and the results show
significant improvement as compared with benchmark schemes.
