Mengubah kuota CPU aturan kontrol Sumber daya yang ada di kluster PolarDB for MySQL tertentu. Anda dapat mengubah nilai kuota saat ini atau beralih antara mode persentase kuota CPU maksimum dan mode jumlah core CPU maksimum. Saat mengubah aturan, Anda harus menentukan tepat satu dari parameter MaxCpu dan CpuCount.
Deskripsi operasi
Resource Control digunakan untuk membatasi Sumber daya CPU yang tersedia untuk pengguna, database, kueri, atau koneksi tertentu di kluster PolarDB for MySQL. Rilis ini mendukung pembuatan, pengubahan, penghapusan, pengikatan, dan pelepasan aturan kontrol Sumber daya, tetapi tidak mendukung mengkueri utilisasi CPU Resource Control.
Batasan
Hanya berlaku untuk kluster PolarDB for MySQL Edisi Kluster yang mendukung Resource Control. PolarDB for MySQL Edisi Standar tidak didukung.
Parameter kernel kluster loose_enable_resource_control harus diatur ke ON.
MaxCpu dan CpuCount adalah dua mode kuota CPU yang saling eksklusif.
Nilai maksimum CpuCount ditentukan oleh parameter kernel resource_control_cpu_count_limit kluster target.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
polardb:ModifyResourceControl |
update |
*All resources.
|
None | None |
Sintaks permintaan
POST HTTP/1.1
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
No |
ID wilayah tempat kluster PolarDB diterapkan. Catatan
Anda dapat memanggil operasi DescribeRegions untuk mengkueri wilayah yang tersedia. |
cn-hangzhou |
| DBClusterId |
string |
Yes |
ID kluster PolarDB. |
pc-************** |
| ResourceControlName |
string |
Yes |
Nama aturan kontrol sumber daya. Nama harus terdiri dari 1 hingga 63 karakter ASCII, dimulai dengan huruf, dan hanya boleh berisi huruf, angka, dan garis bawah. |
test_rc |
| MaxCpu |
integer |
No |
Persentase kuota CPU maksimum yang diperbarui. Nilai valid: 1 hingga 100. Anda harus menentukan tepat satu dari parameter MaxCpu dan CpuCount. |
30 |
| CpuCount |
integer |
No |
Jumlah core CPU maksimum yang diperbarui. Nilai minimum adalah 1, dan nilai maksimum ditentukan oleh parameter kernel resource_control_cpu_count_limit kluster. Anda harus menentukan tepat satu dari parameter MaxCpu dan CpuCount. |
8 |
Saat mengubah aturan, Anda harus menentukan tepat satu dari parameter MaxCpu dan CpuCount.
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
Skema tanggapan. |
||
| RequestId |
string |
ID permintaan. |
47921222-0D37-4133-8C0D-017DC3****** |
Contoh
Respons sukses
JSONformat
{
"RequestId": "47921222-0D37-4133-8C0D-017DC3******"
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameters.Malformed | The specified Resource Control parameter is not valid. | |
| 400 | Database.ConnectError | Unable to connect to the database instance. | |
| 400 | Database.ExecError | The Resource Control operation could not be executed on the database instance. | |
| 403 | IncorrectDBInstanceType | Resource Control is not supported for the current DB cluster edition or kernel configuration. | |
| 403 | AuthorizationFailure | The request is not authorized to operate Resource Control. | |
| 404 | InvalidDBClusterId.NotFound | The DBClusterId provided does not exist in our records. | DBClusterId yang ditentukan tidak ada dalam catatan saat ini. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.