get-pure-port/headers very slow

29 views
Skip to first unread message

P. Baillet

unread,
Jan 24, 2019, 5:07:17 PM1/24/19
to Racket Users

Hello Racketeers,

With Racket 7.1 on macOS, the following snippet takes some time to run:

#lang racket
(require net/url)
(require net/url-string)
(get-pure-port/headers (string->url "https://video.blender.org"))
time racket plop.rkt
#<input-port:pipe>
"Access-Control-Allow-Origin: *\r\nContent-Length: 13080\r\nContent-Type: text/html; charset=utf-8\r\nDate: Thu, 24 Jan 2019 22:03:48 GMT\r\nEtag: W/\"3318-iMh3Y+6f+0qSo/4RXYkvd/3uy68\"\r\nTk: N\r\nX-Content-Type-Options: nosniff\r\nX-Dns-Prefetch-Control: off\r\nX-Download-Options: noopen\r\nX-Frame-Options: DENY\r\nX-Xss-Protection: 1; mode=block\r\n\r\n"
       76.40 real         0.43 user         0.11 sys

The same request with curl takes around 3ms server side and less than 1s term time.

What’s the right way to investigate this issue?

Thanks for your time,

P.

Sam Tobin-Hochstadt

unread,
Jan 24, 2019, 5:18:29 PM1/24/19
to P. Baillet, Racket Users
I investigated this (on linux) by killing the process after 1 and
after 10 seconds, and both were in the `ssl-connect` function in
`openssl/mzssl`. So my guess is it's something there.

Sam
> --
> You received this message because you are subscribed to the Google Groups "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Neil Van Dyke

unread,
Jan 24, 2019, 6:02:01 PM1/24/19
to P. Baillet, Racket Users
P. Baillet wrote on 1/24/19 5:07 PM:
> The same request with |curl| takes around 3ms server side and less
> than 1s term time.
>
> What’s the right way to investigate this issue?
>

One way to start is to run Wireshark (or tcpdump, or similar), and watch
the network traffic, for both cases (curl and Racket).  You don't
necessarily need the client key to start debugging with Wireshark.  For
example, maybe it will show that one host in one case is not responding
quickly at the TCP or TLS/SSL level, or the protocol is stalled at a
particular point, or one case is waiting on DNS that the other doesn't,
or the two cases are doing different protocol, or only one case is going
through a proxy, etc.  Then you can go from there.

If you're using Wireshark for the first time, it might look intimidating
at first, but, once you see the few buttons to press to capture a trace
and watch it live, it has a good chance of being a great way to start
debugging this kind of problem.

Greg Hendershott

unread,
Jan 24, 2019, 11:08:34 PM1/24/19
to P. Baillet, Racket Users
Trying now, it finishes within 1 second for me. I tried on macOS with
all of 6.10, 7.1, and a recent-ish build of HEAD, 7.2.0.2.
Reply all
Reply to author
Forward
0 new messages