Hi,
We use Cloud Spanner and an auto-scaler for our system. However, when the system scales in, we encounter "deadline exceeded" errors. For instance, whenever the computing resources are reduced by 2K, these errors consistently occur.
Is there a way to fix this issue? Why doesn't the system scale in gracefully?
Thanks!
When you scale in a Cloud Spanner instance, the system must redistribute data and perform other maintenance tasks. This can take some time, and if the system is under heavy load, it may not be able to complete these tasks before the deadline expires.
Another reason why Cloud Spanner might not scale in gracefully is that the auto-scaler may not be configured correctly. The auto-scaler has a number of parameters that control how it scales the system, such as the minimum and maximum number of nodes, the cooldown period, and the scaling method. If these parameters are not set correctly, the system may scale in too aggressively, which can lead to errors.
How to fix the issue:
There are a few things you can do to fix the issue of Cloud Spanner not scaling in gracefully:
Additional tips:
Here are some specific steps you can take to troubleshoot the issue:
Thank you @ms4446
Try increasing the scaling timeout.
Could you please tell me the exact config name of "scaling timeout"? I couldn't find it.
To do this, you can set the maxRpcTimeoutMillis
parameter in the Cloud Spanner client library to a higher value. The default value is 60000 milliseconds (60 seconds).
For example, to increase the scaling timeout to 120 seconds, you would set the maxRpcTimeoutMillis
parameter to 120000.
Note: Increasing the scaling timeout may delay the time it takes for the system to scale in, but it can help to prevent deadline exceeded errors.
Here is an example of how to set the maxRpcTimeoutMillis
parameter in the Java Cloud Spanner client library:
import com.google.cloud.spanner.DatabaseClient;
import com.google.cloud.spanner.SpannerOptions;
public class Main {
public static void main(String[] args) {
SpannerOptions options = SpannerOptions.newBuilder()
.setMaxRpcTimeoutMillis(120000)
.build();
DatabaseClient client = DatabaseClient.create(options);
// ... use the client ...
}
}
maxRpcTimeoutMillis
parameter in the other Cloud Spanner client libraries, such as the Python and Go client libraries.Once you have increased the scaling timeout, you should test the scaling behavior of your system to make sure that it is working as expected.