Score:0

aws t3.small nginx gzip response time is slow?

US flag

I am having php web application on t3.small ec2 instance.

webserver : nginx

    gzip on;
    gzip_vary on;
    gzip_min_length 10240;
    gzip_proxied expired no-cache no-store private auth;
    gzip_disable "MSIE [1-6]\.";
    gzip_comp_level 6;
    gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

For large html output server response time is 500ms. How to reduce response time? Should i change server type or else?

Update

Precise timings for pages and let us know the page size?

Page Load without gzip:

Load time: approx 250ms Page Size: 150kb

Page Load with gzip:

Load time: approx 512ms Page Size: 44kb

Each request generate user specific page without caching.

Screenshot of your CPU credits over the past week.

Cloudwatch cpu credit usage

Tim avatar
gp flag
Tim
We would need more detail to help. How about giving us precise timings for pages and let us know the page size? Ideally tell us the page load time and show the corresponding Nginx log entry, for pages of multiple sizes. Also, are pages cached or are they generated / compressed for each user? Perhaps use a benchmarking tool such as "ab", or a benchmarking service. t3.small is fine, I use a t3.nano with no problems with gzip enabled. Also please check Cloudwatch and post a screenshot of your CPU credits over the past week.
Hitesh avatar
md
Thanks @Tim I have added update to question.
Tim avatar
gp flag
Tim
I don't think you have understood my previous comment. Please make multiple requests, maybe ten, and provide a table that shows time to load and also information from the Nginx logs about how long the page took to generate. If there's a downstream app server I would like to see time to generate page, and time for Nginx to gzip / serve the page. I asked for a CPU credits graph, not a CPU usage graph. If you're not sure what that is please use Google.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.