我一直致力于在jmeter上执行负载测试,每秒500个用户。我正在使用JMeter。在运行负载测试时,我不断收到登录API的错误。 以下是我发送和接收超时的请求和响应。
示例请求
POST https://example.com//9000/v1/api/user/login
POST data:
{
"email":"xyz@yopmail.com",
"password":"abcdef"
}
[no cookies]
Request Headers:
Connection: keep-alive
Content-Type: application/json
:
Content-Length: 79
Host: botstest.smartbothub.com
User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_151)
样本回复
Thread Name: Thread Group 1-310
Sample Start: 2017-12-27 11:30:06 IST
Load time: 61422
Connect Time: 1148
Latency: 61422
Size in bytes: 363
Sent bytes:286
Headers size in bytes: 171
Body size in bytes: 192
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: 504
Response message: Gateway Time-out
Response headers:
HTTP/1.1 504 Gateway Time-out
Server: nginx/1.10.3 (Ubuntu)
Date: Wed, 27 Dec 2017 06:01:07 GMT
Content-Type: text/html
Content-Length: 192
Connection: keep-alive
HTTPSampleResult fields:
ContentType: text/html
DataEncoding: null
服务器的nginx配置文件如下所示。 https://drive.google.com/file/d/1_XWYeqSAWZz6dtnTTCeLOEMzDwvEWwY1/view
答案 0 :(得分:1)
很可能您的Nginx服务器过载,因此无法及时处理请求导致错误。
可能是由几个问题引起的:
但首先读取日志:JMeter日志,Nginx日志,操作系统日志,存在和相关的任何内容。很可能你会从中找出原因。