title: Google Cloud Run Sudden Traffic Spike Error
body: <p>I am using cloud run to service requests sent by my Google App Engine asynchronously. It seems to work fine when I send a cluster of 10 or so async requests. When I send a cluster of 50 async requests I begin to encounter the 500 error &quot;The request was aborted because there was no available instance&quot;</p>
  <p>My max instances is set to 500, so I'm not concerned about actually running out of resources. It just seems that Cloud run is not able to boot up enough containers fast enough to handle the large influx of requests. I want to boot up a new miniscule container (smallest possible memory and cpu) for each individual request.</p>
  <p>Other than having a minimum # of instances always running which would be prohibitively expensive, is there any other configuration options I have that could help Cloud Run handle a sudden traffic increase?</p>
  <p>I've included my requirements.txt below, is one of my dependencies known for causing long container startup? I have a lot of difficulty getting clear metrics from GCP on how long my containers take to start up</p>
  <p>EDIT: I've decided to utilize a workaround until I can find a solution. Although I sacrifice some speed, I was able to batch my asynchronous requests into an amount manageable for cloud run to scale.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>aiohttp==3.7.3
  async-timeout==3.0.1
  asyncio==3.4.3
  attrs==20.3.0
  authclient==1.0
  CacheControl==0.12.6
  cachetools==4.2.1
  certifi==2020.6.20
  cffi==1.14.4
  chardet==3.0.4
  charset-normalizer==2.0.5
  click==7.1.2
  colorama==0.4.4
  ConfigArgParse==1.4
  cycler==0.10.0
  decorator==4.4.2
  dnspython==1.16.0
  ecdsa==0.14.1
  enum-compat==0.0.3
  et-xmlfile==1.0.1
  eventlet==0.30.0
  firebase-admin==4.5.3
  Flask==1.1.2
  Flask-BasicAuth==0.2.0
  Flask-Caching==1.10.1
  Flask-Cors==3.0.9
  Flask-SQLAlchemy==2.4.4
  future==0.18.2
  gevent==21.1.1
  geventhttpclient==1.4.4
  google-api-core==1.26.3
  google-api-python-client==2.1.0
  google-auth==1.28.0
  google-auth-httplib2==0.1.0
  google-cloud-core==1.6.0
  google-cloud-firestore==2.1.0
  google-cloud-storage==1.37.0
  google-crc32c==1.1.2
  google-resumable-media==1.2.0
  googleapis-common-protos==1.53.0
  greenlet==1.0.0
  grpcio==1.36.1
  gunicorn==20.0.4
  httplib2==0.19.1
  idna==2.7
  intuit-oauth==1.2.3
  itsdangerous==1.1.0
  jdcal==1.4.1
  Jinja2==2.11.2
  jose==1.0.0
  kiwisolver==1.3.1
  MarkupSafe==1.1.1
  msgpack==1.0.2
  multidict==5.1.0
  mysql==0.0.3
  mysql-connector==2.2.9
  mysql-connector-python==8.0.22
  mysqlclient==2.0.3
  networkx==2.5
  oauthlib==3.1.0
  openpyxl==2.4.4
  packaging==20.9
  passlib==1.7.4
  Pillow==8.0.1
  proto-plus==1.18.1
  protobuf==3.14.0
  psutil==5.8.0
  pyasn1==0.4.8
  pyasn1-modules==0.2.8
  pycparser==2.18
  pycryptodome==3.10.1
  pymongo==3.11.2
  PyMySQL==0.10.1
  pyparsing==2.4.7
  python-dateutil==2.8.1
  python-dotenv==0.18.0
  python-jose==2.0.2
  python-quickbooks==0.8.4
  pytz==2020.5
  pyzmq==22.0.3
  rauth==0.7.3
  requests==2.25.1
  requests-oauthlib==1.3.0
  rsa==4.7
  simplejson==3.17.2
  six==1.15.0
  SQLAlchemy==1.3.20
  typing-extensions==3.7.4.3
  uritemplate==3.0.1
  urllib3==1.24.3
  Werkzeug==1.0.1
  yarl==1.6.3
  zope.event==4.5.0
  zope.interface==5.2.0</code></pre>
  </div>
  </div>
  </p>