hamburger icon close icon
Google Cloud Storage

GCP Persistent Disk Deep Dive: Tips, and Tricks

Read Next:

When it comes to highly performant storage, Google Cloud Persistent Disk is the go-to Google Cloud storage offering, providing managed block storage capabilities for multiple services and diverse customer use cases.

It is easy to get started with Google Cloud Persistent Disk, but it has some capabilities that many users never explore. In this article, we are going to cover four aspects of Persistent Disks that are often overlooked, and you should definitely consider as you deploy in Google Cloud.

Use the links below to jump down directly to the tips we’ll cover in this article:

Quick Glance at Persistent Disks

Google Cloud Persistent Disks provide virtual instances with the storage capabilities those instances need to operate. The level of flexibility and configuration options available make Persistent Disk a very accessible cloud storage service for customers new to cloud computing. The user can simply start by choosing a geographical region and one of three types of persistent disks that better suits the workload’s requirements:

  • Standard disks for workloads that primarily use sequential I/Os.
  • SSD for enhanced performance and single-digit millisecond latencies.
  • Local SSDs for even lower latencies but without redundancy capabilities and availability bound to the instance lifetime.

Provisioned IOPS for Better Performance

The concept of IOPS, or Input/Output Operations per Second, and their impact in cloud storage performance is often not taken into account. Even with a suitable disk type chosen, it might not be enough to achieve a satisfying performance. Tweaking the amount of IOPS and throughput to make the system more efficient and generate a better business impact is one way to improve this.

However, in Google Persistent Disks, IOPS is not a value that can be set very easily. Moreover, it is not obvious at first the amount of IOPS Disks have and how that value was defined in the first place. To create a persistent disk with a suitable amount of IOPS, and thus, better performance, you will need to craft the right combination of factors. These factors include the disk type (Standard or SSD), machine type, disk size and cross-checking against the documentation.

When adding persistent disks while creating a new virtual instance in Google Compute Engine, the user interface will give an estimate of the performance based on your selection. For guidance, you can always rely on the official Google block storage performance documentation.

Using the default instance type and adding a new 500GB Standard Persistent Disk, the estimated IOPS limit will be 375.00 and 750.00 for read and write operations, respectively.

Estimated performance on a 500GB Standard Persistent DiskEstimated performance on a 500GB Standard Persistent Disk

Changing the disk type to SSD persistent disk and lowering the size to 100 GB will result in an estimated IOPS limit of 3.000.00 for both read and write operations, which is roughly ten times higher than a standard Persistent disk with five times more capacity (500GB).

Estimated performance on a 100GB SSD Persistent DiskEstimated performance on a 100GB SSD Persistent Disk

Therefore, it’s important to understand the performance impact when choosing a disk size and type to maximize the performance gain.

Live Resize Persistent Disks in Running Instances

With cloud storage and Google Persistent Disks, users get near-unlimited storage capacity across different global regions, enabling full system scalability. For customers using Google Cloud, an increase in disk size is possible at the push of a button and can be done without compromising the system availability.

persistent disk sizeChanging the size of a Persistent Disk in-use by an instance

In fact, it works so well that, thanks to a few command line tricks, you have the ability to resize the persistent disk of a running instance without the need to shut it down or reboot. To do so, you can login the instance and use a combination of the commands cfdisk, growpart, and resize2fs.

Using Multiple Persistent Disks in the Same Instance

Much like a physical machine, each instance has its own persistent disk where the operating system and user data reside.

While cloud storage gives you a near-infinite amount of elasticity and growth capacity in a single persistent disk, it may not be wise to place all your eggs in the same basket. A fact often overlooked is that you can use multiple persistent disks in the same virtual machine instance.

Attaching (and removing) persistent disks to an instance can be done either upon creation or at any time throughout its lifecycle.

Adding multiple persistent disks to an instance during creationAdding multiple persistent disks to an instance during creation

Using multiple disks gives a huge amount of flexibility and opens up more possibilities. A potential scenario would be separate persistent disks for both operating system and application data, enabling the application data disk to be detached and reattached to another instance if needed. Moreover, by having separate disks you can also meet different performance and availability requirements, such as faster disks or independent backup policies, that wouldn’t be possible otherwise.

Creating Snapshots and Images from Persistent Disks

Snapshots and images are among the most powerful features that are related to Persistent Disks. Like a Swiss army knife, they can be used to solve a tremendous amount of use cases. The use cases for these images include using them to pre-install necessary software, storing custom configurations tailored to your system prior to deployment, and snapshots enabling fast backups and rollbacks.

A snapshot can be taken at any point in time from a Google Cloud Persistent Disk. This enables you to preserve the disk state at that time and restore it if and when needed. Therefore, snapshots are a typical way to backup persistent disks.

A Compute Engine instance is created from a Google Cloud Disk image. This initial image can be chosen from the public Google repository based on the operating system you wish, or selected from your own private images. The latter option, private images that are generated from persistent disk snapshots, enables you to rapidly launch an instance that is pre-configured with everything your system needs, from operating system to application configuration, which saves you precious time in getting up and running while making the image its own immutable deployment artifact.

Conclusion

As you can see, there is a lot more than meets the eye in GCP Persistent Disks. Even if you have already been using Google Cloud and the Persistent Disk service, it is definitely worth it to take time to explore its features and how your system can leverage them.

For workloads with demanding storage requirements or users managing terabytes or petabytes of data, Cloud Volumes ONTAP for Google Cloud is a great alternative option to take into account. With Cloud Volumes ONTAP, you gain access to a whole new set of advanced data management features that run on top of Google Cloud Persistent Disks.

Cloud Volumes ONTAP provides extreme high performance, cost-cutting storage efficiencies, data tiering infrequently used data from Persistent Disks to object-based Google Cloud Storage, data protection, among many other capabilities that will make your life easier and reduce your operational overhead.

New call-to-action
Bruno Almeida, Technology Advisor

Technology Advisor