<commit_before>---
title: Troubleshooting App Deployment and Health
owner:
  - Routing
  - Release Integration
---

<% $this_topic = 'troubleshoot-app-health' %>

See this topic for help diagnosing and resolving common issues when you deploy and run apps on Cloud Foundry.


## <a id='scenarios'></a> Common Issues

The following sections describe common issues you might encounter when attempting to deploy and run your app, and possible resolutions.

### <a id='time'></a> cf push Times Out

If your deployment times out during the upload or staging phase, you may receive one of the following error messages:

* `504 Gateway Timeout`
* `Error uploading application`
* `Timed out waiting for async job JOB-NAME to finish`

If this happens:

* **Check your network speed.** Depending on the size of your app, your `cf push` could be timing out because the upload is taking too long. An Internet connection speed of at least 768 KB/s (6 Mb/s) for uploads is recommended.

* **Make sure you are pushing only needed files.** By default, `cf push` will push all the contents of the current working directory. Make sure you are pushing only the directory for your app. If your app is too large, or if it has many small files, Cloud Foundry may time out during the upload. To reduce the number of files you are pushing, ensure that you push only the directory for your app, and remove unneeded files or use the `.cfignore` file to [specify excluded files](prepare-to-deploy.html#exclude).

* **Set the CF\_STAGING\_TIMEOUT and CF\_STARTUP\_TIMEOUT environment variables.** By default your app has 15 minutes to stage and 5 minutes to start. You can increase these times by setting `CF_STAGING_TIMEOUT` and `CF_STARTUP_TIMEOUT`. Type `cf push -h` at the command line for more information.

* **If your app contains a large number of files, try pushing the app repeatedly.** Each push uploads a few more files. Eventually, all files have uploaded and the push succeeds. This is less likely to work if your app has many small files.

### <a id='upload'></a> App Too Large

If your app is too large, you may receive one of the following error messages on `cf push`:

* `413 Request Entity Too Large`
* `You have exceeded your organization's memory limit`

If this happens:

* **Make sure your org has enough memory for all instances of your app.** You will not be able to use more memory than is allocated for your organization. To view the memory quota for your org, use `cf org ORG_NAME`.<commit_msg>Replaced various 'recommended' phrases with recommended_by variables [#170652140]<commit_after>---
title: Troubleshooting App Deployment and Health
owner:
  - Routing
  - Release Integration
---

<% $this_topic = 'troubleshoot-app-health' %>

See this topic for help diagnosing and resolving common issues when you deploy and run apps on Cloud Foundry.


## <a id='scenarios'></a> Common Issues

The following sections describe common issues you might encounter when attempting to deploy and run your app, and possible resolutions.

### <a id='time'></a> cf push Times Out

If your deployment times out during the upload or staging phase, you may receive one of the following error messages:

* `504 Gateway Timeout`
* `Error uploading application`
* `Timed out waiting for async job JOB-NAME to finish`

If this happens:

* **Check your network speed.** Depending on the size of your app, your `cf push` could be timing out because the upload is taking too long. <%= vars.recommended_by %> recommends an Internet connection speed of at least 768 KB/s (6 Mb/s) for uploads.

* **Make sure you are pushing only needed files.** By default, `cf push` will push all the contents of the current working directory. Make sure you are pushing only the directory for your app. If your app is too large, or if it has many small files, Cloud Foundry may time out during the upload. To reduce the number of files you are pushing, ensure that you push only the directory for your app, and remove unneeded files or use the `.cfignore` file to [specify excluded files](prepare-to-deploy.html#exclude).

* **Set the CF\_STAGING\_TIMEOUT and CF\_STARTUP\_TIMEOUT environment variables.** By default your app has 15 minutes to stage and 5 minutes to start. You can increase these times by setting `CF_STAGING_TIMEOUT` and `CF_STARTUP_TIMEOUT`. Type `cf push -h` at the command line for more information.

* **If your app contains a large number of files, try pushing the app repeatedly.** Each push uploads a few more files. Eventually, all files have uploaded and the push succeeds. This is less likely to work if your app has many small files.

### <a id='upload'></a> App Too Large

If your app is too large, you may receive one of the following error messages on `cf push`:

* `413 Request Entity Too Large`
* `You have exceeded your organization's memory limit`

If this happens:

* **Make sure your org has enough memory for all instances of your app.** You will not be able to use more memory than is allocated for your organization. To view the memory quota for your org, use `cf org ORG_NAME`.
{'fraction_non_alphanumeric': 0.0683474492810715, 'fraction_numerical': 0.00689383494189482, 'mean_word_length': 4.2840790842872005, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1207970', 'n_tokens_mistral': 1358, 'n_tokens_neox': 1283, 'n_words': 784}