<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"><meta http-equiv="Content-Type" content="text/html charset=utf-8"><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="" dir="auto">Hallo,<div class=""><br class=""></div><div class="">was ist aus diesem Thema eigentlich geworden?</div><div class="">Scheinbar bin ich von einem ähnlichen Problem betroffen:</div><div class="">- Ich habe gestern meine bis dahin laufende volkszäher Installation mit ‚git pull‘ auf den master aktualisiert (und habe das Kommando heute noch mal wiederholt, um sicherzugehen, dass ich den letzten Stand mit Andis gestern commiteten Fix habe).</div><div class="">- Seitdem sind die Datenbankabfragen (mysql) für die Darstellung extrem zäh. Die Abfrage eines Kanals für 24h dauert im Minutenbereich statt 1 Sekunde wie vorher. Auf meinem Xeon-Server sind dabei 5 Kerne zu 100% ausgelastet und dass bei eingeschalteter Aggregation.</div><div class=""><br class=""></div><div class="">Ich habe mal eine Abfrage (1 Kanal für 24h) mit &debug=1 ausgeführt, hier ist der interessante debug-Anteil der Ausgabe:</div><div class=""><br class=""></div><div class=""><pre style="word-wrap: break-word; white-space: pre-wrap;" class="">"debug": {
                "level": "1",
                "database": "pdo_mysql",
                "time": 361.22724,
                "uptime": 257587080,
                "load": [
                        3.46,
                        3.78,
                        3.01
                ],
                "commit-hash": "bfff72a54514d970c7cea395dff256c330f0c61a",
                "php-version": "5.6.4-4ubuntu6.3",
                "messages": [],
                "sql": {
                        "totalTime": 361.13634586334,
                        "worstTime": 360.98874211311,
                        "queries": [
                                {
                                        "sql": "SELECT e0_.id AS id0, e0_.uuid AS uuid1, e0_.type AS type2, p1_.id AS id3, p1_.pkey AS pkey4, p1_.value AS value5, e0_.class AS class6, p1_.entity_id AS entity_id7 FROM entities e0_ LEFT JOIN properties p1_ ON e0_.id = p1_.entity_id WHERE (e0_.uuid = ?) AND e0_.class IN ('channel', 'aggregator') ORDER BY p1_.pkey ASC",
                                        "params": [
                                                "7d0f4340-fbec-11e0-84ed-bf024c4c5d69"
                                        ],
                                        "types": [
                                                2
                                        ],
                                        "executionMS": 0.00047087669372559
                                },
                                {
                                        "sql": "SELECT MAX(timestamp) FROM data WHERE channel_id=? AND timestamp < (SELECT MAX(timestamp) FROM data WHERE channel_id=? AND timestamp<?)",
                                        "params": [
                                                6,
                                                6,
                                                1444593967785
                                        ],
                                        "types": [],
                                        "executionMS": 360.98874211311
                                },
                                {
                                        "sql": "SELECT MIN(timestamp) FROM data WHERE channel_id=? AND timestamp>?",
                                        "params": [
                                                6,
                                                1444680367785
                                        ],
                                        "types": [],
                                        "executionMS": 0.027281045913696
                                },
                                {
                                        "sql": "SELECT aggregate.type, COUNT(aggregate.id) AS count FROM aggregate INNER JOIN entities ON aggregate.channel_id = entities.id WHERE uuid = ? GROUP BY type HAVING count > 0 ORDER BY type DESC",
                                        "params": [
                                                "7d0f4340-fbec-11e0-84ed-bf024c4c5d69"
                                        ],
                                        "types": [],
                                        "executionMS": 0.062636852264404
                                },
                                {
                                        "sql": "SELECT UNIX_TIMESTAMP(FROM_UNIXTIME(MIN(timestamp) \/ 1000, \"%Y-%m-%d\")) * 1000 FROM aggregate WHERE channel_id=? AND type=? AND timestamp >= UNIX_TIMESTAMP(DATE_ADD(FROM_UNIXTIME(? \/ 1000, \"%Y-%m-%d\"), INTERVAL 1 day)) * 1000",
                                        "params": [
                                                6,
                                                3,
                                                1444593884564
                                        ],
                                        "types": [],
                                        "executionMS": 0.0002899169921875
                                },
                                {
                                        "sql": "SELECT UNIX_TIMESTAMP(DATE_ADD(FROM_UNIXTIME(MAX(timestamp) \/ 1000, \"%Y-%m-%d\"), INTERVAL 1 day)) * 1000 FROM aggregate WHERE channel_id=? AND type=? AND timestamp<?",
                                        "params": [
                                                6,
                                                3,
                                                1444680400937
                                        ],
                                        "types": [],
                                        "executionMS": 0.0001380443572998
                                },
                                {
                                        "sql": "SELECT COUNT(1) FROM data WHERE channel_id = ? AND timestamp >= ? AND timestamp <= ?",
                                        "params": [
                                                6,
                                                1444593884564,
                                                1444680400937
                                        ],
                                        "types": [],
                                        "executionMS": 0.03215503692627
                                },
                                {
                                        "sql": "SELECT timestamp, value, 1 AS count FROM data WHERE channel_id=? AND timestamp >= ? AND timestamp <= ? ORDER BY timestamp ASC",
                                        "params": [
                                                6,
                                                1444593884564,
                                                1444680400937
                                        ],
                                        "types": [],
                                        "executionMS": 0.024631977081299
                                }
                        ]
                }
        }</pre><div class="">Greetinx,</div><div class="">Udo</div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div class="">Am 12.09.2015 um 16:13 schrieb G. Stenzel <<a href="mailto:GS-vzl@betriebsdirektor.de" class="">GS-vzl@betriebsdirektor.de</a>>:</div><br class="Apple-interchange-newline"><div class=""><div class="">Alles klar.<br class="">Vielen Dank!<br class=""><br class=""><blockquote type="cite" class="">Ich gehe mal davon aus, dass der RPi auch an der FritzBox hängt. Dann <br class="">ist es recht einfach:<br class="">Du loggst dich in die FritzBox ein.<br class="">Gehst auf Internet/Freigaben/Neue Portfreigabe.<br class="">Dann erstellst du eine Portfreigabe für HTTP-Server an Computer <br class="">'RaspberryPi' ( oder wie auch immer der in deinem Netz heißt), an <br class="">IP-Adresse 'IP des Raspberry in deinem Netz' und klickst ok.<br class="">Per PN teilst du Andi dann mit: deine Internetadresse/IP-des Raspberry.<br class="">Deine Internetadresse findest du im Menue-Punkt: Internet, die IP des <br class="">Raspberry wirst du kennen.<br class=""><br class="">Gruß<br class="">Udo<br class=""><br class=""><br class="">Am 12.09.2015 um 15:29 schrieb G. Stenzel:<br class=""><blockquote type="cite" class="">Ja.<br class=""><br class=""><blockquote type="cite" class="">Am 12.09.2015 um 14:56 schrieb G. Stenzel:<br class=""><blockquote type="cite" class="">Wie eine temporäre Freigabe meines Systemsnach außen eingerichtet<br class="">werden kann, weiß ich momentan nicht.<br class=""></blockquote>Gehst du über eine FritzBox ins Internet?<br class=""><br class="">Gruß<br class="">Udo<br class=""></blockquote></blockquote></blockquote></div></div></blockquote></div><br class=""></div></body></html>