Simple golang http rest service hangs under load2019 Community Moderator ElectionGo HTTP server testing ab vs wrk so much difference in resultWhat is the difference between HTTP and REST?REST HTTP status codes for failed validation or invalid duplicatesimple HTTP server in Java using only Java SE APINode.js Http.request slows down under load testing. Am I doing something wrong?“Cross origin requests are only supported for HTTP.” error when loading a local fileGolang: HTTP deployment under WindowsGolang RESTful API load testing causing too many database connectionsGo using mux Router - How to pass my DB to my handlersSend thousands of http requests per secondHow to reply an accepted connection in nats.Subscribe in golang

Maths symbols and unicode-math input inside siunitx commands

Am I eligible for the Eurail Youth pass? I am 27.5 years old

Are dual Irish/British citizens bound by the 90/180 day rule when travelling in the EU after Brexit?

Practical application of matrices and determinants

Constant Current LED Circuit

Violin - Can double stops be played when the strings are not next to each other?

Suggestions on how to spend Shaabath (constructively) alone

Recruiter wants very extensive technical details about all of my previous work

How could an airship be repaired midflight?

Could Sinn Fein swing any Brexit vote in Parliament?

In what cases must I use 了 and in what cases not?

Pronounciation of the combination "st" in spanish accents

PTIJ: Why do we blow Shofar on Rosh Hashana and use a Lulav on Sukkos?

Brake pads destroying wheels

World War I as a war of liberals against authoritarians?

Calculate the frequency of characters in a string

Why are there no stars visible in cislunar space?

Have the tides ever turned twice on any open problem?

Why didn't Héctor fade away after this character died in the movie Coco?

Writing in a Christian voice

What exactly term 'companion plants' means?

Is it true that good novels will automatically sell themselves on Amazon (and so on) and there is no need for one to waste time promoting?

Bash - pair each line of file

두음법칙 - When did North and South diverge in pronunciation of initial ㄹ?



Simple golang http rest service hangs under load



2019 Community Moderator ElectionGo HTTP server testing ab vs wrk so much difference in resultWhat is the difference between HTTP and REST?REST HTTP status codes for failed validation or invalid duplicatesimple HTTP server in Java using only Java SE APINode.js Http.request slows down under load testing. Am I doing something wrong?“Cross origin requests are only supported for HTTP.” error when loading a local fileGolang: HTTP deployment under WindowsGolang RESTful API load testing causing too many database connectionsGo using mux Router - How to pass my DB to my handlersSend thousands of http requests per secondHow to reply an accepted connection in nats.Subscribe in golang










-1















I am trying to test how golang can handle big loads to compare it with our current applications made with Java.



What I did is a simple echo rest service like that (I am adding just the important parts of my code):



// Return default message for root routing
func Index(w http.ResponseWriter, r *http.Request)
fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))


// Main function
func main()

router := mux.NewRouter() //.StrictSlash(true)
router.HandleFunc("/", Index).Methods("GET")
router.HandleFunc("/echo/message", echoHandler(calledServiceURL)).Methods("GET")

log.Println("Running server....")

log.Fatal(http.ListenAndServe(port, router))



I did a test by using ab tool and it worked well with -c 500 -n 500 but when I tried to test with a big load like this



ab -c 500 -n 50000 http://localhost:9596/echo/javier


The process works well for a couple of seconds but then seems it close the tcp connection as I receive the following error:



Benchmarking localhost (be patient)
apr_socket_recv: Connection reset by peer (54)
Total of 501 requests completed


Is is due to a OS limitations that my test reached or is it the limit that my golang app could handle?



Is there a better way to process requests and then avoid the program to close connections? (queue requests or something like that).



Thanks in advance
J










share|improve this question



















  • 1





    usually related to the system configuration (see ulimit and options like that). best to put a rate limiter on your app, anyways.

    – mh-cbon
    Mar 6 at 19:12











  • See stackoverflow.com/questions/31174076/…

    – ThunderCat
    Mar 6 at 20:28











  • Hi Thanks for your reply but unfortunately it is not helping me. I am totally new on golang so I have no idea what do you mean with a rate limiter. Rate limiter of what? sockets open when the http.get connection? Amount of concurrent connections? By the way, I have a similar program written in Java and it works perfectly without any rate setting (but is far slower than my go program).

    – antonof
    Mar 6 at 21:10















-1















I am trying to test how golang can handle big loads to compare it with our current applications made with Java.



What I did is a simple echo rest service like that (I am adding just the important parts of my code):



// Return default message for root routing
func Index(w http.ResponseWriter, r *http.Request)
fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))


// Main function
func main()

router := mux.NewRouter() //.StrictSlash(true)
router.HandleFunc("/", Index).Methods("GET")
router.HandleFunc("/echo/message", echoHandler(calledServiceURL)).Methods("GET")

log.Println("Running server....")

log.Fatal(http.ListenAndServe(port, router))



I did a test by using ab tool and it worked well with -c 500 -n 500 but when I tried to test with a big load like this



ab -c 500 -n 50000 http://localhost:9596/echo/javier


The process works well for a couple of seconds but then seems it close the tcp connection as I receive the following error:



Benchmarking localhost (be patient)
apr_socket_recv: Connection reset by peer (54)
Total of 501 requests completed


Is is due to a OS limitations that my test reached or is it the limit that my golang app could handle?



Is there a better way to process requests and then avoid the program to close connections? (queue requests or something like that).



Thanks in advance
J










share|improve this question



















  • 1





    usually related to the system configuration (see ulimit and options like that). best to put a rate limiter on your app, anyways.

    – mh-cbon
    Mar 6 at 19:12











  • See stackoverflow.com/questions/31174076/…

    – ThunderCat
    Mar 6 at 20:28











  • Hi Thanks for your reply but unfortunately it is not helping me. I am totally new on golang so I have no idea what do you mean with a rate limiter. Rate limiter of what? sockets open when the http.get connection? Amount of concurrent connections? By the way, I have a similar program written in Java and it works perfectly without any rate setting (but is far slower than my go program).

    – antonof
    Mar 6 at 21:10













-1












-1








-1








I am trying to test how golang can handle big loads to compare it with our current applications made with Java.



What I did is a simple echo rest service like that (I am adding just the important parts of my code):



// Return default message for root routing
func Index(w http.ResponseWriter, r *http.Request)
fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))


// Main function
func main()

router := mux.NewRouter() //.StrictSlash(true)
router.HandleFunc("/", Index).Methods("GET")
router.HandleFunc("/echo/message", echoHandler(calledServiceURL)).Methods("GET")

log.Println("Running server....")

log.Fatal(http.ListenAndServe(port, router))



I did a test by using ab tool and it worked well with -c 500 -n 500 but when I tried to test with a big load like this



ab -c 500 -n 50000 http://localhost:9596/echo/javier


The process works well for a couple of seconds but then seems it close the tcp connection as I receive the following error:



Benchmarking localhost (be patient)
apr_socket_recv: Connection reset by peer (54)
Total of 501 requests completed


Is is due to a OS limitations that my test reached or is it the limit that my golang app could handle?



Is there a better way to process requests and then avoid the program to close connections? (queue requests or something like that).



Thanks in advance
J










share|improve this question
















I am trying to test how golang can handle big loads to compare it with our current applications made with Java.



What I did is a simple echo rest service like that (I am adding just the important parts of my code):



// Return default message for root routing
func Index(w http.ResponseWriter, r *http.Request)
fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))


// Main function
func main()

router := mux.NewRouter() //.StrictSlash(true)
router.HandleFunc("/", Index).Methods("GET")
router.HandleFunc("/echo/message", echoHandler(calledServiceURL)).Methods("GET")

