How to reduce our server response time or TTFB?

True Scoop 0 Reputation points
2024-10-10T07:37:32.5466667+00:00

We've been noticing a relatively higher server response time since we shifted from Web App to Virtual Machine. Could there possibly be any correlation between the two?

Also pls suggest ways to reduce the Server Response time to under 150 ms. Currently we're above 400 ms.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,003 questions
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,904 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pinaki Ghatak 4,295 Reputation points Microsoft Employee
    2024-10-11T13:37:12.0733333+00:00

    Hello @True Scoop

    One of the reasons could be the network latency, which is higher compared to an on-premises deployment. Reducing network round trips can greatly improve performance.

    To reduce round-trips, consolidate applications that have high transactions or chatty apps on the same virtual machine.

    Another reason could be the server dependencies. Consider the geographical locations of your components.

    For example, if you're using Azure, make sure the web server and the database are in the same region. Do queries retrieve more information than they need? Would caching or batching help? Here are a few tips that you can follow to reduce the server response time:

    • Use virtual machines with accelerated networking for better network performance.
    • Optimize your application for a large number of small values, rather than a few large values.
    • Use Redis pipelining to make efficient use of the network and get the best throughput possible.
    • Avoid expensive operations like the KEYS command.
    • Choose an appropriate tier for your cache.
    • Use a Redis client that supports Redis pipelining.
    • Monitor performance characteristics on the server carefully and optimize where necessary. If you have already tried these steps and still cannot reduce the server response time, you may need to consider other factors such as the size of your VM, the number of connection objects your application uses, and the CPU usage on client hosts.
    • Regarding your question about the correlation between Web App and Virtual Machine, it is difficult to say without more information. However, it is possible that the shift from Web App to Virtual Machine could have affected the server response time.

    I hope that this response has addressed your query and helped you overcome your challenges. If so, please mark this response as Answered. This will not only acknowledge our efforts, but also assist other community members who may be looking for similar solutions.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.