Keine Cache-Version

Caching deaktiviert Standardeinstellung für diese Seite:aktiviert (code DEF204)
Wenn die Anzeige zu langsam ist, können Sie den Benutzermodus deaktivieren, um die zwischengespeicherte Version anzuzeigen.

Rechercher dans le manuel MySQL

26.12.3.5 The socket_instances Table

The socket_instances table provides a real-time snapshot of the active connections to the MySQL server. The table contains one row per TCP/IP or Unix socket file connection. Information available in this table provides a real-time snapshot of the active connections to the server. (Additional information is available in socket summary tables, including network activity such as socket operations and number of bytes transmitted and received; see Section 26.12.17.9, “Socket Summary Tables”).

  1. mysql> SELECT * FROM performance_schema.socket_instances\G
  2. *************************** 1. row ***************************
  3.            EVENT_NAME: wait/io/socket/sql/server_unix_socket
  4. OBJECT_INSTANCE_BEGIN: 4316619408
  5.             THREAD_ID: 1
  6.             SOCKET_ID: 16
  7.                    IP:
  8.                  PORT: 0
  9.                 STATE: ACTIVE
  10. *************************** 2. row ***************************
  11.            EVENT_NAME: wait/io/socket/sql/client_connection
  12. OBJECT_INSTANCE_BEGIN: 4316644608
  13.             THREAD_ID: 21
  14.             SOCKET_ID: 39
  15.                    IP: 127.0.0.1
  16.                  PORT: 55233
  17.                 STATE: ACTIVE
  18. *************************** 3. row ***************************
  19.            EVENT_NAME: wait/io/socket/sql/server_tcpip_socket
  20. OBJECT_INSTANCE_BEGIN: 4316699040
  21.             THREAD_ID: 1
  22.             SOCKET_ID: 14
  23.                    IP: 0.0.0.0
  24.                  PORT: 50603
  25.                 STATE: ACTIVE

Socket instruments have names of the form wait/io/socket/sql/socket_type and are used like this:

  1. The server has a listening socket for each network protocol that it supports. The instruments associated with listening sockets for TCP/IP or Unix socket file connections have a socket_type value of server_tcpip_socket or server_unix_socket, respectively.

  2. When a listening socket detects a connection, the server transfers the connection to a new socket managed by a separate thread. The instrument for the new connection thread has a socket_type value of client_connection.

  3. When a connection terminates, the row in socket_instances corresponding to it is deleted.

The socket_instances table has these columns:

  • EVENT_NAME

    The name of the wait/io/socket/* instrument that produced the event. This is a NAME value from the setup_instruments table. Instrument names may have multiple parts and form a hierarchy, as discussed in Section 26.6, “Performance Schema Instrument Naming Conventions”.

  • OBJECT_INSTANCE_BEGIN

    This column uniquely identifies the socket. The value is the address of an object in memory.

  • THREAD_ID

    The internal thread identifier assigned by the server. Each socket is managed by a single thread, so each socket can be mapped to a thread which can be mapped to a server process.

  • SOCKET_ID

    The internal file handle assigned to the socket.

  • IP

    The client IP address. The value may be either an IPv4 or IPv6 address, or blank to indicate a Unix socket file connection.

  • PORT

    The TCP/IP port number, in the range from 0 to 65535.

  • STATE

    The socket status, either IDLE or ACTIVE. Wait times for active sockets are tracked using the corresponding socket instrument. Wait times for idle sockets are tracked using the idle instrument.

    A socket is idle if it is waiting for a request from the client. When a socket becomes idle, the event row in socket_instances that is tracking the socket switches from a status of ACTIVE to IDLE. The EVENT_NAME value remains wait/io/socket/*, but timing for the instrument is suspended. Instead, an event is generated in the events_waits_current table with an EVENT_NAME value of idle.

    When the next request is received, the idle event terminates, the socket instance switches from IDLE to ACTIVE, and timing of the socket instrument resumes.

The socket_instances table has these indexes:

  • Primary key on (OBJECT_INSTANCE_BEGIN)

  • Index on (THREAD_ID)

  • Index on (SOCKET_ID)

  • Index on (IP, PORT)

TRUNCATE TABLE is not permitted for the socket_instances table.

The IP:PORT column combination value identifies the connection. This combination value is used in the OBJECT_NAME column of the events_waits_xxx tables, to identify the connection from which socket events come:

  • For the Unix domain listener socket (server_unix_socket), the port is 0, and the IP is ''.

  • For client connections via the Unix domain listener (client_connection), the port is 0, and the IP is ''.

  • For the TCP/IP server listener socket (server_tcpip_socket), the port is always the master port (for example, 3306), and the IP is always 0.0.0.0.

  • For client connections via the TCP/IP listener (client_connection), the port is whatever the server assigns, but never 0. The IP is the IP of the originating host (127.0.0.1 or ::1 for the local host)


Suchen Sie im MySQL-Handbuch

Deutsche Übersetzung

Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.

Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.

Vielen Dank im Voraus.

Dokument erstellt 26/06/2006, zuletzt geändert 26/10/2018
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/mysql-rf-socket-instances-table.html

Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.

Referenzen

  1. Zeigen Sie - html-Dokument Sprache des Dokuments:en Manuel MySQL : https://dev.mysql.com/

Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor Diese Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.

Inhaltsverzeichnis Haut