I'm currently doing this, but it's VERY slow since I have several terabytes of data in the bucket:
gsutil du -sh gs://my-bucket-1/
And the same for a sub-folder:
gsutil du -sh gs://my-bucket-1/folder
Is it possible to somehow obtain the total size of a complete bucket (or a sub-folder) elsewhere or in some other fashion which is much faster?
In the list of buckets, click on the name of the bucket that contains the object you want to download. The Bucket details page opens, with the Objects tab selected. Navigate to the object, which may be located in a folder. Click the Download icon associated with the object.
Google Cloud Storage is an object storage service that allows you to upload files to a virtual bucket, providing quick and easy file storage for your applications. It competes with AWS's S3 storage service on both price and features.
Google limits data retrieval to 4MB/sec for every TB stored. The more data you store in Google Cloud Storage Nearline the higher download speed you get., e.g. if you store 5TB you will be able to get you data back at 20MB/s. It will promptly take 73 hours to get the whole data set back.
There is not a charge for the buckets existing, and the buckets themselves can also be deleted for free (although their may be a charge for deleting some of the objects inside them, such as very new coldline objects). Therefore buckets are very, very cheap for any reasonable number of buckets.
The visibility for google storage here is pretty shitty
The fastest way is actually to pull the stackdriver metrics and look at the total size in bytes:
Unfortunately there is practically no filtering you can do in stackdriver. You can't wildcard the bucket name and the almost useless bucket resource labels are NOT aggregate-able in stack driver metrics
Also this is bucket level only- not prefixes
The SD metrics are updated daily so unless you can wait a day you cant use this to get the current size right now
UPDATE: Stack Driver metrics now support user metadata labels so you can label your GCS buckets and aggregate those metrics by custom labels you apply.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With