eriklupander / gotling

Simple golang-based load test application using YAML documents as specification
MIT License
86 stars 30 forks source link

evaluate and use fasthttp #6

Open missedone opened 8 years ago

missedone commented 8 years ago

i saw this https://github.com/rakyll/boom/issues/94, we probably can evaluate it and use it if it really promise.

eriklupander commented 8 years ago

Sounds great. Assigned the issue to you if you want to give it a shot.

HTTP performance have been quite good so far, on my laptop (OS X) I usually run out of file handles before the CPU usage goes above 100% on a single core. But having less CPU usage due to HTTP implementation overhead sounds good.

Regarding memory use, I've seen pretty consistent behaviour where Gotling uses about 8 kb (each goroutine) x number of concurrent "users".

missedone commented 8 years ago

sure, will have a try later

missedone commented 8 years ago

i just pushed the initial implementation with fasthttp on feature/fasthttp branch. for now, only GET is supported, i did a quick test, and found that there is performance degradation with fasthttp compared to stdlib net/http. will dig deeper later to understand why.

below is an example, you can uncomment the client: fasthttp line to use fasthttp, by default it's using net/http:

---
iterations: 10
users: 10
rampup: 10
actions:
  - http:
      title: Ping Google
      method: GET
      # client: fasthttp
      url: https://www.google.com
eriklupander commented 8 years ago

Thanks, awesome work. Did you get the performance issue sorted out?

missedone commented 8 years ago

nope, even i use the lock-free approach for creating request/response object in commit: https://github.com/eriklupander/gotling/commit/da3a8d52ea22bfc89b7e2ca884f262bb09ad9d6b

i guess there still other lock/sync operation in fasthttp internal, will see.

missedone commented 8 years ago

i'd like to pend this since still fasthttp not perform as fast as net/http.

eriklupander commented 8 years ago

Ok, good work nevertheless.

jpallari commented 7 years ago

Interesting work! :-) I wonder if sharing a single fasthttp client across multiple go-routines would help.