The optimization of the cloud resources used to power a multi-agent Internet of Things architecture is an important issue which has an important impact on the overall operation cost of the architecture. The resources tenancy is a costly operation, thus their allocation and management should be optimized based on the usage patterns. The infrastructure for the multi-agent system should not be affected by the deployment or maintenance life cycle, operations require parts of the system, or even the entire system to be offline during the execution of scheduled procedures. This paper outlines of the importance of the infrastructure audit, which offers a good insight of how the resources are used, the geographical areas which are heavily used and where the allocation or release of used resources is mandatory. Also, the security audit, in a distributed multi-agent architecture that handles a large number of heterogeneous devices, represents a good mechanism for performance improvement.