Speed up JSON output?

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!
Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post

Please mark your topic as Solved when the problem is solved.
Post Reply
Inso
Posts: 9
Joined: Thursday 12 October 2017 23:41
Target OS: Raspberry Pi
Domoticz version:
Contact:

Speed up JSON output?

Post by Inso » Thursday 06 December 2018 1:29

Hi,

I have Domotics (Version: 4.97) running on a RPi 3b, along with MySensors gateway, Mosquitto, NodeRed. System load is about 0-1% max, ram is fine, not much traffic on (W)Lan.
If I change the state of a device (by clicking on the http interface or by dzVents), it takes 1(+) second until the JSON-command is published to my MQTT broker (Mosquitto). If I send a command by an ESP32, it arrives almost instantly, so the broker and network are fine.
I have checked the database (~2MB).
I have checked the events - no errors, not much going on.
Then I made a db backup, kicked out all dzVents scripts and deactivated all hardware stuff (xiaomi lamps and so on), so there was not much more left then my RGB dummy and a dzVents test event. Did not change anything, time until Domoticz sends the update is about one second, which is imo "a lot" for an f.e. dimmer.
Does anyone have an Idea how this delay comes up, and what to do to reduce it? What are the response times of your Domoticz?

ben53252642
Posts: 540
Joined: Saturday 02 July 2016 5:17
Target OS: Linux
Domoticz version: Beta
Contact:

Re: Speed up JSON output?

Post by ben53252642 » Thursday 06 December 2018 1:51

System: dual xeon cpu (each 8 cores) = 16 total + 48gb of ecc ram and ssd with 2500mb write / 3500mb read.

I'm not seeing any delays. ;)

User avatar
emme
Posts: 963
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Speed up JSON output?

Post by emme » Thursday 06 December 2018 9:29

does it delay in ACTING the Dim/switch or just for notifying it? (send the json response/update the switch in the UI)

I have a much loaded PI (actually a P3b+) than yours (20Mb db, about 100 devices, nodeRed for other external flows) and I have a delay of about 300ms in acting... a bit more in notifying (log) but never got more than 1sec
The most dangerous phrase in any language is:
"We always done this way"

Inso
Posts: 9
Joined: Thursday 12 October 2017 23:41
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Speed up JSON output?

Post by Inso » Thursday 06 December 2018 9:49

ben53252642 wrote:
Thursday 06 December 2018 1:51
System: dual xeon cpu (each 8 cores) = 16 total + 48gb of ecc ram and ssd with 2500mb write / 3500mb read.

I'm not seeing any delays. ;)
Good to know there _has_ not to be an delay :D

Problem is, my cpu load is about 1% when processing my task - so I can´t believe it is the RPi..
emme wrote:
Thursday 06 December 2018 9:29
does it delay in ACTING the Dim/switch or just for notifying it? (send the json response/update the switch in the UI)

I have a much loaded PI (actually a P3b+) than yours (20Mb db, about 100 devices, nodeRed for other external flows) and I have a delay of about 300ms in acting... a bit more in notifying (log) but never got more than 1sec
Definitely acting, f.e. the NodeRed debug node shows the action after ~1 second, while the ESP-"debug node" shows the corresponding action immediately.
(ESP32 is my IoT-device btw^^)

gordonb3
Posts: 198
Joined: Saturday 31 March 2018 22:24
Target OS: Linux
Domoticz version: Custom
Location: Delft, NL
Contact:

Re: Speed up JSON output?

Post by gordonb3 » Thursday 06 December 2018 9:50

Try add `-wwwcompress static` to your domoticz command line

User avatar
waaren
Posts: 1376
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Speed up JSON output?

Post by waaren » Thursday 06 December 2018 10:18

Inso wrote:
Thursday 06 December 2018 1:29
Hi,

I have Domotics (Version: 4.97) running on a RPi 3b, along with MySensors gateway, Mosquitto, NodeRed. System load is about 0-1% max, ram is fine, not much traffic on (W)Lan.
If I change the state of a device (by clicking on the http interface or by dzVents), it takes 1(+) second until the JSON-command is published to my MQTT broker (Mosquitto). If I send a command by an ESP32, it arrives almost instantly, so the broker and network are fine.
I have checked the database (~2MB).
I have checked the events - no errors, not much going on.
Then I made a db backup, kicked out all dzVents scripts and deactivated all hardware stuff (xiaomi lamps and so on), so there was not much more left then my RGB dummy and a dzVents test event. Did not change anything, time until Domoticz sends the update is about one second, which is imo "a lot" for an f.e. dimmer.
Does anyone have an Idea how this delay comes up, and what to do to reduce it? What are the response times of your Domoticz?
Do you publish only sensor updates for sensors that are placed on a floorplan/plan. (Hierarchical) or do you publish all outgoing messages (Flat) ?
You probably already know but you can see the time domoticz publish with this CLI command.

mosquitto_sub -F "%U - %t - %p" -v -h <domoticzIP> -p 1883 -t '#'
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests