Goose Attack against a Genie App

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

Let’s see!

@StatisticalMouse Please find PR here

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:

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

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

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

β”Œ 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

β”Œ 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

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

1 Like