Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Teilweise sehr lange Skriptlaufzeit von RegisterTimer "Wh-Berechnung" #8

Open
cfis72 opened this issue Oct 31, 2020 · 12 comments
Open
Assignees
Labels
wontfix This will not be worked on

Comments

@cfis72
Copy link

cfis72 commented Oct 31, 2020

Hallo,

Frage. Ich beobachte in den PHP Informationen immer wieder das die Zeile (PHP Thread), wie im Bild zu sehen ist, manchmal mehrere Minuten dauert.

image

Ich vermute hier auch die Ursache das sich bei mir immer wieder mal der IP Symcon Dienst beendet.
Dazu gibt es auch ein Thema im Symcon Forum:
https://www.symcon.de/forum/threads/43658-regelm%C3%A4%C3%9Figes-Beenden-des-Symcon-Dienstes/page2

Die Funktion ist für das Logging und die Tageswerte zuständig?
image

@Brovning
Copy link
Owner

Brovning commented Nov 1, 2020

Hallo,

ist das Problem erst seit einem bestimmten Release aufgetreten und besteht dieses gefühlt schon immer?

Ich werde mir das mit deiner Config mal ansehen.
Wie häufig rufst du die Werte vom E3DC ab? Wie ist die restliche Config?

Gruß

Jürgen

@Brovning Brovning self-assigned this Nov 1, 2020
@Brovning Brovning added the bug Something isn't working label Nov 1, 2020
@cfis72
Copy link
Author

cfis72 commented Nov 1, 2020

Hallo, Jürgen,
das Problem besteht schon länger, gefühlt seitdem ich das Modul einsetze.
Seit dem letzten Update tritt es (gefühlt) noch häufiger auf.

Ich aktualisiere die Werte sekündlich. Ich weiss, das ist ziemlich oft, ist aber performancetechnisch kein Problem.

Sobald die Funktion läuft, geht die CPU Nutzung auf 100% und läuft bei mir ca. 80 - 90s. In der Zeit werden auch manchmal die anderen Skripte blockiert.
Die CPU- und Speichernutzung dümpelt sonst bei ein paar Prozent herum.

viele Grüße,
Christian

@cfis72
Copy link
Author

cfis72 commented Nov 1, 2020

"Wie ist die restliche Config?"
Aktiviert sind die Werte aus dem Screenshot oben. Alles andere ist deaktiviert. Eine Wallbox von E3DC habe ich nicht.

@Brovning Brovning changed the title Teilweise sehr lange Skriptlaufzeit Teilweise sehr lange Skriptlaufzeit von RegisterTimer "Wh-Berechnung" Nov 1, 2020
@Brovning
Copy link
Owner

Brovning commented Nov 1, 2020

Hallo,

glaube den Fehler gefunden zu haben.

Lade mal bitte diese Datei herunter: https://raw.githubusercontent.com/Brovning/e3dc/ef7b8c5e3d0257b712c562029276b1723ef81946/libs/myFunctions.php

Und kopiere diese nach (Default-Pfad!, ggf. durch den bei dir verwendeten Pfad tauschen):
C:\ProgramData\Symcon\modules.store\e3dc\libs

An dieser Stelle solltest du bereits eine "myFunctions.php" vorfinden, welche du überschreiben musst.

@cfis72
Copy link
Author

cfis72 commented Nov 1, 2020

Die geändert myFunctions.php ist jetzt im Einsatz. Ich beobachte das Verhalten jetzt mal die nächsten Tage.

@cfis72
Copy link
Author

cfis72 commented Nov 2, 2020

Mit der Änderung sind Fehler reingekommen, das habe ich erst heute gesehen.
Die Tageswerte bleiben bei 0.

02.11.2020, 07:28:31 | TimerPool | S10 E (Wh-Berechnung):

Warning: Read too many values when computing minutely aggregation in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 435



Warning: count(): Parameter must be an array or an object that implements Countable in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 439



Warning: count(): Parameter must be an array or an object that implements Countable in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 445



Notice: Undefined index: Avg in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 469



Notice: Undefined index: Avg in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 472



Warning: Read too many values when computing minutely aggregation in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 435



Warning: count(): Parameter must be an array or an object that implements Countable in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 439



Warning: count(): Parameter must be an array or an object that implements Countable in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 445



Notice: Undefined index: Avg in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 474



Warning: Read too many values when computing minutely aggregation in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 435



Warning: count(): Parameter must be an array or an object that implements Countable in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 439



Warning: count(): Parameter must be an array or an object that implements Countable in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 445



Notice: Undefined index: Avg in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 467

@cfis72
Copy link
Author

cfis72 commented Nov 2, 2020

Hier das Ergebnis:

02.11.2020, 13:17:12 | TimerPool | S10 E (Wh-Berechnung):

Warning: Read too many values when computing minutely aggregation in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 435



Warning: count(): Parameter must be an array or an object that implements Countable in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 439



Warning: count(): Parameter must be an array or an object that implements Countable in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 445



