[Resolved] Is mbedtls on ESP32 particularly slow?
Posted: Wed Jan 04, 2017 10:44 pm
Ive been playing with the mbedtls libraries for SSL and my experiments are still in early days ... however, I seem to be finding that transmissions and receptions appear "slow". In my tests, I am sending an HTTP "GET /get" to "httpbin.org" ... and it is all working ... just with pauses ... here is a trace of the traffic at the ESP32 log level:
What we find is about 30 seconds to get my response back. There are a number of long pauses in this trace ... some as high as 16 seconds. Obviously, when looking at such traces, one has to ask how long the back-end is taking to respond ... and I haven't done that leg work yet. However, the purpose of this post is to see if others have worked with mbedtls and have seen any "slowness" ... if no, then that would point to my environment.
Code: Select all
D (21509) ssl: >> js_ssl_write
D (21511) ssl: About to send data over SSL: GET /get HTTP/1.1
Host: www.example.org
D (21521) ssl: >> ssl_send
D (21523) ssl: << ssl_send: fd=0, rc=404
D (21525) ssl: >> ssl_recv: max_length=5
D (27179) ssl: << ssl_recv: fd=0, rc=5
D (27179) ssl: >> ssl_recv: max_length=61
D (27179) ssl: << ssl_recv: fd=0, rc=61
D (27180) ssl: >> ssl_recv: max_length=5
D (27182) ssl: << ssl_recv: fd=0, rc=5
D (27186) ssl: >> ssl_recv: max_length=4327
D (27190) ssl: << ssl_recv: fd=0, rc=4327
D (27197) ssl: >> ssl_recv: max_length=5
D (27197) ssl: << ssl_recv: fd=0, rc=5
D (27201) ssl: >> ssl_recv: max_length=333
D (27204) ssl: << ssl_recv: fd=0, rc=333
V (27210) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (27214) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xE
D (27222) intr_alloc: Connected src 51 to int 12 (cpu 0)
D (27320) ssl: >> ssl_recv: max_length=5
D (27320) ssl: << ssl_recv: fd=0, rc=5
D (27320) ssl: >> ssl_recv: max_length=4
D (27320) ssl: << ssl_recv: fd=0, rc=4
D (28416) ssl: >> ssl_send
D (28418) ssl: << ssl_send: fd=0, rc=75
D (28428) ssl: >> ssl_send
D (28429) ssl: << ssl_send: fd=0, rc=6
D (28432) ssl: >> ssl_send
D (28432) ssl: << ssl_send: fd=0, rc=45
D (28432) ssl: >> ssl_recv: max_length=5
D (44911) ssl: << ssl_recv: fd=0, rc=5
D (44912) ssl: >> ssl_recv: max_length=202
D (44912) ssl: << ssl_recv: fd=0, rc=202
D (44912) ssl: >> ssl_recv: max_length=5
D (44915) ssl: << ssl_recv: fd=0, rc=5
D (44918) ssl: >> ssl_recv: max_length=1
D (44922) ssl: << ssl_recv: fd=0, rc=1
D (44928) ssl: >> ssl_recv: max_length=5
D (44929) ssl: << ssl_recv: fd=0, rc=5
D (44933) ssl: >> ssl_recv: max_length=40
D (44936) ssl: << ssl_recv: fd=0, rc=40
D (44941) ssl: >> ssl_send
D (44943) ssl: << ssl_send: fd=0, rc=73
D (44946) ssl: << js_ssl_write: rc=44
D (50001) log: selectResult: {"readfds":[0],"writefds":[],"exceptfds":[]}
D (50002) log: loop: working on ready to read of fd=0
D (50004) ssl: >> js_ssl_read
D (50005) ssl: >> ssl_recv: max_length=5
D (50009) ssl: << ssl_recv: fd=0, rc=5
D (50012) ssl: >> ssl_recv: max_length=383
D (50016) ssl: << ssl_recv: fd=0, rc=383
D (50020) ssl: << js_ssl_read: rc=359
D (50023) log: Length of data from recv: 359
D (50028) log: SSL socket got some data!: HTTP/1.1 200 OK
Server: nginx
Date: Wed, 04 Jan 2017 22:37:26 GMT
Content-Type: application/json
Content-Length: 139
Connection: keep-alive
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
{
"args": {},
"headers": {
"Host": "www.example.org"
},
"origin": "47.32.225.189",
"url": "https://www.example.org/get"
}