I want to know why it takes 8 to 40 seconds to load a CSS of several tens of KB on the wordpress site.

Asked 2 years ago, Updated 2 years ago, 125 views

The wordpress site is heavy, so I'm in trouble.
According to Chrome's developer tool, it seems that the TTFB of a CSS with a file size of only a few tens of KB takes 8 to 40 seconds.(See the results of the developer tool that I copied below.) I wonder why it looks like it can be loaded faster (about 100 ms).

By the way, once you load the page, it will be in the browser cache, so it will load at a normal speed.

Also, it seems that this CSS blocks subsequent loads, but I would like to do something about the problem that we are discussing this time.

Question

  • What is causing the CSS to be so slow?
  • How can I speed it up?
  • What should I research to speed it up?

environment

  • T2.small
  • in AWS
  • A wordpress environment built six months ago following the latest Japanese version of AWS
  • Using Apache instead of Nginx
  • Using PHP7

Developer Tool Results

developer tool

August 13th morning postscript

By the way, I will share the Apache configuration. As far as apachectl-V shows, it works as prefork.


StartServers 1
MinSpareServers1
MaxSpareServers2
ServerLimit 4
MaxClients1
MaxRequestsPerChild5

php apache wordpress nginx

2022-09-30 21:33

1 Answers

As for Apache settings, I think the values are extremely low.
In particular, MaxClients is the limit that the server can respond at the same time, so if the value is 1, I guess it will be quite slow.In the sense of isolation, why don't you revert to the default settings?

Also, I think it would be good to check the log of the server.
Look at the access log to see how many concurrent accesses were made, whether there were any errors, and so on.

Also, the AWS instance size is t2.small, which is a low-performance instance class, so it may be a lack of basic performance.I think it would be good to check the metrics in AWS' CloudWatch.In particular, T2 instances are extremely slow when CPU credits are exhausted.

The disk (EBS) may be slow, so please check this out on CloudWatch as well.For general purpose SSDs, as with the T2 CPU, exhausting credits is extremely slow.


2022-09-30 21:33

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.