简体   繁体   English

用于本地服务器的Jmeter测试?

[英]Jmeter testing for localhost server?

I want to use Jmeter as performance testing tool for my java web project but my project is on localhost server which is Tomcat server. 我想将Jmeter用作我的Java Web项目的性能测试工具,但我的项目位于localhost服务器(即Tomcat服务器)上。 How can i able to do performance testing of my project using Jmeter? 我如何使用Jmeter对项目进行性能测试?

You can do that...just provide the IP address for the request and If it hits the server then you will get the response. 您可以执行此操作...只需提供请求的IP地址,如果该请求到达服务器,则将得到响应。

Below is more info from @Dmitri T post:- 以下是来自@Dmitri T帖子的更多信息:-

Meter doesn't care whether application under test is local or remote, if you cannot hit local URL with JMeter - something is wrong with your HTTP Request Sampler configuration, most likely "Port" value is wrong. Meter不在乎被测应用程序是本地的还是远程的,如果您无法使用JMeter访问本地URL-HTTP Request Sampler配置有问题,则很可能“ Port”值有问题。

In order to be able to help we need to know the following: 1. URL of your application 2. Output of View Results Tree listener 3. Contents of JMeter log 4. Description of screenshot of your HTTP Request sampler 为了能够提供帮助,我们需要了解以下内容:1.应用程序的URL 2.视图结果树侦听器的输出3. JMeter日志的内容4. HTTP请求采样器的屏幕快照说明

As an alternative option you can try recording your scenario using JMeter Chrome Extension and see if you're able to replay recorded scenario without errors. 作为一种替代选择,您可以尝试使用JMeter Chrome扩展程序记录您的方案,并查看是否能够无错误地重放记录的方案。 Again, use View Results Tree listener to inspect request and response details. 同样,使用“查看结果树”侦听器检查请求和响应的详细信息。

In general it is not recommended to run the application under test and the load generator on the same physical or virtual machine as the load generator (JMeter in your case) may consume immense amount of resources like CPU and RAM and it may interfere your application health (unless you're using completely isolated containers), so I would recommend use separate hosts for application and the load generator. 通常,不建议在被测试的应用程序上运行,并且负载生成器应与负载生成器(在您的情况下为JMeter)在同一台物理或虚拟机上运行,​​这可能会消耗大量的CPU和RAM等资源,并且可能会干扰应用程序的运行状况(除非您使用的是完全隔离的容器),所以我建议为应用程序和负载生成器使用单独的主机。

Reference:- How to make Jmeter recognize "localhost" URL? 参考:- 如何使Jmeter识别“ localhost” URL?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM