Could be many things, but a few to think about: If you run more Go routines than you have CPUs available, and the task is CPU bound (which may be if the url points to a local resource), then you are going to thrash, causing worse performance.
The service you are calling is not properly concurrent, so the more simultaneously requests, the worse it performs. You are hitting network/router limits, so it is dropping packets, causing worse performance due to TCP retries and/or smaller window sizes. > On Feb 8, 2019, at 2:09 PM, Valentin Vidic <[email protected]> wrote: > > Hi, > > Can someone help me figure out why the performance (request rate) > of this program goes down when I add more gorutines? > > $ ./gb -duration 15s -parallel 5 http://nginx > Running 5 parallel clients for 15s... > Requests: 217998 > Rate: 14533.2/s > Bytes: 133414776 > Code[200]: 217998 > > $ ./gb -duration 15s -parallel 20 http://nginx > Running 20 parallel clients for 15s... > Requests: 155150 > Rate: 10343.3/s > Bytes: 94951800 > Code[200]: 155150 > > -- > Valentin > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > <gb.go> -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
