Sometimes very slow http response from ESP Easy

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Itschi
New user
Posts: 5
Joined: 26 Jan 2016, 00:53

Sometimes very slow http response from ESP Easy

#1 Post by Itschi » 29 Dec 2022, 10:14

Hi,

I'm a big fan of ESP Easy, running a number of devices as intelligent sensor bridge for my Domoticz House Automation since years. I recently used ESP Easy as standalone controller for a Sauna Heating using rules. All works fine except that http requests to the ESP Easy web server sometimes are very slow (~5s) whereas most requests are handeled in about 1s. I'm using Wemos D1 Mini with the latest build (mega-20221224) and also tried a Wemos S2 as I tough the faster CPU might help. The S2 responds faster but show in general the same behaviour: Many responses are fast but a few very slow. I took a fresh install with no devices -> same problem. As client I'm using a Chrome browser on Windows.

Any idea what I can do?

Regards, Itschi

TD-er
Core team member
Posts: 8739
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Sometimes very slow http response from ESP Easy

#2 Post by TD-er » 29 Dec 2022, 10:43

If you are running a build which has the "timing stats" included (e.g. a "MAX" or "normal" build), then please enable to collect these stats from the tools->Advanced page ("Collect Timing Statistics" checkbox)

It sounds like something is blocking execution on your ESP for a while.
For example running "delay" in rules is a big no-no for exactly this reason.

Also when possible, use "asyncevent" instead of "event" in the rules.

Itschi
New user
Posts: 5
Joined: 26 Jan 2016, 00:53

Re: Sometimes very slow http response from ESP Easy

#3 Post by Itschi » 29 Dec 2022, 11:19

These are the stats from the blank s2 device:

Code: Select all

Description	Function	#calls	call/s	duty(%)	min(ms)	Avg(ms)	max (ms)
Load File			6	0.23	0.07	2.588	2.897	4.409
Loop				143971	5408.78	98.31*	0.078	0.181	345.973
Plugin call 50 p/s		1295	48.65	3.95*	0.636	0.812	6.194
Plugin call 10 p/s		263	9.88	0.79*	0.626	0.795	6.294
Plugin call 10 p/s U		526	19.76	0.64*	0.055	0.324	5.746
Plugin call 1 p/s		27	1.01	0.11	0.887	1.097	3.671
CPlugin call 10 p/s		263	9.88	0.05*	0.039	0.052	0.080
CPlugin call 50 p/s		1295	48.65	0.25*	0.038	0.050	2.800
setNewTimerAt()			1850	69.50	0.85*	0.068	0.122	3.632
WiFi.isConnected()		2561	96.21	4.07*	0.207	0.423	4.038
TryOpenFile()			6	0.23	0.03	1.031	1.350	2.881
saveToRTC()			147556	5543.47	2.99*	0.004	0.005	3.670
backgroundtasks()		5050	189.72	18.41*	0.226	0.970	345.817
handle_schedule() idle		142121	5339.28	10.55*	0.010	0.019	7.757
handle_schedule() task		1850	69.50	8.05	0.219	1.158	7.262
handle webpage			14	0.53	2.38	9.779	45.310	320.472
Statistics	
Start Period:	1970-01-01 01:01:16
Local Time:	1970-01-01 01:01:42
Time span:	26.62 sec
*:	Duty cycle based on average < 1 msec is highly unreliable

TD-er
Core team member
Posts: 8739
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Sometimes very slow http response from ESP Easy

#4 Post by TD-er » 29 Dec 2022, 12:20

Please let it run for a little longer, as 30 seconds is a bit short.

N.B. if you reload the stats page, the statistics are reset.

Can you also test by running a ping (continuously) from just any computer in your network to the ESP?
This will change the way the WiFi operates.
If this does make the problem 'disappear', then you may want to check the checkboxes for sending gratuituous ARP and sending at max. TX power.

Also on ESP8266 you can try to force 802.11b/g network only. (also tools->advanced page)
Some access points (especially the more expensive ones) may force a node to disconnect when running in 802.11n mode.
Please also check if you have disallowed "b/g" networks in your access point. This is sometimes called "N-only" mode.

Post Reply

Who is online

Users browsing this forum: No registered users and 38 guests