I want to figure out the memory usage of 100 EC2 instances and the name of the scripts that are running in them (Probably push it to a DB).
Any ideas on how to do this the most efficient way in PHP or Java.
I want to figure out the memory usage of 100 EC2 instances and the name of the scripts that are running in them (Probably push it to a DB).
Any ideas on how to do this the most efficient way in PHP or Java.
Rather than going out to 100 instances and doing stuff (which is hard to scale), you should have the instances automatically report this information to a central service.
For example, here is a Linux script that can measure memory and send the metrics back to Amazon CloudWatch: Monitoring Memory and Disk Metrics for Amazon EC2 Linux Instances
You could use a similar script to send your own metric to CloudWatch, particularly if it is a numeric answer.
However, if you do decide to centrally query each server for information, you should use the Systems Manager Run Command that can automatically execute scripts on multiple Amazon EC2 instances simultaneously.