Apache Benchmark 文档长度与 YSlow 页面总重量
我正在使用 Apache Benchmark 对我的页面进行负载测试:
ab -n 20 -c 5 http://localhost/mysite/index/index
我知道文档长度 代表所有 HTML 图像、CSS、JS 以及响应中任何内容的总和(以字节为单位)。
如果我浏览 Firefox 并运行 YSlow,我会看到:
The page has a total of 22 HTTP requests and a TOTAL WEIGHT of 202.7K bytes
with empty cache
- 文档长度大小和 YSlow 页面的总重量之间有什么区别?
我很想知道这些定义 (AB/YSlow) 的不同之处,以便(也许)我可以理解为什么我的 AB 文档长度与其他网站(具有类似内容,例如 grubwithus.com)相比如此高(高达 14000 字节) )文档长度不超过 91 字节!然而,我还注意到我的网页的 YSlow 大小比 grubwithus.com 的大小要小得多(202k 对 1124k)。
I'm load testing my page with Apache Benchmark:
ab -n 20 -c 5 http://localhost/mysite/index/index
I know that Document Length stands for the sum of all HTML images,CSS,JS and anything within the response in bytes.
If I go over Firefox and I run YSlow I see that:
The page has a total of 22 HTTP requests and a TOTAL WEIGHT of 202.7K bytes
with empty cache
- what's the difference between the document length size and the YSlow page's total weight?
I'd love to know where these definitions (AB/YSlow) differ so that (maybe) I can understand why my AB document length is so high (up to 14000 bytes) compared to other websites (with similar contents, e.g. grubwithus.com) that have a document length not exceeding 91 bytes! However, I also noticed that the YSlow size of my webpage is a way less than the compared size of grubwithus.com (202k against 1124k).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
YSlow 还计算所有链接的资源(所有链接的文件,从样式、脚本、图像到这些蹩脚的 Flash,甚至可能是嵌入的 PDF)。 ab 只是提取 HTML 文档(至少对于我所知道的版本来说,这似乎已经过时了)。
接下来,我认为 ab 为您提供未压缩的大小,但 yslow 压缩的大小。但我不太喜欢 yslow 来确定这一点。检查他们的文档以了解具体信息。
一般来说,这两种工具都会做不同的事情。所以不要比较它们的尺寸信息。 Ab 用于在服务器上生成负载,YSlow 用于分析网络浏览器上下文中隔离响应的性质。
YSlow counts all linked resources as well (all linked files, from styles, scripts, images up to these crappy flashes and probably even PDFs if they are embedded). ab just pulls the HTML document (at least for the version I know of, which seems to be outdated).
Next to that I think ab gives you the uncompressed sizes but yslow the compressed ones. But I'm no so into yslow to be sure on this. Check their docs for specifics.
Generally both tools do something different. So don't compare their size infos. Ab is for generating load on the server, YSlow is to analyze the nature of the isolated response in context of a webbrowser.