Function as a Service (FaaS) is a recent event-driven serverless paradigm that allows enterprises to build their applications in a fault tolerant distributed manner. Having been considered as an attractive replacement of traditional Service Oriented Architecture (SOA), the FaaS platform leverages the management of massive data sets or the handling of event streams. However, the realization of such leverage is largely dependent on the effective exploitation of FaaS elasticity/scalability. In this paper, we present a closed-loop resource allocation controller to dynamically scale resources by predicting the future rate of incoming events and by considering the Quality of Service (QoS) enforcements requested by end-users. The performance evaluation is carried out by comparing the proposed controller with some well-known heuristics such as round robin and best-effort strategies. Experimental results confirm that the proposed controller increases the overall resource utilization by 21% on average, while reducing QoS violations by a factor of almost 3.