# Goose Attack against a Genie App

**URL:** <https://discourse.julialang.org/t/goose-attack-against-a-genie-app/63541>\
**Category:** Web Stack\
**Tags:** genie\
**Created:** [June 25, 2021, 10:36am UTC](https://discourse.julialang.org/t/goose-attack-against-a-genie-app/63541 "2021-06-25T10:36:18Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [June 25, 2021, 10:17pm UTC](https://discourse.julialang.org/t/goose-attack-against-a-genie-app/63541/21 "2021-06-25T22:17:37Z")

</div>

Is it possible to obtain something like the 6 ms that @StatisticalMouse was reporting?

---

<div class="post-metadata">

**Author:** ![essenciary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/essenciary/32/210469_2.png) [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Post date:** [June 25, 2021, 10:21pm UTC](https://discourse.julialang.org/t/goose-attack-against-a-genie-app/63541/22 "2021-06-25T22:21:03Z")

</div>

Let’s see!

@StatisticalMouse Please find PR here

> <https://github.com/StatisticalMice/performance-tests/pull/1>
>
> This setup produced the best performance on my machine.

---

<div class="post-metadata">

**Author:** ![essenciary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/essenciary/32/210469_2.png) [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Post date:** [June 25, 2021, 10:29pm UTC](https://discourse.julialang.org/t/goose-attack-against-a-genie-app/63541/23 "2021-06-25T22:29:46Z")

</div>

Single threaded (removing --threads=auto which resulted in 8 threads) makes it even faster. I wonder why…

And the same is true for HTTP.jl (72ms at 8 threads vs 69 single threaded).

Genie prod own renderers single threaded:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/f/e/fe4758ae06b9cab4d60450d394ab8bb514fb3afb.png)

---

<div class="post-metadata">

**Author:** ![StatisticalMouse](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/statisticalmouse/32/43370_2.png) [@StatisticalMouse](https://discourse.julialang.org/u/StatisticalMouse)\
**Post date:** [June 26, 2021, 8:43am UTC](https://discourse.julialang.org/t/goose-attack-against-a-genie-app/63541/24 "2021-06-26T08:43:42Z")

</div>

> [@essenciary](#):
>
> I’m not sure about the errors, seem to be coming from Rust, Goose outputs a lot of:
> 
> ```julia
> 21:58:29 [WARN] "/": error sending request for url (http://127.0.0.1:8000/): error trying to connect: tcp connect error: Only one usage of each socket address (protocol/network address/port) is normally permitted. (os error 10048)
> 
> ```

The errors produced on Rust side on Mac are below for easy finding with Google.

```julia
error sending request for url (http://127.0.0.1:8000/): error trying to connect: tcp connect error: Operation timed out (os error 60)

```

and

```julia
error sending request for url (http://127.0.0.1:11000/): error trying to connect: tcp connect error: Can't assign requested address (os error 49)

```

The errors produced on Julia side are

```julia
┌ Error: 2021-06-26 11:34:25 Base.IOError("stream is closed or unusable", 0)
└ @ Genie.AppServer ~/.julia/packages/Genie/Uvtzb/src/AppServer.jl:93

```

and

```julia
┌ Error: error handling request
│ exception =
│ IOError: stream is closed or unusable
│ Stacktrace:
│ [1] check_open
│ @ ./stream.jl:386 [inlined]
│ [2] uv_write_async(s::TCPSocket, p::Ptr{UInt8}, n::UInt64)
│ @ Base ./stream.jl:1018
│ [3] uv_write(s::TCPSocket, p::Ptr{UInt8}, n::UInt64)
│ @ Base ./stream.jl:981
│ [4] unsafe_write(s::TCPSocket, p::Ptr{UInt8}, n::UInt64)
│ @ Base ./stream.jl:1064
│ [5] unsafe_write
│ @ ~/.julia/packages/HTTP/CGviq/src/ConnectionPool.jl:174 [inlined]
│ [6] write
│ @ ./strings/io.jl:185 [inlined]
│ [7] write
│ @ ./io.jl:637 [inlined]
│ [8] unsafe_write(http::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Transaction{TCPSocket}}, p::Ptr{UInt8}, n::UInt64)
│ @ HTTP.Streams ~/.julia/packages/HTTP/CGviq/src/Streams.jl:110
│ [9] unsafe_write
│ @ ./io.jl:646 [inlined]
│ [10] write
│ @ ./io.jl:669 [inlined]
│ [11] handle(::HTTP.Handlers.RequestHandlerFunction{typeof(serveWelcome)}, ::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Transaction{TCPSocket}})
│ @ HTTP.Handlers ~/.julia/packages/HTTP/CGviq/src/Handlers.jl:280
│ [12] handle(::HTTP.Handlers.Router{Symbol("##257")}, ::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Transaction{TCPSocket}})
│ @ HTTP.Handlers ~/.julia/packages/HTTP/CGviq/src/Handlers.jl:467
│ [13] #4
│ @ ~/.julia/packages/HTTP/CGviq/src/Handlers.jl:346 [inlined]
│ [14] macro expansion
│ @ ~/.julia/packages/HTTP/CGviq/src/Servers.jl:413 [inlined]
│ [15] (::HTTP.Servers.var"#13#14"{HTTP.Handlers.var"#4#5"{HTTP.Handlers.Router{Symbol("##257")}}, HTTP.ConnectionPool.Transaction{TCPSocket}, HTTP.Servers.Server{Nothing, Sockets.TCPServer}, HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Transaction{TCPSocket}}})()
│ @ HTTP.Servers ./task.jl:411
└ @ HTTP.Servers ~/.julia/packages/HTTP/CGviq/src/Servers.jl:424

```

---

<div class="post-metadata">

**Author:** ![essenciary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/essenciary/32/210469_2.png) [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Post date:** [June 26, 2021, 3:56pm UTC](https://discourse.julialang.org/t/goose-attack-against-a-genie-app/63541/25 "2021-06-26T15:56:30Z")

</div>

Yes, the stream closed error comes from HTTP.jl - I think it’s going to go away in the next release.

[Previous page](https://discourse.julialang.org/t/goose-attack-against-a-genie-app/63541.md?page=1)
