Skip to content

Instantly share code, notes, and snippets.

@pavelfomin
Last active October 28, 2024 18:51
Show Gist options
  • Save pavelfomin/ed2eaff02e655cd9d27e1b72b01b54e2 to your computer and use it in GitHub Desktop.
Save pavelfomin/ed2eaff02e655cd9d27e1b72b01b54e2 to your computer and use it in GitHub Desktop.
Troubleshooting application crash looping in GCP

Troubleshooting application crash looping in GCP

  • disable auto scaling and set number of replicas manually

  • view events in GCP to get a better idea of why application is getting killed and restarted image

  • note how long it takes for app to start successfully in your current environment

    • adjust number of tries for liveness and readiness probes to accommodate slower start ups
    • enable debug logging by org.springframework.boot.availability.ApplicationAvailabilityBean
  • use GCP metrics to monitor application CPU and RAM usage

    • tune the CPU/RAM application settings in GCP
  • check the logs for how much memory is allocated for container

    • Calculated JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -Xmx3481627K -XX:MaxMetaspaceSize=200676K -XX:ReservedCodeCacheSize=240M -Xss1M (Total Memory: 4G, Thread Count: 250, Loaded Class Count: 33016, Headroom: 0%)
@pavelfomin
Copy link
Author

pavelfomin commented Oct 28, 2024

See more details on spring boot liveness and readiness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment