Website on app service returns "Server Error"

StefanoM 6 Reputation points
2020-06-09T10:00:11.107+00:00

Hello!

I've created a Resource Group with an App Service Linux (Production plan) and a MySQL Database.

I've uploaded and configured Wordpress on this app service. Everything was working fine but in last month I've found my web app with an error page twice.

The error page was only reporting "Server Error".

I've searched errors through logs (docker and mysql) but I did not find interesting rows. The only one was::
PHP Warning: Error while sending QUERY packet. PID=2696 in /home/site/wwwroot/wp-includes/wp-db.php on line 2030, referer: https://www.google.com/

I don't know why it is referring to google.com. Trying to find a reason for the error I've also uploaded a static HTML file and server keeps returning the error page and obviously I've tried to restart the App Service.

The only action that solved the problem was scale up to a better plan. I've investigated why and I've noticed the memory usage jumped to the max memory available even if request to the site are following the average number of requests in last month, where memory usage was quite lower. For example, 3.5GB was the memory usage when App Service was down, 500 MB is the average memory usage in past 20 days.

Anyway, the site started immediately when I scaled up the service.

Why memory started to be critical even if I did not changed anything on my web site? Is it possible tha Docker container is not working fine? Or how can I manage this problem without having my website down?

Thanks

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,844 questions
{count} votes

3 answers

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 18,286 Reputation points
    2020-06-09T11:55:08.287+00:00

    Thanks for asking question! If you are experiencing high memory usage in your web app the few questions scoping here is: Where are you seeing high memory? Is it low physical memory or low available memory on the instance or high Private bytes for worker process? Number of sites \ slots \ webjobs are running in which App Service Plan and size of instance.

    You may look into memory usage pattern. Is memory constantly increasing and not reducing or the memory reaches a stage (say 2 or 3GB) and it stays there. Memory constantly increasing and not decreasing could be a memory leak and “memory reaches a particular stage (say 2 or 3GB)” might indicate caching etc.

    There is the new diagnostics experience to help you drill down memory usage on each instance serving your app and to identify the app and the corresponding process causing High Memory.

    You may access App Service diagnostics, navigate to your App Service web app or App Service Environment in the Azure portal. In the left navigation, click on Diagnose and solve problems.

    You may refer to below link for more details on this:

    https://azure.github.io/AppService/2020/03/23/A-New-Look-for-App-Service-Diagnostics.html

    9641-inked2020-06-09-16-44-29-document1-autorecovered-w.jpg

    9631-inked2020-06-09-16-45-12-li.jpg


  2. Santosh Kumar Gada 76 Reputation points
    2020-06-09T14:13:20.447+00:00

    Hi, The memory get occupied continuously when you have not destroyed(disposed) the object which has larger records/data in it. For example, you are trying to get the active employees from your Org, and list returns you 10 Lac of records and this operation get executed for each request or on particular page. In this case if the users are trying this page, the memory get increased continuously and when the Memory reach 3.5 GB, the app service get restarted and the service will not be available for some time.

    Please check such scenario in you application, and also you can find the actual problem as below;

    1. Go to App Service
    2. Go to Diagnose and solve problems
    3. Diagnostic Tools
    4. Collect Memory Dump.

    By analyzing the memory dump you will get better idea where the leakage of Memory.

    R/Santosh Gada


  3. Santosh Kumar Gada 76 Reputation points
    2020-06-18T02:52:45.51+00:00

    Hi,

    Sorry for the delayed answer. Probably you have navigated to the wrong path. Below is the snapshot.

    1. Go to App Service
    2. Go to Diagnose and solve problems
    3. Diagnostic Tools
    4. Collect Memory Dump.

    10332-capture.png

    Let me know if you find the one.

    R/Santosh Gada

    0 comments No comments