How to automatically extend the virtual machine vertically based on memory metrics - azure-virtual-machine

The virtual machine on Azure can monitor the guest operating system’s data, such as CPU, memory usage, and so on, by enabling guest OS diagnostic data collection. Now, I want to know how to use the memory usage to automatically extend the virtual machine vertically.

First enable guest OS diagnostics data collection so that we can collect more disk, CPU, and memory data. If it is not checked during creation, it can be configured by monitoring the diagnostic settings in the VM panel.
Click on the alert rule under monitoring to create an alert rule. You can choose your own metrics. Since we are expanding based on memory here, we choose the percentage of memory that has been used here.
Select a threshold, the condition is greater than. This means that when the memory usage exceeds the threshold, this alarm is triggered to execute the action. The period is a time range of data statistics.
Finally choose to take action, which Azure has built a lot of scripts for us to use. Since we need to scale up here, select Scale up VM. Then select one of our automated accounts or create a new one.
The above is how to automatically expand the virtual machine by monitoring the memory usage. For more information, please refer to
https://docs.azure.cn/zh-cn/virtual-machines/windows/monitor
https://docs.azure.cn/zh-cn/virtual-machines/windows/tutorial-monitoring.
Besides, If you’re Microsoft partner, I find a free channel to solve azure queries: aka.ms/devchat. They support online chat and email.

Related

Bigquery Slot metrics are not showing data in GCP

I was trying to create the metrics for the Bigquery and when choosing the slots utilized or related to slots I was not able to get the data as shown in the below:
Kindly help me how to check this kind of issues in order to populate the data and create metrics on slots. Also I am facing the similar issues with the tables metric.
Basically, BigQuery is a serverless product, you pay what you use (here, the volume of data scanned). To process the data, slots are assigned. You have, by default 2000 slots assigned to your project.
The problem with this pattern is the not predictability of the cost, which is problematic in large company (who prefer to pay more with a knows budget in advance -> stupid, but financial departments prefer!!). For this, you can [reserve your slots](Cluster Program Manager) and you can assign them to different project (if you have reserved slots at Organisation level and not at project level).
With slot, you no longer pay the volume of data scanned, but only your slots.
Of course, if your query takes 10s with 2000 slots and you assign only 500 slots, the query will take 40s (it's not so linear, but it the principle)
You can dynamically change the assignation if you want. I mean, if you have a project with batch process the night, you can assign the max of slots to it during the night, and reassign the slots during the day for your dashboarding project (for example).
So, with this metrics, you can follow the slots assignation to your project. The other interesting metrics in the allocated slots. Indeed, you can set 500 slots to your project, but your query require only 100 slots. Like this you can optimise your assignations.
The Big Query metric "slots/assigned" you are trying to use to create the chart in metric explorer is marked as EARLY_ACCESS as you can follow in this Cloud Monitoring document.
You will need to be invited or whitelisted to use this Alpha metric or wait till it is General Available or in Beta stage.
Early access: Early access features are limited to a closed group of
testers for a limited subset of launches. Participation is by
invitation only and may require signing a pre-general-availability
agreement, including confidentiality provisions. These features may be
unstable, change in backward-incompatible ways, and are not guaranteed
to be released. There are no SLAs provided and no technical support
obligations. Early access releases are rare and focus on validating
product prototypes.
If you are not able to see any metric, please take a look if you have the correct prerequisites to create those charts in monitoring.

How does Google Compute Recommend Memory Upgrades on vms

Often Google Compute recommends upgrading cpu/memory of the vms I am using. I can see the cpu graph of the instance so I can imagine where it gets the idea I should upgrade the CPU, but there is no such thing for ram so How does it know when to upgrade the ram?
You can use the companion Google Stackdriver app which by default collects more metrics for all your instances. The URL for the metrics for a single instance is
https://app.google.stackdriver.com/instances/<INSTANCE_ID>?project=<PROJECT_ID>
The hypervisor gives us some idea of the number of RAM pages that have been used, and we can make a recommendation based on that. However, since in any case Google does not inspect the RAM, we don't actually know what the purpose of pages are, merely how many are backed by physical RAM. Installing the StackDriver agent allows us to get better information from the guest OS about what is considered to be in use by the OS, and we can actually recommend better discounts in that case. The docs page [1] talks about this a little, although it could probably go into more detail about the memory usage signals.
[1] https://cloud.google.com/compute/docs/instances/viewing-sizing-recommendations-for-instances

Unable to delete virtual machines image and storage

Unable to delete virtual machines image and storage.
I was trying to delete the virtual machine image and get the "Initial Server Error" error message.
Then I entered the storage of the image. Then the page keep redirect me to following
You are seeing this message because we cannot determine if your
account must comply with the requirements of the Federal Information
Security Management Act (FISMA). You are accessing an information
system that may contain U.S. Government data. System usage may be
monitored, recorded, and subject to audit. Unauthorized use of the
system is prohibited and may be subject to criminal and civil
penalties. Use of the system indicates consent to monitoring and
recording. Administrative personnel remotely accessing the Microsoft
Azure environment
1) Shall maintain their remote computer in a secure
manner, in accordance with organizational security policies and
procedures as defined in Microsoft Remote Connectivity Security
Policies.
2) Shall only access the Microsoft Azure environment in
execution of operational, deployment and support responsibilities
using only administrative applications or tools directly related to
performing these responsibilities and
3) Shall not store, transfer
into, or process in the Microsoft Azure environment data exceeding a
FIPS 199 Moderate security categorization (FISMA Controlled
Unclassified Information)
Here is an image with this error
Firstly, there is no government data in my image, the storage of the image is automatically created by wizard when I created the image.
I have tried it again over several days, it just never allow me to delete.
In addition, it just keep draining out my Azure credit. I am not sure what I should do to delete this image and its storage.
Please give me some advise. Thanks.

