I have a Java program that does simple key/value upserts and gets. It works great. But sometimes, for unknown reasons, I have to set very long timeouts as shown below. This does seem somewhat related to how far away the server is. For servers across the ocean I need longer timeouts. But even in those cases, the timeout I need to use is far longer than the actual connection ever takes. I have experienced this for US servers also (200 miles away) where true latency is only like 50ms, but I still need to set much larger timeouts.
Once I set the big timeouts, everything works very fast.
Has anyone else bumped into this?
final CouchbaseEnvironment env = DefaultCouchbaseEnvironment.builder() .socketConnectTimeout((int) TimeUnit.SECONDS.toMillis(30)) .connectTimeout(TimeUnit.SECONDS.toMillis(30)) .kvTimeout(TimeUnit.SECONDS.toMillis(5)).build(); final Cluster cluster = CouchbaseCluster.create(env, cluster_nodes);