Cloud Monitoring은 기본 Cloud SQL 모니터링 대시보드를 포함하여 여러 Google Cloud 제품에 대해 사전 정의된 대시보드를 제공합니다. 이 대시보드를 사용하면 기본 및 복제본 인스턴스의 일반적인 상태를 모니터링할 수 있습니다.
나만의 커스텀 대시보드를 만들어 관심 있는 데이터를 표시할 수도 있습니다.
알림 설정
Cloud Monitoring을 사용하여 프로젝트 또는 지정된 인스턴스에 대한 알림을 설정할 수 있습니다.
예를 들어 Cloud SQL 인스턴스의 메모리 사용량 측정항목이 80% 임곗값을 초과하면 메시지가 특정 이메일 ID로 전송되도록 알림을 설정할 수 있습니다.
사용량 차트는 애플리케이션 변경이 필요한 경우를 사전에 대비하는 데 도움이 됩니다.
이러한 측정항목에서 인스턴스 사용 비용뿐만 아니라 처리량과 지연 시간 문제를 파악할 수 있습니다.
측정항목
설명
저장소 사용량(GB)
저장소 사용량 측정항목을 사용하여 저장소 비용을 파악할 수 있습니다. 저장소 사용 비용에 대한 자세한 내용은 저장소 및 네트워킹 가격을 참조하세요.
point-in-time recovery에는 미리 쓰기 로깅(WAL) 보관처리가 사용됩니다. PITR(point-in-time recovery)이 사용 설정된 새 Cloud SQL 인스턴스 또는 Cloud Storage에 WAL 로그를 저장하기 위해 이 기능을 사용할 수 있게 된 다음에 PITR(point-in-time recovery)을 사용 설정하는 기존 인스턴스의 경우 로그가 더 이상 디스크에 저장되지 않습니다. 대신 인스턴스와 동일한 리전에 있는 Cloud Storage에 저장됩니다.
인스턴스 로그가 Cloud Storage에 저장되었는지 여부를 보려면 인스턴스의 bytes_used_by_data_type 측정항목을 확인합니다. archived_wal_log 데이터 유형의 값이 0이면 인스턴스 로그가 Cloud Storage에 저장됩니다.
psql 또는 pgAdmin과 같은 PostgreSQL 클라이언트를 사용하여 인스턴스의 데이터베이스에 연결한 후 show archive_command 명령어를 실행합니다. WAL이 Cloud Storage에 보관처리되면 -async_archive -remote_storage가 표시됩니다.
point-in-time recovery가 사용 설정된 모든 다른 기존 인스턴스는 해당 로그가 계속 디스크에 저장됩니다. Cloud Storage의 로그 저장 변경사항은 나중에 제공됩니다.
point-in-time recovery에 사용된 미리 쓰기 로그는 일반적으로 transactionLogRetentionDays에 대해 설정된 값이 충족된 다음에 발생하는 연관된 자동 백업과 함께 자동으로 삭제됩니다. 이것은 Cloud SQL이 point-in-time recovery에 대해 보존하는 트랜잭션 로그 일 수(1~7)입니다(Cloud SQL Enterprise Plus 버전의 경우 1~35, Cloud SQL Enterprise 버전의 경우 1~7).
PITR(point-in-time recovery)을 사용 설정하기 전에 Cloud SQL 인스턴스에서 백업을 복원하면 PITR의 운영을 허용하는 WAL 로그가 손실됩니다.
미리 쓰기 로그가 Cloud Storage에 저장된 인스턴스의 경우 로그가 기본 인스턴스와 동일한 리전에 저장됩니다. 이러한 로그 스토리지(point-in-time recovery의 최대 기간 7일)는 인스턴스당 추가 비용을 발생시키지 않습니다.
인스턴스에 point-in-time recovery가 사용 설정되어 있고 디스크에서 미리 쓰기 로그 크기로 인해 인스턴스 문제가 발생하는 경우에는 point-in-time recovery를 사용 중지하고 다시 사용 설정하여 새 로그가 인스턴스와 동일한 리전의 Cloud Storage에 저장되는지 확인합니다. 이렇게 하면 기존 미리 쓰기 로그가 삭제되므로, point-in-time recovery를 다시 사용 설정한 시간 이전에 point-in-time recovery를 수행할 수 없습니다. 그러나 기존 로그는 삭제되더라도 디스크 크기는 동일하게 유지됩니다.
예기치 않은 스토리지 문제를 방지하려면 PITR(point-in-time recovery)을 사용할 때 모든 인스턴스에 스토리지 용량 자동 증가를 사용 설정하는 것이 좋습니다. 이 권장사항은 인스턴스에 PITR(point-in-time recovery)이 사용 설정되어 있고 로그가 디스크에 저장된 경우에만 적용됩니다.
로그를 삭제하고 스토리지를 복구하려면 point-in-time recovery를 중지하면 됩니다. 그러나 사용되는 미리 쓰기 로그를 줄이면 인스턴스에 프로비저닝된 디스크 크기가 축소되지 않습니다.
데이터 사용량은 스토리지 사용량 측정항목에 포함됩니다. 데이터 사용량의 일환으로 트랜잭션이 데이터베이스를 수정할 때 Cloud SQL이 원본 데이터를 수정하기 전에 이 데이터의 사본이 만들어집니다. 데이터의 사본은 실행취소 데이터입니다.
CPU 사용량
이 측정항목을 사용하여 인스턴스에 애플리케이션 요구에 맞는 충분한 CPU가 있는지 모니터링할 수 있습니다. 이 값이 너무 높으면 머신 유형의 크기를 늘려서 인스턴스에 더 많은 CPU 용량을 제공할 수 있습니다.
메모리 사용량
인스턴스에서 사용되는 메모리 양입니다.
읽기/쓰기 작업
읽기 수 측정항목은 디스크에서 제공된 읽기 작업 중에서 캐시에서 가져오지 않은 작업의 수입니다. 이 측정항목을 사용하여 인스턴스 크기가 작업 환경에 맞게 제대로 지정되었는지 파악할 수 있습니다.
필요한 경우 더 큰 머신 유형으로 전환하여 캐시에서 더 많은 요청을 처리하고 지연 시간을 줄일 수 있습니다.
쓰기 수 측정항목은 디스크에 대한 쓰기 작업 수입니다. 쓰기 활동은 애플리케이션이 활성 상태가 아니어도 생성됩니다. Cloud SQL 인스턴스는 약 1초 간격으로 시스템 테이블에 쓰기 때문입니다(복제본 제외).
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-13(UTC)"],[],[],null,["# Monitor Cloud SQL instances\n\n\u003cbr /\u003e\n\n[MySQL](/sql/docs/mysql/monitor-instance \"View this page for the MySQL database engine\") \\| PostgreSQL \\| [SQL Server](/sql/docs/sqlserver/monitor-instance \"View this page for the SQL Server database engine\")\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nThis page describes how you can monitor Cloud SQL instances in the following ways:\n\n- [Use the Cloud SQL System Insights dashboard](/sql/docs/postgres/use-system-insights)\n\n\u003c!-- --\u003e\n\n- [Monitor an instance by using the Cloud Monitoring dashboard](#cloud-monitoring)\n- [View metrics on the Cloud SQL instance Overview page](#monitoring-overview)\n- [Compare metrics from multiple instances](#monitoring-multiple)\n\nUse the Cloud SQL System Insights dashboard\n-------------------------------------------\n\nThe Cloud SQL System Insights dashboard helps you detect and analyze\nsystem performance problems.\n\nFor more information, see [Use System Insights to improve system performance](/sql/docs/postgres/use-system-insights).\n\n\nMonitor an instance by using the Cloud Monitoring dashboard\n-----------------------------------------------------------\n\nCloud Monitoring offers predefined dashboards for several Google Cloud products,\nincluding a default Cloud SQL [monitoring dashboard](https://console.cloud.google.com/monitoring/dashboards/resourceList/cloudsql_database). You can\nuse this dashboard to monitor the general health of your primary and replica instances.\nYou can also create your own [custom dashboards](/monitoring/charts/dashboards)\nto display data that's of interest to you.\n\n### Set up alerts\n\nYou can use Cloud Monitoring to [set up alerts](/monitoring/alerts/using-alerting-ui#viewing_policies)\nfor a project or a specified instance.\n\nFor example, you can set up an alert for a message to be sent to specific email\nIDs when the **Memory usage** metric for a Cloud SQL instance exceeds\nthe threshold of 80%.\n\nView metrics on the Cloud SQL instance Overview page\n----------------------------------------------------\n\nView some of the key metrics for a Cloud SQL instance on its Overview page as follows:\n\n1. In the Google Cloud console, go to the **Cloud SQL Instances** page.\n\n [Go to Cloud SQL Instances](https://console.cloud.google.com/sql)\n2. To open the **Overview** page of an instance, click the instance name.\n3. The default metrics chart appears at the top of the page.\n4.\n Optional: Select another metric from the **Chart** drop-down list.\n\n\n The chart shows the data for the selected metric.\n\n \u003cbr /\u003e\n\n | **Note:** If you select a database-specific metric, then any instances with more than 500 databases report only a single aggregated value.\n\n \u003cbr /\u003e\n\n### Available metrics\n\nThe usage charts help you respond proactively as your application needs change.\nFrom these metrics, you can gain insights into issues of throughput and latency\nas well as instance usage costs.\n\nCompare metrics from multiple instances\n---------------------------------------\n\n1. In the Google Cloud console, go to the **Cloud SQL Instances** page.\n\n [Go to Cloud SQL Instances](https://console.cloud.google.com/sql)\n2. From the Cloud SQL **Instances** page, choose up to five instances to compare by selecting the checkbox to the left of the instance name.\n3. On the **Info Panel** on the right, select the **Monitoring** tab.\n4.\n From the metrics drop-down, select the metric to use for comparing instances.\n\n You can see the data for a specific moment by holding the pointer over the\n chart.\n\nWhat's next\n-----------\n\n- [Instance settings](/sql/docs/postgres/instance-settings)\n- [Cloud SQL metrics](/sql/docs/postgres/admin-api/metrics)"]]