Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http: connection timed out using siege, but not sure why... #5455

Closed
gopherbot opened this issue May 13, 2013 · 3 comments
Closed

net/http: connection timed out using siege, but not sure why... #5455

gopherbot opened this issue May 13, 2013 · 3 comments

Comments

@gopherbot
Copy link

by chris@altonymous.com:

This issue is found using 1.0.3, 1.1 rc1, & 1.1 rc3

Here's what I'm finding...  I saw the ab issue, but I'm not sure it's related.

I'm using a simple web app..

package main

import (
  "encoding/json"
  "net/http"
)

// structs
type Reading struct {
  Id   string `json:"id"`
  Name string `json:"name"`
}

func main() {
http.HandleFunc("/machines/", func(w http.ResponseWriter, r *http.Request) {
  // Setup readings
  readings := prepareReadings()

  // return readings
  w.Write([]byte(readingsToString(readings)))
})
  http.ListenAndServe(":3000", nil)
}

func readingsToString(readings []Reading) string {
  data, err := json.Marshal(readings)
  if err != nil {
    panic(err)
  }

  return string(data)
}

func prepareReadings() []Reading {
  var readings []Reading
  for i := 1; i <= 1; i++ {
    readings = append(readings, Reading{Name: "Thing"})
  }

  return readings
}


As you can see not much to it.  I've setup multiple load generation servers that are
separate from the web server itself.  So in total I have 17 machines.  1 web server, and
16 load generation servers.  On the load generation servers I am using siege, not ab.  

Running this command on all servers: siege -v "http://192.168.122.31:3000/machines/
POST" -c 500 -r 100 -b

Causes me to start getting connection timed out messages.

My file descriptor limits for the web server are pretty high...

[api #3312 -- limits]
Limit                     Soft Limit           Hard Limit           Units
Max cpu time              unlimited            unlimited            seconds
Max file size             unlimited            unlimited            bytes
Max data size             unlimited            unlimited            bytes
Max stack size            8388608              unlimited            bytes
Max core file size        0                    unlimited            bytes
Max resident set          unlimited            unlimited            bytes
Max processes             59479                59479                processes
Max open files            4999999              4999999              files
Max locked memory         65536                65536                bytes
Max address space         unlimited            unlimited            bytes
Max file locks            unlimited            unlimited            locks
Max pending signals       59479                59479                signals
Max msgqueue size         819200               819200               bytes
Max nice priority         0                    0
Max realtime priority     0                    0
Max realtime timeout      unlimited            unlimited            us

When I use the command 'lsof | wc -l', I dont' get above 1000. Generally in the ~800-850
range.

When I use the command 'watch --interval=2 'netstat -tuna |grep "SYN_RECV"|wc
-l'', I am generally in the ~130-250 range.

I'm not sure if this is related, or possibly a problem with siege at this point.

Any advice?
@davecheney
Copy link
Contributor

Comment 1:

Are you running out of ephemeral ports ? Are you hitting issues with too many
connections int TIME_WAIT ?

Status changed to WaitingForReply.

@davecheney
Copy link
Contributor

Comment 2:

ping.

@davecheney
Copy link
Contributor

Comment 3:

Please reopen this issue if you are able to reproduce it with the current release
version.

Status changed to TimedOut.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants