Comments (4)
看起来像是 locust 用的是 zeromq,而 boomer 没有用 zeromq。你可以看看这里的讨论,#6
locust 和 boomer 用的通信协议必须一致。
解决方法有两个:
- 修改 locust 源码,让它使用原生的 socket,代码在 locust/rpc/init.py。
- 编译 boomer 的时候,加上 zeromq 的支持。
个人建议用第一种方法,由于 boomer 的性能比较好,一般一台机器只启动一个 slave,就可以用满机器资源,无须挂很多 slave,所以用原生 socket 来和 master 通信,问题不大。
from boomer.
好的,我再去试一下。
from boomer.
myzhan老师你好,我今天尝试了很多种方法,最后没用windows而用ubuntu操作系统成功了,但是我发现用boomer作为负载机产生的rps反而更低了很多,从原来的500左右的rps降到10rps,是不是我哪里的姿势不对?以下是code,就是一个非常简单的GET请求:
package main
import "github.com/myzhan/boomer"
import (
"io"
"io/ioutil"
"net/http"
)
func liusong() {
startTime := boomer.Now()
tr := &http.Transport{
DisableKeepAlives: true,
}
client := &http.Client{Transport: tr}
resp, err := client.Get("http://pcsstest.preing.com/pcss-web/label/poplabels.do?params=[{%22channel%22:%22WAP%22,%22cmmdtyCode%22:%22000000000100004312%22,%22labelScene%22:%2205%22,%22supplierCode%22:%220000000000%22}]")
resp.Header.Add("User-Agent", "WafTestSpider")
io.Copy(ioutil.Discard, resp.Body)
resp.Body.Close()
endTime := boomer.Now()
if err != nil {
boomer.Events.Publish("request_failure", "http", "liusong", 0.0, err.Error())
} else {
boomer.Events.Publish("request_success", "http", "liusong", float64(endTime-startTime), resp.ContentLength)
}
}
func main() {
task := &boomer.Task{
Name: "ls",
Weight: 10,
Fn: liusong,
}
http.DefaultTransport.(*http.Transport).MaxIdleConnsPerHost = 2000
boomer.Run(task)
}
from boomer.
resp.Header.Add("User-Agent", "WafTestSpider") 这句代码有点问题,如果你是要修改 UA 的话,应该在发请求之前加。
除此之外,压测代码没有其它问题。需要更多的信息,来定位问题。例如只有 10 rps 的时候,你压测的并发数是多少?boomer 的 CPU 负载是多少?服务端响应是否正常?
from boomer.
Related Issues (20)
- [Question]请问boomer目前是否为按照func顺序执行? HOT 2
- 请问下在Locust内是支持顺序执行接口的,在boomer中是不支持的吗? HOT 1
- 无论locust使用的是什么版本均提示worker版本过低无法连接 HOT 4
- 多个接口在一个func里执行时能否分开展示在locust中? HOT 4
- 负载变化时导致并发突增 HOT 4
- 运行mian.go文件显示一名旧的(2.0之前的)工作人员试图连接(wei_CD3CE23358F7494BF15286E9573C25D)。那是行不通的 HOT 5
- Standalone mod 运行,控制台输出没有数据 HOT 1
- 能不能加个run-time 运行时间呢 HOT 3
- 求助: UI界面设置host参数无效 HOT 3
- 为什么每次spawn之前要先stop所有的job,而不是像python版那样在已有连接上增加呢? HOT 10
- 如何能Subscribe并处理来自Master的自定义Topic HOT 6
- go get github.com/myzhan/boomer报错 HOT 2
- task可以由master通过mq传过来后,再启动slave压测吗? HOT 4
- untime error: index out of range [299] with length 280 HOT 2
- 启动参数只支持默认的 defaultboomer , 不支持自定义的 NewBoomer HOT 1
- 在 locust 发送 stop 消息时,boomer 偶现 panic 的情况 HOT 3
- 能否增加强行Quit的方式? HOT 3
- 有没有考虑过重构boomer HOT 3
- Onboarding command that fails HOT 1
- 现在能支持到locust最新的哪个版本 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boomer.