سؤال

I'm trying Sails.JS with Google Cloud SQL, all seem to work fine, except that after some idle period, the DB seems to go to sleep, timing out on the first request after a long period of time.

Anyone else encountered this, and is there any known solution?

هل كانت مفيدة؟

المحلول

In order to minimize the amount you are charged for instances on per use billing plans, by default your instance becomes passive if it is not accessed for 15 minutes. The next time it is accessed there will be a short delay while it is activated. You can change this behavior by configuring the activation policy of the instance in the console.

https://developers.google.com/cloud-sql/faq#sometimes_slow

نصائح أخرى

Focus on the Activation Policy settings per the first answer given. Switching between "Per Use" and "Package Plan" are primarily billing settings. Switch your Activation Policy to "Always On" if you want to prevent the database from throttling down to idle.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top