如何衡量Web App性能?
我在 PHP/Apache/Mysql、Python/Ngix/Postgresql 和 Erlang/Yaws/Mnesia 中开发了 3 个简单的博客系统。
如何测量这 3 种不同配置的服务器性能?
I have developed 3 simple blogging system in PHP/Apache/Mysql, Python/Ngix/Postgresql and in Erlang/Yaws/Mnesia.
How can I measure performance on my server for this 3 different configuration ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当你说你想衡量性能时,我假设你指的是负载测试、响应时间等。
如果是这样,你可以使用 ab (apache bench)。它是一个小程序,通常可以在 Linux 上使用,我相信在 Mac 上也可以使用。您给它一个 url,告诉它请求它多少次,并可以选择给它一些其他参数。它发送 http 请求,因此无论服务器代码是用什么实现的,您都可以使用它来测试所有 3 个系统。
这是有关 ab 的更多信息的链接
ab 可以让您很好地了解有多少每个系统每秒可以处理的请求数。如果您想要一个指标来比较您的 3 个系统,那么这是一个非常好的指标。
要发现服务器的哪些元素限制了性能(CPU、数据库访问、带宽),您需要查看服务器上而不是客户端计算机上的工具。您使用的工具取决于操作系统,并且可能会根据您用于实现服务器代码的语言/工具而有所不同。
When you say you want to measure performance I assume you mean load testing, response times, that kind of thing.
If so you can use ab (apache bench). Its a little program that's usually available on linux and, I believe, macs. You give it a url, tell it how many times to request it and optionally give it some other parameters. Its sending http requests so it doesnt matter what the server code is implemented in so you can use it to test all 3 systems.
Here's a link with more information on ab
ab will give you a good idea of how many requests per second each system can put through. If you want a single metric to compare your 3 systems that's a pretty good one.
To discover what element of the server is limiting performance (cpu, database access, bandwidth) you'll need to look at tools that are on the server instead of on the client machine. What tools you use there will depend on the operating system and potentially will vary depending on what language/tools you used to implement the server code.
您也可以尝试使用 httperf (http://www.hpl.hp.com /research/linux/httperf/)。
Also you can try to use httperf (http://www.hpl.hp.com/research/linux/httperf/).
我建议你看看 Tsung。
从他们的主页上读到:
另外,对于您的 Erlang 位,您可能会在分析部分找到一些提示和工具。 Erlang 效率指南。
I would suggest you to have a look at Tsung.
Reading from their home page:
Also, for your Erlang bit, you might find some hints and tools in the profiling section of the Erlang efficiency guide.