MitchDrage opened a new issue, #14397:
URL: https://github.com/apache/cloudstack/issues/14397

   ### problem
   
   We run 3 management servers, and I noticed every VM gets 3 rows in vm_stats 
each minute, one from each management server. Each MS polls every host for VM 
stats and saves its own copy.
   
   Here's one VM over 10 minutes:
   
   ```
   mysql> SELECT mgmt_server_id, COUNT(*) FROM vm_stats
          WHERE vm_id=3116 AND timestamp > NOW() - INTERVAL 10 MINUTE
          GROUP BY mgmt_server_id;
   +----------------+----------+
   | mgmt_server_id | COUNT(*) |
   +----------------+----------+
   |              2 |       10 |
   |              5 |       10 |
   |              7 |       10 |
   +----------------+----------+
   ```
   So the table grows 3x faster than it needs to, and each host answers 3 stats 
requests a minute where 1 would do. This gets noticeable once you raise 
vm.stats.max.retention.time past the 12-hour default.
   
   ### versions
   
   4.22.1.1 (also present on 4.20 and main)
   
   ### The steps to reproduce the bug
   
   1. Run 2 or more management servers.
   2. Count vm_stats rows for any running VM, grouped by mgmt_server_id.
   
   
   ### What to do about it?
   
   VmStatsCollector in StatsCollector.java runs on every management server, and 
each one collects stats from all hosts. Each management server should only 
collect stats from the hosts connected to it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to