The current trend in cloud computing is the growing adoption of microservices. Microservices are specialized components of an application that can be deployed and scaled individually, potentially replacing monolithic applications. To meet this demand, cloud providers offer function-as-a-service (FaaS) or serverless computing. Additionally, there is an increasing use of containerized environments in Internet of Things (IoT) applications. It has been shown that implementing serverless computing at the edge of an IoT network for executing tasks can reduce the overall execution time of these tasks. In cloud and edge computing environments, the infrastructure typically exhibits heterogeneity, and this heterogeneity can significantly impact the performance of different invocations of a FaaS function. This paper addresses infrastructure heterogeneity by partitioning a heterogeneous cluster into homogeneous pools based on similar resource characteristics and profiling function performance. The key contributions of this paper are: (1) a serverless architecture design that extends the function placement and load-balancing capabilities of current serverless platforms to effectively manage infrastructure heterogeneity, (2) a load-balancing approach that efficiently utilizes multi-core hardware, and (3) an implementation of the architecture, thereby evaluating the impact of the extended capabilities.