Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Mounting Cloud Filestore (NFS Storage) on Cloud Run vs GKE - Which is faster?

  1. We are contemplating migrating to Cloud Run from GKE Standard because of time taken for the POD to mount PV/PVC  (Using Cloud FileStore Standard which is an NFS persistent storage with a size of 1TB). It takes approx 15 - 20 seconds for the POD to be in ready status ready to serve requests. We believe this is because of the time taken by the POD to mount the Cloud FileStore NFS mount though there are other parameters like time taken by the nodes to pull the image etc. Currently we use Cloud Filestore as persistent storage which PODS mount via PV / PVC. Will mounting the same filestore on Cloud Run have improved performance?
Solved Solved
0 4 498
1 ACCEPTED SOLUTION

Hi @dheerajpanyam,

I understand your concern about the delay in pods attaining "Ready" status because of Cloud Filestore mounts is valid. The roughly 15–20 second lag is mainly attributable to the NFS mount procedure, and although image retrieval and pod setup durations play a role, the Filestore mount might be a major reason.

Options:

1. Migrating to Cloud Run:

Cloud Run does not support mounting Cloud Filestore directly. Instead, you can consider:

  • Using Google Cloud Storage (mounted via gcsfuse for filesystem-like access) for persistent data.
  • Accessing Cloud Filestore through an API interface (HTTP/gRPC) rather than mounting it directly.
  • Prefetching or caching essential data in memory or temporary storage for faster access during runtime.

While Cloud Run eliminates the mounting process and potentially reduces start-up times, ensure your application's stateless nature aligns with Cloud Run’s design.

2. Optimizing GKE Standard:

If migrating to Cloud Run introduces complexities, optimize your current GKE setup by:

  • Node Pre-warming: Pre-allocate and keep nodes ready with mounted Filestore volumes to reduce pod initialization time.
  • Regional SSD Filestore: Switch from Standard to SSD-backed Filestore for faster mount and access times.
  • PersistentVolume Improvements: Configure Filestore mount options for reduced latency or experiment with mounting settings.

I can say that Cloud Run can provide reduced startup latency but this will require reworking your application’s storage approach. If persistent storage and filesystem compatibility are critical, I would recommend sticking to GKE and optimizing Filestore performance might be the better path.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.

View solution in original post

4 REPLIES 4

Hi @dheerajpanyam,

I understand your concern about the delay in pods attaining "Ready" status because of Cloud Filestore mounts is valid. The roughly 15–20 second lag is mainly attributable to the NFS mount procedure, and although image retrieval and pod setup durations play a role, the Filestore mount might be a major reason.

Options:

1. Migrating to Cloud Run:

Cloud Run does not support mounting Cloud Filestore directly. Instead, you can consider:

  • Using Google Cloud Storage (mounted via gcsfuse for filesystem-like access) for persistent data.
  • Accessing Cloud Filestore through an API interface (HTTP/gRPC) rather than mounting it directly.
  • Prefetching or caching essential data in memory or temporary storage for faster access during runtime.

While Cloud Run eliminates the mounting process and potentially reduces start-up times, ensure your application's stateless nature aligns with Cloud Run’s design.

2. Optimizing GKE Standard:

If migrating to Cloud Run introduces complexities, optimize your current GKE setup by:

  • Node Pre-warming: Pre-allocate and keep nodes ready with mounted Filestore volumes to reduce pod initialization time.
  • Regional SSD Filestore: Switch from Standard to SSD-backed Filestore for faster mount and access times.
  • PersistentVolume Improvements: Configure Filestore mount options for reduced latency or experiment with mounting settings.

I can say that Cloud Run can provide reduced startup latency but this will require reworking your application’s storage approach. If persistent storage and filesystem compatibility are critical, I would recommend sticking to GKE and optimizing Filestore performance might be the better path.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.

Thanks so much @greb 

Any examples on Node prewarming and the other options in GKE that you talked about @greb ?

GKE (Google Kubernetes Engine) is generally faster for mounting Cloud Filestore (NFS storage) compared to Cloud Run. This is because GKE allows more control over the underlying infrastructure, including networking and pod configurations, which can provide better performance for NFS storage.

In contrast, Cloud Run is designed for stateless applications and is more optimized for quick scaling, but may experience some latency when accessing persistent NFS storage due to its serverless nature and cold start times.