How the "Always On" setting effects CPU usage in Azure webapps - cpu

How "Always on" setting effects CPU usage?
When "Always on" is off, the CPU usage is 0% if no one uses it. But after I set it is on, it seems CPU usage is High even no one uses it.
This image is showing the max CPU Percentage every 5 minutes in 24 hours.
This image is showing the average CPU Percentage every 5 minutes in 24 hours.
Is it normal? By the way, the images are from Azure app plan. And I have 3 webapps in the same plan. And all of them have been set "always on" to on.

Always On keeps the host process running. This allows your site to be more responsive to request after significant idle periods. Otherwise, once a request comes in, the App Service will have to cold boot and load into memory before responding to the request.
If you're seeing expectantly high CPU duding an "idle" period, I would start by correlating incoming requests with CPU spikes. Have a look here in order to get a snapshot of activity that's being done while your app service is idle.

Related

Why ElasticBeans talk shows that the Environment health as Degraded & 100 % of CPU is in use while instance shows normal CPU

Health tab on ElasticBeanstalk environment shows 100 % of CPU is in use.
health monitor also shows these metrics
but when I visit the instance monitoring tab, it shows the CPU utilization as normal
running a top command shows this screen
What I can notice is the ST is high so what could be the reason that ElasticBens talk shows loaded CPU while EC2 Monitor shows normal?
I have found the root cause of this issue is that the instance type is t2.micro which are burst-able and this means there are CPU credit that is given to the instance when it process below baseline and there is also launch credit
at my case, it seemed that the instance consumed all the launch credit and also the accumulated CPU credit when it processed above the baseline (Brust)
when this case happens and the instance has no CPU credit, Amazon hypervisor throttled the CPU and increased the Stealing Time to 76%
How I solved this issue?
I added an extra instance to work alongside the throttled one which reduced the load on this instance, it then started accumulating credit and the stealing time went down

timer expired ...abort Jmeter ERROR(Non gui mode) - while running the Load test up to 3000 Users

I was performing the Load test up to 3000 users on 16GB RAM and on EC2 instance. when the user reached 2000+, I got the Error timer expired, ...abort in command prompt. During this period Memory & CPU usage was up to 96%
Let me know is this error occurred due to Memory and CPU usage went up to 96% ?or anything to do with Jmeter scripts. bcoz Up to 1K it was working properly.
According to this answer to the JVM crashes with no frame specified, only “timer expired, abort” it occurs when a fatal error has occurred and the JVM wasn't properly switched off in 2 minutes time frame.
Most probably 3000 users is way too much for your test for that VM. Moreover 96% of usage of CPU and RAM is a little bit too much for me, I would rather stop ramping up the users when CPU/RAM usage starts exceeding 80% of total available capacity.
So the next step would be:
Configure JMeter to ramp-up users gradually, i.e. 3000 users in 15 minutes or so
Make sure to follow JMeter Best Practices
Make sure to setup realtime monitoring of CPU, RAM and other resources
Start your test
See how many virtual users were online when resources usage starts exceeding 80% using ie. Active Threads Over Time listener
If you have 3000 users - you should be good to go, if not - you will need to create another machine and to run JMeter in Distributed Mode

Azure Website Kudu HTMLLog Analysis shows Always On with high response time

We deployed our WebAPI as an azure website under the standard plan and have turned on Always On. After getting multiple memory and CPU alerts we decided on checking the logs via xyz.scm.azurewebsites.net. It seems Always ON has a high response time. Could this be causing high memory and CPU issues. Sometimes the alerts come when none is even using the system and auto resolve within 5 mins.
The always on feature only invokes the root of your web app every 5 minutes.
If this is causing high memory or cpu it could be a memory leak within your application because if you don't use the always on feature your process gets recycled on idle.
You should check what your app does if you invoke it with the root path and determine why this is causing high response time.

Performance of NewRelic Real User Monitoring

We're been using NewRelic Real User Monitoring to track performance and activity.
We've noticed that the browser metrics are showing the majority of time is just Network times.
Even extremely small and simple server pages are showing average times of 3-5 seconds, even though they are just a few k in size and their Web application times and rendering times are mere milliseconds.
The site is hosted in the UK and when I run Chrome's Network Developer Tools I can see the page loading in around 50ms and then the hit to beacon-1.newrelic.com (in the USA) taking a further 500ms.
The majority of our clients do not have the luxury of high bandwidth or modern browsers and I believe that NewRelic itself is causing them a particularly poor user experience.
Are there any ways of making the new relic calls perform better? Can I make new relic call to a local (UK or Europe) based beacon?
I don't want to turn off new relic, but at the moment, it is causing more performance issues than it is alerting us to.
New Relic real user monitoring (RUM) does not affect the page load time for your users. The 500 ms that you are seeing refers to the amount of time it takes for the RUM data we collected from your app to reach our servers here in the U.S. The data is transferred after the pages are loaded, so it doesn't affect the page load at all for your users. This 500 ms of data travel time, therefore, is not part of any of our measurements of the networking, page rendering or DOM processing time.
New Relic calculates network time by first finding the total amount of time your application takes from request to page load, and then subtracting any application server time from that total. It is assumed that the resulting amount of time is "network" time. As such, it doesn't include the amount of time it takes to send that data to New Relic's servers. See this page for more info on how RUM works:
https://newrelic.com/docs/features/how-does-real-user-monitoring-work
If you're worried that there might be a bug or that your numbers don't look accurate, you can always file a support ticket with New Relic so we can look at your account in more detail.

High CPU load but low CPU usage and RAM usage

I am running a mobile website to get the live running status of any train in India. It is http://www.spoturtrain.com . The full code is written in PHP and Nginx is used as the webserver, php-fpm is used as the application server. All php requests are proxied to the app server. During peak traffic hours in the morning, the system load shoots up to 4 but the CPU% and the memory usage is low. Please take a look at the snapshot of the top command of the server.
Th %CPU displayed in the bottom section is per-thread, which means the percentage of one CPU core used by the indicated thread. The CPU(s) section indicates the total amount of available CPU that is being utilized, so it is possible to have one thread reporting that it is using 100% CPU, while only 25% (4 core) or 12.5% (8 core) of the overall CPU cycles are being consumed.
Analyzing thread CPU usage on Linux
You don't really ask a question, so it's hard to tell if you are wanting some advice or just asking to have the numbers explained. As #Charles states, a typical "acceptable" load is 1 per CPU core before noticeable performance degradation occurs, but in the case of PHP running on most web servers, you may (but probably won't in most cases) start noticing problems at anything above 1. Whether or not you do will largely depend on your disk and network I/O.
Whether or not the performance is acceptable for your application isn't something I can answer, but you can take a look at this thread for more places to jump into the options for getting your web server to thread requests.
What is thread safe or non thread safe in PHP
Whether or not you can do anything about it depends on your hosting situation.

Resources