2014-04-25 00:35
题目:没有专门的测试工具,你要如何对一个网页进行压力测试?
解法:拼手速,拼电脑数量呗。快捷键+复制粘贴网址,狂搞一番。话说回来,有脚本语言的情况下,直接写个脚本来模拟大量的访问行为肯定是更合理的,手速再快比不过程序。没有工具时,应该想着如何制造工具,而不是赤手空拳去搞。
代码:
1 // 12.4 How would you load test a webpage, if you're not allowed to use any test tools? 2 // Answer: 3 // As far as what I've learned, load testing is a testing method which puts the system under limited resources and exposes it to excessive pressure. 4 // 1. Browser side: 5 // 1.a. Use a PC with low configuration, but it must sufficient to see the webpage. 6 // 1.b. Use various browsers to see their different performances. 7 // 1.c. Open multiple instances of this webpage, see if it fails to respond. 8 // 2. Server side: 9 // 2.a. Deploy the web server on a server(maybe a PC) with low configuration. 10 // 2.b. Try to visit it with multiple clients(many users at the same time). 11 // 2.c. If the system includes some storage, try to fill it up with POST or GET actions on the webpage. 12 int main() 13 { 14 return 0; 15 }
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)