Ankündigung

Einklappen
Keine Ankündigung bisher.

Analyse - DB-Abfragen je Request

Einklappen

Neue Werbung 2019

Einklappen
X
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • Analyse - DB-Abfragen je Request

    Aus der Analyse eines anderen Programmierers zur Performance
    einer Website:

    Database:
    As the long time of loading could not be explained by means of the two previous measurements it is necessary to measure now the access to the database as well as the number and architecture of the queries carried out to the database. A rudimentary first analysis only showed a small number of queries (< 10 items shown by the status module of the web application (PHPMyAdmin) as well as a small data bank size (~8.3MB). Both results obviously do not mean a slowing down of the application due to the database. An exact observation, however, showed that only one request to the webserver resulted in a great number of queries being „shot“ into the data bank inspite of the apparently defective indication of PHPMyAdmin.

    Primarily the following queries were repeatedly executed:

    Position Number Query
    1 189 select id from translated_tables where table_name={}
    2 62 select field_name from fields_to_translate where table_id={}
    3 15 select*from property_let_bills where ref_property={}
    4 15 select*from property_let_audience where ref_property={}
    281


    Special attention now concerns the first two lines. These queries are used for the provision of the application in different languages. But because of the defective softwaredesign this functionality goes beyond the scope of a performant application by a length. Probably a query for each notion to be translated will be sent to the database.
    Wie hat der das gemacht ?

    Wie kann man die Anzahl der DB-Abfragen je Request aufgeschlüsselt
    nach Abfrageart, so wie oben in der Tabelle, ermitteln ?

  • #2
    Vielleicht hat er einfach im DB-Wrapper ne log-Anweisung reingeschrieben?

    Kommentar


    • #3
      Manche Frameworks bieten solche Statistiken bereits in der Entwicklungsphase (cakePHP lässt im Debugmodus einen SQL Query Log mitlaufen und zeigt den für jeden Request unterhalb der Seite).

      Kommentar


      • #4
        gutes feature

        Kommentar


        • #5
          http://www.maatkit.org/doc/synopsis

          können die das auch ?
          munin schwächelt da ja ab

          Kommentar


          • #6
            Da keinerlei Möglichkeiten bestanden ein Logging in die Anwendung einzuklinken, wurde in einer isolierten Umgebung das Query-Log von MySQL aktiviert. Dieses wurde afaik mittels folgenden Programm ausgewertet:

            http://myprofi.sourceforge.net/

            Die Analyse wurde vor einigen Monaten von meinem Unternehmen durchgeführt.

            Kommentar


            • #7
              Anfragen an sich kannst du ausgeben lassen, aufschlüsseln direkt geht wohl nur über den Server, also musst Du Administrator sein. Könnte Dir aber zu Testzwecken eine externe MySQL-DB einrichten und Dir die Logs dazu geben

              Kommentar

              Lädt...
              X