Trying understand mqtt comands

Hello,
due the migration to Arduino mqtt libraries, I am full of doubts and the cayenne docs sometimes are confusing me,

I unsderstantd the follow, but have some doubts:

max 60 mesages x second. In order to calculate properly It is included incoming and outcoming messages? ej activate an actuator or move a slider it is considered a message?

regarding actuators, teh dashboard needs a feedback about the status on the arduino ( I tested and without the LOG_ line the dashboard stucks when a buttom is pressed) but how it works really the comand? and how we must to fulfill it?:

CAYENNE_LOG(“Channel %d, pin %d, value %d”, VIRTUAL_CHANNEL, ACTUATOR_PIN, value);

on the docs section explains about validation comands but, how implement on the arduino code?

and also, How it works in the Arduino code the error comands?

till Now with the same hardware I could not reach more than 3 minutes conected with MQTT. most of the time the arduino is ofline.

If I use millis the board could not be connected, see code:
DHT11 with millis MQTT.txt (1.7 KB)

and usingsample sketch from library I am lucky if I could reach more that 10 minutes conected:

DHT11 MQTT.txt (1.7 KB)

why does it happend, I dont like to use copy/paste method I would like to undertand but on this case I am really confused. new steps will use relays , sliders to control fans and motion sensors but if in a very simple thing it not works sure more dificult could be crazy.

What I am doing wrong is the ESP8266 used as a shield an unstable choice?

It is some additional sw required?

Advanced thanks to everybody whos could support.

After several trials I am still more convinced that the esp8266 as a wifi shield needs to be improved or change the way to use it.
any way the MQTT system is really really slow than the previous system.

sometimes for swicth on a simple led it tooks veveral seconds and even it disconnect…

I guess that the beginers as me we need to understand deeper how it works the mqtt system.

There is a FAQ post here that should help answer your questions.