Notice: Undefined index: Avg in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 469



Notice: Undefined index: Avg in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 472



Warning: Read too many values when computing minutely aggregation in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 435



Warning: count(): Parameter must be an array or an object that implements Countable in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 439



Warning: count(): Parameter must be an array or an object that implements Countable in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 445



Notice: Undefined index: Avg in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 474



Warning: Read too many values when computing minutely aggregation in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 435



Warning: count(): Parameter must be an array or an object that implements Countable in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 439



Warning: count(): Parameter must be an array or an object that implements Countable in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 445



Notice: Undefined index: Avg in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 469



Notice: Undefined index: Avg in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 472



Warning: Read too many values when computing minutely aggregation in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 435



Warning: count(): Parameter must be an array or an object that implements Countable in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 439



Warning: count(): Parameter must be an array or an object that implements Countable in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 445



Notice: Undefined index: Avg in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 474



Warning: Read too many values when computing minutely aggregation in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 435



Warning: count(): Parameter must be an array or an object that implements Countable in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 439



Warning: count(): Parameter must be an array or an object that implements Countable in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 445



Notice: Undefined index: Avg in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 467



Warning: Read too many values when computing minutely aggregation in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 435



Warning: count(): Parameter must be an array or an object that implements Countable in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 439



Warning: count(): Parameter must be an array or an object that implements Countable in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 445



Notice: Undefined index: Avg in /var/lib/symcon/modules/.store/e3dc/libs/myFunctions.php on line 467

@Brovning
Copy link
Owner

Brovning commented Nov 2, 2020

Habe mal im IPS-Thema geantwortet:
https://www.symcon.de/forum/threads/43497-Problem-mit-5-Minuetiger-Aggregation-und-was-ist-Aggregationsstufe-7?p=440002#post440002

Befürchte hier liegt ein Implementierungsfehler in IPS vor...

Ein möglicher Workaround wäre, wenn du vorübergehend den E3DC nur alle 10 Sekunden und nicht jede 1 Sekunde abrufen würdest.

Grund:
1 Wert je Sekunde macht in Summe 606024=86.400 Werte maximal je Tag, was >10.000 Werte ist und einen Fehler in IPS verursacht.
1 Wert alle 10 Sekunden macht in Summe 8.640 Werte maximal je Tag, was <10.000 Werte ist und somit keinen Fehler in IPS verursacht.

@cfis72
Copy link
Author

cfis72 commented Nov 2, 2020

Ich habe das Abfrage Intervall jetzt schrittweise auf 20 Sekunden erhöht. Der Fehler bleibt der gleiche.
ich sehe den Fehler aber auch in der Funktion AC_GetAggregatedValues.

@Brovning
Copy link
Owner

Brovning commented Nov 2, 2020

Ja, weil heute schon zu viele Werte eingetragen wurden ().
Das ändert sich erst Morgen wieder oder du löscht 90% der Werte von Heute aus dem Archiv.

Stelle mal auf 10 Sekunden und prüfe Morgen das Ergebnis.

@Brovning
Copy link
Owner

Brovning commented Nov 3, 2020

Anwort im IPS Forum erhalten. Leider ziemlich unzufriedenstellend:

Zitat Zitat von Dr. Niels Beitrag anzeigen
Im Fall der aggregierten Werte stößt du auf einen Sonderfall, der bei Rohwerten so nicht möglich ist. Die Rohwerte, welche benötigt würden um deine Anfrage korrekt zurückzugeben sind einfach zu viele (mehr als durch den Spezialschalter ArchiveRecordLimit definiert). So ist es nicht möglich die Anfrage zu erfüllen. Bei einer teilweisen Erfüllung wäre es für den Benutzer wiederum sehr unklar, warum nun gerade 3 und nicht mehr aggregierte Datensätze zurückkommen oder, noch schlimmer, er würde denken, dass davor gar nichts passiert ist. Daher haben wir uns an der Stelle für den Fehler entschieden und geben kein unvollständiges Ergebnis zurück.

Wenn ich eine IPS Funktion geziehlt verwende, dann erwarte ich eigentlich, dass mir Probleme abgenommen werden, die ich ansonsten mit den Rohdaten hätte.

Somit musst du wieder auf meine releaste Version zurückgehen und ich reverte den Patch.

Mögliche Optionen aus meiner Sicht:

  • Entweder du stellst die Zeit auf einen Wert >1 Sekunde, welcher Performance-technisch mit deinem aktuellen Server-System verkraftbar ist
  • Oder du rüstest deinen Server auf, damit er eine so hohe Log-Datendichte in einer "akzeptablen" Zeit verarbeiten kann

Eine andere Lösung sehe ich aktuell leider nicht. Bin für Vorschläge offen.

Brovning added a commit that referenced this issue Nov 3, 2020
Brovning added a commit that referenced this issue Nov 3, 2020
@Brovning Brovning added wontfix This will not be worked on and removed bug Something isn't working labels Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants