ConnectException: connection timed out: computer-database.gatling.io/35.158.229.206:80

981 views
Skip to first unread message

Alexander Tunick

unread,
Oct 17, 2017, 7:57:03 AM10/17/17
to Gatling User Group
Hello guys. I'm new in gatling and now experimenting with Gatling on its website  computer-database.gatling.io

Everything is working fine and i'm going to apply load test for my project at work in few days, but one problem, 
I need 2000 users/per second for my website (it seems not a big deal for gatling as I read on other recourses) 

I have this simple code:  where I want to load 250 users/admins during 300 seconds, and now issues and questions (Please, help me figure this out)
When I've started this script:


package load


import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.core.structure.ChainBuilder
import io.gatling.jdbc.Predef.jdbcFeeder
import scala.util.Random
import scala.concurrent.duration._

class TestOvo extends Simulation {

 val httpProtocol
= http
 
.baseURL("http://computer-database.gatling.io")
 
.acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8")
 
.acceptEncodingHeader("gzip, deflate")
 
.acceptLanguageHeader("en-US,en;q=0.8")
 
.userAgentHeader("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36")

 val headers_0
= Map("Upgrade-Insecure-Requests" -> "1")

 val headers_10
= Map(
 
"Origin" -> "http://computer-database.gatling.io",
 
"Upgrade-Insecure-Requests" -> "1")

 
object Search {
 val search
= exec(http("request_0")
 
.get("/")
 
.headers(headers_0))
 
.pause(1)
 
.exec(http("request_1")
 
.get("/computers?f=macbook")
 
.headers(headers_0))
 
.pause(2)
 
.exec(http("request_2")
 
.get("/computers/89")
 
.headers(headers_0))
 
.pause(2)
 
.exec(http("request_3")
 
.get("/")
 
.headers(headers_0))
 
.pause(2)
 
}
 
object Browse {
 val browse
= exec(http("request_4")
 
.get("/computers?p=1")
 
.headers(headers_0))
 
.pause(1)
 
.exec(http("request_5")
 
.get("/computers?p=2")
 
.headers(headers_0))
 
.pause(1)
 
.exec(http("request_6")
 
.get("/computers?p=3")
 
.headers(headers_0))
 
.pause(2)
 
.exec(http("request_7")
 
.get("/computers?p=4")
 
.headers(headers_0)
 
.resources(http("request_8")
 
.get("/computers?p=5")
 
.headers(headers_0)))
 
.pause(1)
 
}

 
object Edit {
 val edit
= exec(http("request_9")
 
.get("/computers/new")
 
.headers(headers_0))
 
.pause(1)
 
.exec(http("request_10")
 
.post("/computers")
 
.headers(headers_10)
 
.formParam("name", "VoxooBox")
 
.formParam("introduced", "12.11.2017")
 
.formParam("discontinued", "")
 
.formParam("company", "16")
 
.check(status.is(400)))
 
.pause(1)
 
.exec(http("request_11")
 
.post("/computers")
 
.headers(headers_10)
 
.formParam("name", "VoxooBox")
 
.formParam("introduced", "2017.08.17")
 
.formParam("discontinued", "")
 
.formParam("company", "16")
 
.check(status.is(400)))
 
.pause(1)
 
.exec(http("request_12")
 
.post("/computers")
 
.headers(headers_10)
 
.formParam("name", "VoxooBox")
 
.formParam("introduced", "2017-08-17")
 
.formParam("discontinued", "")
 
.formParam("company", "16"))
 
}

 val users
= scenario("Users").exec(Search.search, Browse.browse);
 val admins
= scenario("Admins").exec(Search.search, Browse.browse, Edit.edit);

 setUp
(
 users
.inject(constantUsersPerSec(200) during (300 seconds)),
 admins
.inject(constantUsersPerSec(50) during (300 seconds))
 
).protocols(httpProtocol)

}

it goes maximum to indicator of users:
 

================================================================================

2017-10-17 14:47:20                                          25s elapsed

---- Requests ------------------------------------------------------------------

> Global                                                   (OK=15950  KO=0     )

> request_0                                                (OK=5046   KO=0     )

> request_0 Redirect 1                                     (OK=3829   KO=0     )

> request_1                                                (OK=2582   KO=0     )

> request_2                                                (OK=1589   KO=0     )

> request_3                                                (OK=1249   KO=0     )

> request_3 Redirect 1                                     (OK=897    KO=0     )

> request_4                                                (OK=423    KO=0     )

> request_5                                                (OK=224    KO=0     )

> request_6                                                (OK=88     KO=0     )

> request_7                                                (OK=17     KO=0     )

> request_8                                                (OK=6      KO=0     )


---- Users ---------------------------------------------------------------------

[------                                                                    ]  0%

          waiting
: 55156  / active: 4842   / done:2    

---- Admins --------------------------------------------------------------------

[------                                                                    ]  0%

          waiting
: 13788  / active: 1212   / done:0    

