/gevent-goroutine

Comparison of Two Lightweight Processing Techniques: gevent vs goroutine

Primary LanguageGoMIT LicenseMIT

gevent-goroutine

Comparison of Two Lightweight Processing Techniques: gevent vs goroutine

install

install apachebench

run

go

  1. go run go_server.go
  • w3m http://localhost:8080/contention?lock=0&print=1

gevent

  • python gevent_echo.py
  • python gevent_counter.py

test

ab

  • normal echo: ab -n 1000 -c 10 'http://localhost:8080/'
  • normal echo with command line output (default is disabled): ab -n 1000 -c 10 'http://localhost:8080/?print=1'
  • contention with lock (default is enabled): ab -n 1000 -c 10 'http://localhost:8080/contention'
  • contention without lock (default is enabled): ab -n 1000 -c 10 'http://localhost:8080/contention?lock=0'
  • maximum spawn: ab -n 10000000 -c 1000000 'http://localhost:8080/contention?sleep=20s'

profile

go

  • visit [http://localhost:6060/debug/pprof/]

reference