log.Println("Running server....")

log.Fatal(http.ListenAndServe(port, router))



I did a test by using ab tool and it worked well with -c 500 -n 500 but when I tried to test with a big load like this



ab -c 500 -n 50000 http://localhost:9596/echo/javier


The process works well for a couple of seconds but then seems it close the tcp connection as I receive the following error:



Benchmarking localhost (be patient)
apr_socket_recv: Connection reset by peer (54)
Total of 501 requests completed


Is is due to a OS limitations that my test reached or is it the limit that my golang app could handle?



Is there a better way to process requests and then avoid the program to close connections? (queue requests or something like that).



Thanks in advance
J







performance http go






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 9 at 8:15









double-beep

2,83541128




2,83541128










asked Mar 6 at 15:00









antonofantonof

202




202







  • 1





    usually related to the system configuration (see ulimit and options like that). best to put a rate limiter on your app, anyways.

    – mh-cbon
    Mar 6 at 19:12











  • See stackoverflow.com/questions/31174076/…

    – ThunderCat
    Mar 6 at 20:28











  • Hi Thanks for your reply but unfortunately it is not helping me. I am totally new on golang so I have no idea what do you mean with a rate limiter. Rate limiter of what? sockets open when the http.get connection? Amount of concurrent connections? By the way, I have a similar program written in Java and it works perfectly without any rate setting (but is far slower than my go program).

    – antonof
    Mar 6 at 21:10












  • 1





    usually related to the system configuration (see ulimit and options like that). best to put a rate limiter on your app, anyways.

    – mh-cbon
    Mar 6 at 19:12











  • See stackoverflow.com/questions/31174076/…

    – ThunderCat
    Mar 6 at 20:28











  • Hi Thanks for your reply but unfortunately it is not helping me. I am totally new on golang so I have no idea what do you mean with a rate limiter. Rate limiter of what? sockets open when the http.get connection? Amount of concurrent connections? By the way, I have a similar program written in Java and it works perfectly without any rate setting (but is far slower than my go program).

    – antonof
    Mar 6 at 21:10







1




1





usually related to the system configuration (see ulimit and options like that). best to put a rate limiter on your app, anyways.

– mh-cbon
Mar 6 at 19:12





usually related to the system configuration (see ulimit and options like that). best to put a rate limiter on your app, anyways.

– mh-cbon
Mar 6 at 19:12













See stackoverflow.com/questions/31174076/…

– ThunderCat
Mar 6 at 20:28





See stackoverflow.com/questions/31174076/…

– ThunderCat
Mar 6 at 20:28













Hi Thanks for your reply but unfortunately it is not helping me. I am totally new on golang so I have no idea what do you mean with a rate limiter. Rate limiter of what? sockets open when the http.get connection? Amount of concurrent connections? By the way, I have a similar program written in Java and it works perfectly without any rate setting (but is far slower than my go program).

– antonof
Mar 6 at 21:10





Hi Thanks for your reply but unfortunately it is not helping me. I am totally new on golang so I have no idea what do you mean with a rate limiter. Rate limiter of what? sockets open when the http.get connection? Amount of concurrent connections? By the way, I have a similar program written in Java and it works perfectly without any rate setting (but is far slower than my go program).

– antonof
Mar 6 at 21:10












1 Answer
1






active

oldest

votes


















1














Do you happen to use OSX? I understand that ab is broken on OSX.



Another thing you could try is to use -k to use the keep alive flag, but that may not be something that you want.



50000 is also close to the maximum number of sockets on an interface, so maybe your sockets are exhausted. Sockets are not directly reusable, because they will be in TIME_WAIT state for a minute or two. Exact value can vary per OS and configuration.



However, the code looks fine too me.



The following code worked fine for me:



package main

import (
"fmt"
"github.com/gorilla/mux"
"log"
"net/http"
)


func Echo(w http.ResponseWriter, r *http.Request)
v := mux.Vars(r)

