Are there any performance issues when running Golang applications on an elastic beanstalk?

I am trying to compare hello world's simple http server go. I did 2 tests:

  • Using an instance of amazon ec2 - m3.medium
  • Using Amazon's elastic beanstalk - also with one instance of m3.medium

In the first setup, I could get up to 18k req / sec. On the second, 1.6k req / sec.

Source Code: (from: https://golang.org/doc/articles/wiki/ )

package main

import (
    "fmt"
    "net/http"
)

func handler(w http.ResponseWriter, r *http.Request) {
    fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:])
}

func main() {
    http.HandleFunc("/", handler)
    http.ListenAndServe(":8080", nil)
}

Is there any explanation for such a huge difference in performance?

PS: : https://github.com/wg/wrk
, : beanstalk nginx ( Go apps ) nginx.

+4
1

: . - Go, Beanstalk Nginx - Go.

:

AWS Elastic Beanstalk , , EC2. Beanstalk .

Beanstalk, nginx ( ). Nginx , , m3.medium.

, , Beanstalk, . , - Go.


, , . wrk EC2 m3.medium , .

Go Beanstalk, EC2, NGINX , Beanstalk.

./wrk http://<server>/ --duration 20s --connections 300

Beanstalk m3.medium instance DIRECT:  9230.52 Requests / sec
Beanstalk m3.medium instance NGINX:   1502.14 Requests / sec
EC2 m3.medium instance DIRECT:       13649.46 Requests / sec
EC2 m3.medium instance NGINX:         2489.78 Requests / sec
+2

Source: https://habr.com/ru/post/1669726/


All Articles