================================================================================

14:47:21.107 [WARN ] i.g.h.a.ResponseProcessor - Request 'request_5' failed: j.n.ConnectException: connection timed out: computer-database.gatling.io/35.158.229.206:80



And then arise these kind of errors:

[WARN ] i.g.h.a.ResponseProcessor - Request 'request_4' failed: j.n.ConnectException: connection timed out: computer-database.gatling.io/35.158.229.206:80

13:31:12.407 [WARN ] i.g.h.a.ResponseProcessor - Request 'request_4' failed: j.n.ConnectException: Failed to open a socket.

In gatling.conf I found these rows:


ahc {
#keepAlive = true # Allow pooling HTTP connections (keep-alive header automatically added)
#connectTimeout = 10000 # Timeout when establishing a connection
#handshakeTimeout = 10000 # Timeout when performing TLS hashshake
#pooledConnectionIdleTimeout = 60000 # Timeout when a connection stays unused in the pool
#readTimeout = 60000 # Timeout when a used connection stays idle
#maxRetry = 2 # Number of times that a request should be tried again
#requestTimeout = 60000 # Timeout of the requests
#acceptAnyCertificate = true # When set to true, doesn't validate SSL certificates
#httpClientCodecMaxInitialLineLength = 4096 # Maximum length of the initial line of the response (e.g. "HTTP/1.0 200 OK")
#httpClientCodecMaxHeaderSize = 8192 # Maximum size, in bytes, of each request's headers
#httpClientCodecMaxChunkSize = 8192 # Maximum length of the content or each chunk
#webSocketMaxFrameSize = 10240000 # Maximum frame payload size

i guess it may be somehow related to my issue, or what i'm doing wrong? Is that my side-issue or their website just can't take it?


And why when I launch
 users.inject(constantUsersPerSec(200) during (300 seconds)),
 admins
.inject(constantUsersPerSec(50) during (300 seconds))

In terminal it's 
waiting: 55156  / active: 4842   / done:2
 waiting: 13788  / active: 1212   / done:0 

so many? How is it calculated? or why at all, explain someone to me, please.
Thanks. 

My Computer:
MAC OS
Version: 10.12.6 (
Processor: 2.6 GHz Intel Core i5
Memory: 8 GB 1600 MHz DDR3

Stéphane LANDELLE

unread,
Oct 17, 2017, 8:12:29 AM10/17/17
to gat...@googlegroups.com
Hello,

Please realize that you're you're hammering a demo app we provide for our tutorials.
Not only do we gracefully pay for hosting and bandwidth costs, but this instance is shared with all other newcomers who try to complete those tutorials.

If you want to hammer a server at 600 requests per second, please use your own.

Thanks,


Stéphane Landelle
GatlingCorp CEO


--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alexander Tunick

unread,
Oct 17, 2017, 8:20:12 AM10/17/17
to Gatling User Group
Stéphane thanks for your incredibly swift reply, If i get you right, you mean i use computer-database.gatling.io. and this number of users is over for hammering?
So if I use for instance any(almost) other websites it's going to be ok? 

2) And second question then, why number of users is different in here:

And why when I launch
 users.inject(constantUsersPerSec(200) during (300 seconds)),
 admins
.inject(constantUsersPerSec(50) during (300 seconds))

In terminal it's 
waiting: 55156  / active: 4842   / done:2
 waiting: 13788  / active: 1212   / done:0

To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.

Barry Perez

unread,
Oct 18, 2017, 2:38:43 AM10/18/17
to Gatling User Group

The general rule is not to load test against a site that you don't own or have permission to generate load against!

Clearly the demp app isn't scaled to handle that level of load. Try this sort of thing against your own internally hosted apps.

alexande...@itrexgroup.com

unread,
Oct 18, 2017, 3:53:17 AM10/18/17
to Gatling User Group
Barry Perez, Thanks, I got it. But one more question still stays opened, about number of users I launch 
Or do in need to create the separate topic for this?
users.inject(constantUsersPerSec(200) during (300 seconds)),
 admins
.inject(constantUsersPerSec(50) during (300 seconds))

In terminal it's 
waiting: 55156  / active: 4842   / done:2
 waiting: 13788  / active: 1212   / done:0

On idea it's going to be 250 users during 300 seconds, no more no less,
but why in terminal here is:

Lewis Cawthorne

unread,
Oct 19, 2017, 10:17:01 AM10/19/17
to Gatling User Group

I'm a newbie too, but it looks like your doing 200 users per second over 300 seconds, which is 300 * 200=60000 normal users, then doing 50 * 300 = 15000 admin users, which is why the terminal shows waiting 55156 + active 4842 = 60000 total and 13788 + 1212 = 15000 admin total.

alexande...@itrexgroup.com

unread,
Oct 19, 2017, 10:47:06 AM10/19/17
to Gatling User Group
Yeah, pretty logical, thank you, Lewis!
Reply all
Reply to author
Forward
0 new messages