Strategie per la risoluzione dei problemi di App Engine
Le sezioni seguenti spiegano come applicare strategie di risoluzione dei problemi generali per risolvere l'errore. Se continui a riscontrare errori anche dopo aver seguito i passaggi descritti nelle guide alla risoluzione dei problemi, consulta la sezione Passaggi successivi.
Generare log validi utilizzando Cloud Logging
La risoluzione dei problemi relativi all'app in esecuzione su App Engine è più facile se disponi di log dell'applicazione di buona qualità per il debug. Assicurati che l'applicazione scriva i log in modo da correlare i log delle richieste con i log dell'applicazione.
Con i log correlati puoi identificare la richiesta che richiede un'ulteriore analisi, trovare la traccia della richiesta e analizzare la causa principale del problema. Per ulteriori informazioni sulla scrittura dei log, vedi Scrivere log delle applicazioni.
Risolvere la latenza imprevista
Se riscontri problemi di latenza:
Verifica se la latenza interessa tutte le richieste al tuo servizio o solo una piccola percentuale. La dashboard della latenza di App Engine mostra la latenza al 50°, al 95° e al 99° percentile.
Se la latenza è elevata per tutte e tre le metriche, significa che è elevata per almeno il 50% delle richieste. Se noti una latenza elevata solo nel
grafico del 99° percentile, significa che la latenza è elevata nell'1% delle richieste.
Identifica la richiesta con latenza elevata per comprendere la fonte della latenza. Puoi utilizzare Cloud Trace o Cloud Logging per capire quanto tempo è durata una determinata richiesta. Per ulteriori informazioni, vedi Informazioni sulla latenza delle app.
Per identificare le richieste con latenza elevata utilizzando Cloud Logging, applica il filtro traceSampled=true per correlare i log in Cloud Logging con le tracce in Cloud Trace. Per ulteriori informazioni, consulta Eseguire l'integrazione con Cloud Logging.
Prova a seguire questi passaggi per risolvere i problemi di latenza e migliorare le prestazioni del servizio:
Per impostazione predefinita, il servizio App Engine è accessibile sulla rete internet pubblica, ma puoi modificarlo per applicare ulteriori limitazioni alla connettività di rete in entrata e in uscita.
Puoi limitare le connessioni in entrata con le impostazioni di ingresso o tramite le regole del firewall di App Engine. Se hai problemi a connetterti al servizio App Engine da reti VPC o risorse internet, verifica quanto segue:
Per risolvere i problemi di uscita del traffico verso una rete VPC, controlla le regole firewall della rete VPC o utilizza il pooling delle connessioni nel client. Per ulteriori informazioni, consulta Regole firewall.
Assicurati di non sovraccaricare il connettore VPC con più servizi e connessioni oltre la soglia. Per migliorare il throughput, valuta le dimensioni e il numero di istanze del connettore VPC per i tuoi connettori. Per saperne di più, consulta
Accesso VPC serverless.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[[["\u003cp\u003eThis page provides guidance on troubleshooting errors encountered while using App Engine, with links to resources for deployment, serving, latency, and connectivity issues.\u003c/p\u003e\n"],["\u003cp\u003eUtilizing Cloud Logging to ensure correlated request and application logs is essential for efficient debugging and identifying the root cause of issues.\u003c/p\u003e\n"],["\u003cp\u003eIf encountering latency issues, check the App Engine latency dashboard to determine the scope of the problem and use Cloud Trace or Logging to pinpoint the source of the latency, and modify your app in accordance with the suggestions provided.\u003c/p\u003e\n"],["\u003cp\u003eConnectivity issues can be resolved by reviewing ingress settings, App Engine firewall rules, running network connectivity tests, and checking VPC network configurations.\u003c/p\u003e\n"],["\u003cp\u003eThe Google Cloud Service Health Dashboard and the history of all App Engine-related incidents are valuable resources for staying informed about service disruptions.\u003c/p\u003e\n"]]],[],null,["# Troubleshoot App Engine errors\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\nThis page describes the troubleshooting process for errors you might encounter while\nusing App Engine. For information about incidents affecting Google Cloud\nservices, refer to the [Google Cloud Service Health Dashboard](https://status.cloud.google.com/summary) and [All incidents reported for App Engine](https://status.cloud.google.com/products/kchyUtnkMHJWaAva8aYc/history).\n\nSee the following pages for guidance on how to resolve issues related to your app:\n\n- [Troubleshoot deployment issues](/appengine/docs/standard/troubleshooter/deployment)\n- [Troubleshoot serving issues](/appengine/docs/standard/troubleshooter/serving)\n- [Troubleshoot elevated latency in your app](/appengine/docs/standard/troubleshooter/latency)\n- [App Engine connectivity strategies](/appengine/docs/standard/troubleshooter/connectivity)\n\nApp Engine troubleshooting strategies\n-------------------------------------\n\nThe following sections explain how you can apply general troubleshooting\nstrategies to resolve your error. If you continue to encounter errors\neven after following the steps in the troubleshooting guides, see [What's next](#whats-next).\n\n### Output good logs using Cloud Logging\n\nTroubleshooting your app running on App Engine is easier if you have good\napplication logs for debugging. Ensure your application writes logs in a way that\n[correlates request logs with the application logs](/appengine/docs/standard/writing-application-logs#correlate_logs).\n\nWith correlated logs you can identify the request that needs further analysis,\nfind the request trace, and analyze the root cause of the issue. For more\ninformation on writing logs, see [Write application logs](/appengine/docs/standard/writing-application-logs#writing_app_logs).\n\n### Resolve unexpected latency\n\nIf you encounter issues with latency, do the following:\n\n1. Check if the latency is affecting all requests to your service or only a\n small percentage. The [App Engine latency dashboard](/appengine/docs/standard/monitoring-and-alerting-latency#checking_the_latency_dashboard) shows 50th,\n 95th, and 99th percentile latency.\n\n If you have high latency on all three of these metrics, you have high latency\n for at least 50% of your requests. If you only see high latency in the\n 99th percentile graph, you have high latency in 1% of your requests.\n2. Identify the request with high latency to understand the source of\n latency. You can use Cloud Trace or Cloud Logging to understand how\n long a particular request has taken. For more information, see [Understanding app latency](/appengine/docs/standard/monitoring-and-alerting-latency#understanding_app_latency).\n\n To identify requests with high latency using Cloud Logging, apply the `traceSampled=true` filter to correlate logs in Cloud Logging with traces in Cloud Trace. For more information, see [Integrate with Cloud Logging](/trace/docs/trace-log-integration).\n3. Try the following steps to fix latency issues, and improve service performance:\n\n - Increase the [instance class](/appengine/docs/standard#instance_classes) settings.\n\n - Reduce cold start latency by [configuring warmup requests](/appengine/docs/standard/configuring-warmup-requests).\n\n - Adjust [scaling settings](/appengine/docs/standard/how-instances-are-managed#scaling_dynamic_instances).\n\n \u003c!-- --\u003e\n\n - Consider using [Profiler](/appengine/docs/standard/cloud-profiler).\n\n - Modify your source code.\n\nFor more information on how to troubleshoot elevated latency issues, see [Troubleshoot elevated latency in your app](/appengine/docs/standard/troubleshooter/latency).\n\n### Resolve issues with connectivity\n\nBy default, your App Engine service is accessible on the public internet, however,\nyou can modify the service to have more restrictions on ingress and egress\nnetwork connectivity.\n\nYou can restrict ingress connections with the ingress settings, or through App Engine firewall rules. If you have trouble connecting to your App Engine service from\nVPC networks or internet resources, check the following:\n\n- [Ingress settings](/appengine/docs/standard/ingress-settings)\n- [App Engine firewall](/appengine/docs/standard/understanding-firewalls)\n\nTo resolve other connectivity issues, do the following:\n\n- Run a [network connectivity test](/network-intelligence-center/docs/connectivity-tests/how-to/running-connectivity-tests#console_6).\n\n- To resolve problems with traffic egress to a VPC network, check the VPC network\n firewall rules or use connection pooling in your client. For more information,\n see [Firewall rules](/vpc/docs/serverless-vpc-access#connector-fw-rules-standalone-vpc-or-host-prj).\n\n- Ensure that you aren't [overloading your VPC connector](/appengine/docs/standard/connecting-vpc#network-cpu) with more services and\n connections beyond its threshold. To improve throughput, consider the VPC connector\n size and instance count for your connectors. For more information, see\n [Serverless VPC Access](/vpc/docs/serverless-vpc-access#scaling).\n\n- For problems accessing VPC resources, review the [VPC connector throughput charts](/vpc/docs/serverless-vpc-access#throughput_chart).\n\nFor more information on how to troubleshoot connectivity issues, see\n[App Engine connectivity strategies](/appengine/docs/standard/troubleshooter/connectivity).\n\n### What's next\n\nIf you can't find a solution to your problem in the App Engine\ndocumentation, follow these steps:\n\n- Open a support case by contacting [Cloud Customer Care](/support-hub).\n- Get support from the community by [asking questions on StackOverflow](https://stackoverflow.com/questions/tagged/google-app-engine), or search for similar issues using the `google-app-engine` tag.\n- Open bugs or feature requests by using the [public issue tracker](/support/docs/issue-trackers).\n\nFor more information, see [App Engine community](/appengine/docs/standard/community)."]]