-1

A Drupal website is using external Rest API service.

The problem is that in a rare occasion when the Rest API service loses database or crashes for whatever reason, that causes the Drupal website to slow down.

Drupal uses many API endpoints frequently so when those are unavailable, the website becomes useless.

What would be a reliable or efficient way to check if the API is available prior to each request?

Thanks.

1 Answers1

1

First you need an alternate action for when the service is unavailable.

Then its just a matter of detecting the status of the service. Say, 5 calls time out in a 1 min period. Keep track of this stat and switch to your alternate method when it triggers.

Obvs. you want some automated way of switching it back on again of possible. Maybe a backend service to check every so often, or maybe just start sending requests again after a back off period.

Ewan
  • 83,178