RDS eating all the swap space

We have been using MariaDB in RDS and we noticed that the swap space is getting increasingly high whithout being recycled. The freeable memory however seems to be fine. Please check the attached files.
Instance type : db.t2.micro
Freeable memory : 125Mb
Swap space : increased by 5Mb every 24h
IOPS : disabled
Storage : 10Gb (SSD)
Soon RDS will eat all the swap space, which will cause lots of issues to the app.
Does anyone have similar issues?
What is the maximum swap space? (didn't find anything in the docs)
Please help!
Does anyone have similar issues?
I had similar issues on different instance types. The trend of swapping stays even if you would switch to higher instance type with more memory.
An explanation from AWS you can find here
Amazon RDS DB instances need to have pages in the RAM only when the pages are being accessed currently, for example, when executing queries. Other pages that are brought into the RAM by previously executed queries can be flushed to swap space if they haven't been used recently. It's a best practice to let the operating system (OS) swap older pages instead of forcing the OS to keep pages in memory. This helps make sure that there is enough free RAM available for upcoming queries.
And the resolution:
Check both the FreeableMemory and the SwapUsage Amazon CloudWatch metrics to understand the overall memory usage pattern of your DB instance. Check these metrics for a decrease in the FreeableMemory metric that occurs at the same time as an increase in the SwapUsage metric. This can indicate that there is pressure on the memory of the DB instance.
What is the maximum swap space?
By enabling Enhanced Monitoring you should be able to see OS metrics, e.g. The amount of swap memory free, in kilobytes.
See details here
Enabling enhanced monitoring in RDS has made things more clear.
Obviously what we needed to watch was Committed Swap instead of Swap Usage. We were able to see how much Free Swap we had.
I now also believe that MySQL is dumping things in swap just because there is too much space in there, even though it wasn't really in urgent need of memory.

how to fetch real time data from aws server details like cpu ram and hard disk usage

We are running aws xlarge instance and the site has the 2000 con-current users. We need to get the real time server parameters.
Currently we use to get the server parameters using shell and php code but everytime we have to refresh the page to get the details or if we use ajax page and make it load in intervals then the server load goes high.
Is it possible to monitor the real time parameters of the server without using third party tools.
Can anyone give suggestion how should go for this.
You can try the out of the box AWS service which is provided for FREE - Amazon CloudWatch. The metrics like CPU utilisation, Memory Free, Disk Reads, Disk Writes, Network In, Network Out etc. logged and can be retrieved via API calls.
You do not need to install additional software or agents to enable this data, in fact you don't need to do anything to have this data populated - just launching an Instance would do. By default the data points are collected in 5 min interval, to get even fine grain points you can enable detailed monitoring for additional charge. All the data points are stored for 2 weeks.
More information
https://aws.amazon.com/cloudwatch/details/#amazon-ec2-monitoring
http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html