Got timeout when the number of posts is large

Hello,

My page got the timeout error when accessing it recently. I guess that the root cause is due to a large number of posts was created. Please give me a solution for this case, my website is an online news and my customers can’t access it now.

Status

  • HTTP 504 when accessing the page
  • HTTP 500 when accessing the API for admin

About my Ghost:

  • Version: 3.0
  • CLI version: 1.13.1
  • Web server: Nginx serves as a reverse proxy
  • DB: MySQL

Have you implement any type of caching? eg Nginx or Varnish

https://scotthelme.co.uk/caching-ghost-with-nginx/

1 Like

I have not used caching for my page. Media files are using AWS S3 or external resources.

Below are some logs I got from the error log file

{"name":"Log","hostname":"hostnamex","pid":15291,"level":50,"err":{"domain":"https://pagex.net/news","message":"Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) callror: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?\n at Bluebird.try.then.catch (/home/pagex_blog/ghost/versions/3.0.0/node_modules/knex/lib/client.js:318:17)\n me/pagex_blog/ghost/versions/3.0.0/node_modules/bluebird/js/release/util.js:16:23)\n at /home/pagex_blog/ghost/versions/3.0.0/node_modules/bluebird/js/release/catch_filter.js:17:41\n at tryCatcher (/home/pagex_b0.0/node_modules/bluebird/js/release/util.js:16:23)\n at Promise._settlePromiseFromHandler (/home/pagex_blog/ghost/versions/3.0.0/node_modules/bluebird/js/release/promise.js:547:31)\n at Promise._settlePromise (/home/trrsions/3.0.0/node_modules/bluebird/js/release/promise.js:604:18)\n at Promise._settlePromise0 (/home/pagex_blog/ghost/versions/3.0.0/node_modules/bluebird/js/release/promise.js:649:10)\n at Promise._settlePromises (/homt/versions/3.0.0/node_modules/bluebird/js/release/promise.js:725:18)\n at _drainQueueStep (/home/pagex_blog/ghost/versions/3.0.0/node_modules/bluebird/js/release/async.js:93:12)\n at _drainQueue (/home/pagex_blog/ghde_modules/bluebird/js/release/async.js:86:9)\n at Async._drainQueues (/home/pagex_blog/ghost/versions/3.0.0/node_modules/bluebird/js/release/async.js:102:5)\n at Immediate.Async.drainQueues [as _onImmediate] (/home/trasions/3.0.0/node_modules/bluebird/js/release/async.js:15:14)\n at runCallback (timers.js:705:18)\n at tryOnImmediate (timers.js:676:5)\n at processImmediate (timers.js:658:5)\n at process.topLevelDomainCallback (domai"Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?","time":"2020-03-11T05:17:37.432Z","v":0}

Sounds like you’ve got database connection issues. Are you able to check that in AWS?