HTTPD Performance

allard
Posts: 5
Joined: Fri Dec 20, 2019 11:01 am

HTTPD Performance

Postby allard » Fri Feb 12, 2021 10:36 am

I'm testing the rest-server example and i'm wondering why the HTTPD performance is so low. It seems to be stuck in the "transfer start" phase way to long.
This is a example of a GET request to api/v1/system/info, which returns static info, without any slow filesystem stuff (SPIFFS), but it is still slow:
Image
My board is connect trough ethernet, so the download speed should be low, and this shows.
The log shows the following during this request:

Code: Select all

D (270973) httpd: httpd_server: processing socket 57
D (270973) httpd_sess: httpd_sess_process: httpd_req_new
D (270975) httpd_txrx: httpd_recv_with_opt: requested length = 128
D (270982) httpd_txrx: httpd_recv_with_opt: received length = 128
D (270987) httpd_parse: read_block: received HTTP request block size = 128
D (270995) httpd_parse: cb_url: message begin
D (270999) httpd_parse: cb_url: processing url = /api/v1/system/info
D (271005) httpd_parse: verify_url: received URI = /api/v1/system/info
D (271012) httpd_parse: cb_header_field: headers begin
D (271017) httpd_txrx: httpd_unrecv: length = 94
D (271022) httpd_parse: pause_parsing: paused
D (271026) httpd_parse: cb_header_field: processing field = Connection
D (271033) httpd_txrx: httpd_recv_with_opt: requested length = 128
D (271039) httpd_txrx: httpd_recv_with_opt: pending length = 94
D (271045) httpd_parse: read_block: received HTTP request block size = 94
D (271047) emac_esp32: receive len= 60
D (271053) httpd_parse: continue_parsing: skip pre-parsed data of size = 11
D (271063) httpd_parse: continue_parsing: un-paused
D (271068) httpd_parse: cb_header_value: processing value = close
D (271074) httpd_parse: cb_header_field: processing field = User-Agent
D (271080) httpd_parse: cb_header_value: processing value = PostmanRuntime/7.26.8
D (271088) httpd_parse: cb_header_field: processing field = Accept
D (271094) httpd_parse: cb_header_value: processing value = */*
D (271100) httpd_parse: cb_header_field: processing field = Cache-Control
D (271107) httpd_parse: cb_header_value: processing value = no-cache
D (271113) httpd_parse: cb_header_field: processing field = Po
D (271119) httpd_parse: parse_block: parsed block size = 94
D (271125) httpd_txrx: httpd_recv_with_opt: requested length = 128
D (271132) httpd_txrx: httpd_recv_with_opt: received length = 115
D (271137) httpd_parse: read_block: received HTTP request block size = 115
D (271144) httpd_parse: cb_header_field: processing field = stman-Token
D (271151) httpd_parse: cb_header_value: processing value = 1c9e65d8-c93a-4368-8eab-dd1e4e12d55e
D (271160) httpd_parse: cb_header_field: processing field = Host
D (271166) httpd_parse: cb_header_value: processing value = esp.local
D (271173) httpd_parse: cb_header_field: processing field = Accept-Encoding
D (271180) httpd_parse: cb_header_value: processing value = gzip, deflate, br
D (271188) httpd_parse: cb_headers_complete: bytes read     = 244
D (271194) httpd_parse: cb_headers_complete: content length = 0
D (271200) httpd_parse: pause_parsing: paused
D (271204) httpd_parse: cb_no_body: message complete
D (271209) httpd_parse: httpd_parse_req: parsing complete
D (271215) httpd_uri: httpd_uri: request for /api/v1/system/info with type 1
D (271222) httpd_uri: httpd_find_uri_handler: [0] = /api/v1/system/info
D (271229) efuse: coding scheme 0
D (271232) efuse: In EFUSE_BLK0__DATA3_REG is used 1 bits starting with 15 bit
D (271239) efuse: coding scheme 0
D (271242) efuse: In EFUSE_BLK0__DATA5_REG is used 1 bits starting with 20 bit
D (271252) httpd_txrx: httpd_send_all: sent = 69
D (271255) httpd_txrx: httpd_send_all: sent = 2
D (271259) httpd_txrx: httpd_send_all: sent = 43
D (271264) httpd_sess: httpd_sess_process: httpd_req_delete
D (271269) httpd_sess: httpd_sess_process: success
D (271274) httpd: httpd_server: doing select maxfd+1 = 58

Any idea's to improve the performance?

boarchuz
Posts: 606
Joined: Tue Aug 21, 2018 5:28 am

Re: HTTPD Performance

Postby boarchuz » Fri Feb 12, 2021 1:05 pm

Set a lower logging level

allard
Posts: 5
Joined: Fri Dec 20, 2019 11:01 am

Re: HTTPD Performance

Postby allard » Tue Feb 16, 2021 8:31 am

Yep, this fixed it, with lower logging levels we reach around 60ms, still a bit high for a 240MHz dual core, but acceptable.

Who is online

Users browsing this forum: No registered users and 182 guests