fmt.Fprintf(w, "Echo %v", v["message"])



func main()

router := mux.NewRouter() //.StrictSlash(true)
router.HandleFunc("/echo/message", Echo).Methods("GET")

log.Println("Running server....")

log.Fatal(http.ListenAndServe("localhost:8080", router))



And gives the following results:



ab -c 500 -n 50000 localhost:8080/echo/foobar
This is ApacheBench, Version 2.3 <$Revision: 1807734 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
Completed 25000 requests
Completed 30000 requests
Completed 35000 requests
Completed 40000 requests
Completed 45000 requests
Completed 50000 requests
Finished 50000 requests


Server Software:
Server Hostname: localhost
Server Port: 8080

Document Path: /echo/foobar
Document Length: 12 bytes

Concurrency Level: 500
Time taken for tests: 2.471 seconds
Complete requests: 50000
Failed requests: 0
Total transferred: 6450000 bytes
HTML transferred: 600000 bytes
Requests per second: 20233.39 [#/sec] (mean)
Time per request: 24.712 [ms] (mean)
Time per request: 0.049 [ms] (mean, across all concurrent requests)
Transfer rate: 2548.93 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 18 122.8 3 1034
Processing: 0 5 14.9 4 225
Waiting: 0 4 14.7 3 222
Total: 1 24 132.7 6 1245

Percentage of the requests served within a certain time (ms)
50% 6
66% 7
75% 7
80% 7
90% 12
95% 20
98% 30
99% 1040
100% 1245 (longest request)


This is executed on Ubuntu 18.04.






share|improve this answer

























  • Hi Patrick Yes, I am using macOS but the one that hangs is my go program, not ab tool.

    – antonof
    Mar 7 at 7:34










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55026118%2fsimple-golang-http-rest-service-hangs-under-load%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














Do you happen to use OSX? I understand that ab is broken on OSX.



Another thing you could try is to use -k to use the keep alive flag, but that may not be something that you want.



50000 is also close to the maximum number of sockets on an interface, so maybe your sockets are exhausted. Sockets are not directly reusable, because they will be in TIME_WAIT state for a minute or two. Exact value can vary per OS and configuration.



However, the code looks fine too me.



The following code worked fine for me:



package main

import (
"fmt"
"github.com/gorilla/mux"
"log"
"net/http"
)


func Echo(w http.ResponseWriter, r *http.Request)
v := mux.Vars(r)

fmt.Fprintf(w, "Echo %v", v["message"])



func main()

router := mux.NewRouter() //.StrictSlash(true)
router.HandleFunc("/echo/message", Echo).Methods("GET")

log.Println("Running server....")

log.Fatal(http.ListenAndServe("localhost:8080", router))



And gives the following results:



ab -c 500 -n 50000 localhost:8080/echo/foobar
This is ApacheBench, Version 2.3 <$Revision: 1807734 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
Completed 25000 requests
Completed 30000 requests
Completed 35000 requests
Completed 40000 requests
Completed 45000 requests
Completed 50000 requests
Finished 50000 requests


Server Software:
Server Hostname: localhost
Server Port: 8080

Document Path: /echo/foobar
Document Length: 12 bytes

Concurrency Level: 500
Time taken for tests: 2.471 seconds
Complete requests: 50000
Failed requests: 0
Total transferred: 6450000 bytes
HTML transferred: 600000 bytes
Requests per second: 20233.39 [#/sec] (mean)
Time per request: 24.712 [ms] (mean)
Time per request: 0.049 [ms] (mean, across all concurrent requests)
Transfer rate: 2548.93 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 18 122.8 3 1034
Processing: 0 5 14.9 4 225
Waiting: 0 4 14.7 3 222
Total: 1 24 132.7 6 1245

Percentage of the requests served within a certain time (ms)
50% 6
66% 7
75% 7
80% 7
90% 12
95% 20
98% 30
99% 1040
100% 1245 (longest request)


This is executed on Ubuntu 18.04.






share|improve this answer

























  • Hi Patrick Yes, I am using macOS but the one that hangs is my go program, not ab tool.

    – antonof
    Mar 7 at 7:34















1














Do you happen to use OSX? I understand that ab is broken on OSX.



Another thing you could try is to use -k to use the keep alive flag, but that may not be something that you want.



50000 is also close to the maximum number of sockets on an interface, so maybe your sockets are exhausted. Sockets are not directly reusable, because they will be in TIME_WAIT state for a minute or two. Exact value can vary per OS and configuration.



However, the code looks fine too me.



The following code worked fine for me:



package main

import (
"fmt"
"github.com/gorilla/mux"
"log"
"net/http"
)


func Echo(w http.ResponseWriter, r *http.Request)
v := mux.Vars(r)

fmt.Fprintf(w, "Echo %v", v["message"])



func main()

router := mux.NewRouter() //.StrictSlash(true)
router.HandleFunc("/echo/message", Echo).Methods("GET")

log.Println("Running server....")

log.Fatal(http.ListenAndServe("localhost:8080", router))



And gives the following results:



ab -c 500 -n 50000 localhost:8080/echo/foobar
This is ApacheBench, Version 2.3 <$Revision: 1807734 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
Completed 25000 requests
Completed 30000 requests
Completed 35000 requests
Completed 40000 requests
Completed 45000 requests
Completed 50000 requests
Finished 50000 requests


Server Software:
Server Hostname: localhost
Server Port: 8080

Document Path: /echo/foobar
Document Length: 12 bytes

Concurrency Level: 500
Time taken for tests: 2.471 seconds
Complete requests: 50000
Failed requests: 0
Total transferred: 6450000 bytes
HTML transferred: 600000 bytes
Requests per second: 20233.39 [#/sec] (mean)
Time per request: 24.712 [ms] (mean)
Time per request: 0.049 [ms] (mean, across all concurrent requests)
Transfer rate: 2548.93 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 18 122.8 3 1034
Processing: 0 5 14.9 4 225
Waiting: 0 4 14.7 3 222
Total: 1 24 132.7 6 1245

Percentage of the requests served within a certain time (ms)
50% 6
66% 7
75% 7
80% 7
90% 12
95% 20
98% 30
99% 1040
100% 1245 (longest request)


This is executed on Ubuntu 18.04.






share|improve this answer

























  • Hi Patrick Yes, I am using macOS but the one that hangs is my go program, not ab tool.

    – antonof
    Mar 7 at 7:34













1












1








1







Do you happen to use OSX? I understand that ab is broken on OSX.



Another thing you could try is to use -k to use the keep alive flag, but that may not be something that you want.



50000 is also close to the maximum number of sockets on an interface, so maybe your sockets are exhausted. Sockets are not directly reusable, because they will be in TIME_WAIT state for a minute or two. Exact value can vary per OS and configuration.



However, the code looks fine too me.



The following code worked fine for me:



package main

import (
"fmt"
"github.com/gorilla/mux"
"log"
"net/http"
)


func Echo(w http.ResponseWriter, r *http.Request)
v := mux.Vars(r)

fmt.Fprintf(w, "Echo %v", v["message"])



func main()

router := mux.NewRouter() //.StrictSlash(true)
router.HandleFunc("/echo/message", Echo).Methods("GET")

log.Println("Running server....")

log.Fatal(http.ListenAndServe("localhost:8080", router))



And gives the following results:



ab -c 500 -n 50000 localhost:8080/echo/foobar
This is ApacheBench, Version 2.3 <$Revision: 1807734 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
Completed 25000 requests
Completed 30000 requests
Completed 35000 requests
Completed 40000 requests
Completed 45000 requests
Completed 50000 requests
Finished 50000 requests


Server Software:
Server Hostname: localhost
Server Port: 8080

Document Path: /echo/foobar
Document Length: 12 bytes

Concurrency Level: 500
Time taken for tests: 2.471 seconds
Complete requests: 50000
Failed requests: 0
Total transferred: 6450000 bytes
HTML transferred: 600000 bytes
Requests per second: 20233.39 [#/sec] (mean)
Time per request: 24.712 [ms] (mean)
Time per request: 0.049 [ms] (mean, across all concurrent requests)
Transfer rate: 2548.93 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 18 122.8 3 1034
Processing: 0 5 14.9 4 225
Waiting: 0 4 14.7 3 222
Total: 1 24 132.7 6 1245

Percentage of the requests served within a certain time (ms)
50% 6
66% 7
75% 7
80% 7
90% 12
95% 20
98% 30
99% 1040
100% 1245 (longest request)


This is executed on Ubuntu 18.04.






share|improve this answer















Do you happen to use OSX? I understand that ab is broken on OSX.



Another thing you could try is to use -k to use the keep alive flag, but that may not be something that you want.



50000 is also close to the maximum number of sockets on an interface, so maybe your sockets are exhausted. Sockets are not directly reusable, because they will be in TIME_WAIT state for a minute or two. Exact value can vary per OS and configuration.



However, the code looks fine too me.



The following code worked fine for me:



package main

import (
"fmt"
"github.com/gorilla/mux"
"log"
"net/http"
)


func Echo(w http.ResponseWriter, r *http.Request)
v := mux.Vars(r)

fmt.Fprintf(w, "Echo %v", v["message"])



func main()

router := mux.NewRouter() //.StrictSlash(true)
router.HandleFunc("/echo/message", Echo).Methods("GET")

log.Println("Running server....")

log.Fatal(http.ListenAndServe("localhost:8080", router))



And gives the following results:



ab -c 500 -n 50000 localhost:8080/echo/foobar
This is ApacheBench, Version 2.3 <$Revision: 1807734 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
Completed 25000 requests
Completed 30000 requests
Completed 35000 requests
Completed 40000 requests
Completed 45000 requests
Completed 50000 requests
Finished 50000 requests


Server Software:
Server Hostname: localhost
Server Port: 8080

Document Path: /echo/foobar
Document Length: 12 bytes

Concurrency Level: 500
Time taken for tests: 2.471 seconds
Complete requests: 50000
Failed requests: 0
Total transferred: 6450000 bytes
HTML transferred: 600000 bytes
Requests per second: 20233.39 [#/sec] (mean)
Time per request: 24.712 [ms] (mean)
Time per request: 0.049 [ms] (mean, across all concurrent requests)
Transfer rate: 2548.93 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 18 122.8 3 1034
Processing: 0 5 14.9 4 225
Waiting: 0 4 14.7 3 222
Total: 1 24 132.7 6 1245

Percentage of the requests served within a certain time (ms)
50% 6
66% 7
75% 7
80% 7
90% 12
95% 20
98% 30
99% 1040
100% 1245 (longest request)


This is executed on Ubuntu 18.04.







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 6 at 22:38

























answered Mar 6 at 22:08









Patrick VollebregtPatrick Vollebregt

414




414












  • Hi Patrick Yes, I am using macOS but the one that hangs is my go program, not ab tool.

    – antonof
    Mar 7 at 7:34

















  • Hi Patrick Yes, I am using macOS but the one that hangs is my go program, not ab tool.

    – antonof
    Mar 7 at 7:34
















Hi Patrick Yes, I am using macOS but the one that hangs is my go program, not ab tool.

– antonof
Mar 7 at 7:34





Hi Patrick Yes, I am using macOS but the one that hangs is my go program, not ab tool.

– antonof
Mar 7 at 7:34



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55026118%2fsimple-golang-http-rest-service-hangs-under-load%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

1928 у кіно

Захаров Федір Захарович

Ель Греко