We recently published a technical paper about vCenter API performance. In it, we discuss common issues we’ve come across and look at best practices to get better performance from these interfaces. Some issues we discuss include how to:
- Avoid memory leaks by destroying resources after use.
- Reduce memory usage by monitoring only information required for your use case, rather than monitoring all information for an entity.
- Reduce the latency overhead of connecting to vCenter using connection pooling or reusing sessions.
- Improve the performance of statistics and event queries by properly defining time ranges.
We show dramatic improvements in property fetch latency via PropertyCollector by fetching a subset of data for a VM (the name) rather than the entire object. For example, we observed that using PropertyCollector to fetch all VM properties was 144 times slower than fetching only VM names.
Figure 1. For 1,000 VMs, fetching all VM properties is 114 times slower than fetching only VM names
Each performance tip also includes code samples that show how you can apply the best practices in your own scripts.
For the full paper, go to VMware vCenter API Performance Best Practices.