הגדרת מגבלות על מאגר החיבורים ועל גלישת יתר כשמשתמשים ב-Node.js

הדוגמה הזו ממחישה איך להגדיר את הגודל של מאגר החיבורים ואת הקיבולת העודפת כשמתחברים ל-Cloud SQL ל-SQL Server באמצעות מודול Node.js mssql.

המשך למידה

לקבלת הסבר מפורט שכולל את דוגמת הקוד הזו, קראו את המאמר:

דוגמת קוד

Node.js

כדי לבצע אימות ב-Cloud SQL ל-SQL Server, צריך להגדיר את Application Default Credentials. מידע נוסף זמין במאמר הגדרת אימות לסביבת פיתוח מקומית.

  // 'max' limits the total number of concurrent connections this pool will keep. Ideal
  // values for this setting are highly variable on app design, infrastructure, and database.
  (config.pool.max = 5);
// 'min' is the minimum number of idle connections maintained in the pool.
// Additional connections will be established to meet this value unless the pool is full.
config.pool.min = 1;

המאמרים הבאים

כדי לחפש ולסנן דוגמאות קוד למוצרים אחרים של Google Cloud , אפשר להיעזר בדפדפן לדוגמאות שלGoogle Cloud .