Optimize Transfers to Google Cloud Storage
Say, you have a 10-Gbps direct peering connection to Google.
Say you would like to use the gsutil tool to upload files to Cloud Storage buckets from on-premises servers.
You want to optimize the bandwidth utilization of the connection (as you notice that your uploads are not using the full 10-Gbps bandwidth) . In order to accomplish this optimization, you need to tweak your data center (on-premises servers).
- The perfdiag command runs a suite of diagnostic tests for a given Google Storage bucket. Gsutil performance can be impacted by many factors at the client, server, and in-between, such as: CPU speed; available memory; the access path to the local disk; network bandwidth; contention and error rates along the path between gsutil and Google; operating system buffering configuration; and firewalls and other network elements.
- The perfdiag command is provided so that customers can run a known measurement suite when troubleshooting performance problems. If you have ever wondered why a connection transmits at a fraction of the available bandwidth — even when both the client and the server are capable of higher rates — then it might be due to a window size mismatch.
- The Transmission Control Protocol (aka TCP) works by sending windows of data over the internet, relying on a straightforward system of handshakes and acknowledgements to ensure arrival and integrity of the data, and in some cases, to resend it. On the plus side, this results in a very stable internet. On the downside, it results in lots of extra traffic. And when the sender or receiver stop and wait for ACKs for previous windows/packets, this creates gaps in the data flow, limiting the maximum throughput of the connection. Imagine, for example, a saturated peer that is advertising a small receive window, bad network weather and high packet loss resetting the congestion window, or explicit traffic shaping limiting the throughput of your connection.
- To address this problem, window sizes should be just big enough such that either side can continue sending data until it receives an ACK for an earlier packet. Keeping windows small limits your connection throughput, regardless of the available or advertised bandwidth between instances. For the best performance possible in your application, you should really fine-tune window sizes depending on your client connections, estimated egress and bandwidth constraints
Need a hands-on, GCP Consultant?
Need help with your GCP journey? Start the conversation today.
Leave a Reply