Rate Limiter module can be useful when to disallow concurrent web service access to the application.
This module exposes a "Rate Limiting" service for RestAPI web service calls. This service features:
Accept
HTTP headers and Drupal recommended _format
calls. Follow installation guide to install the module into the site.
Navigate to Configuration >> Web services >> Rate Limiter Configuration (admin/config/services/rate-limiter). The configuration has two segments.
General Configuration has basic configurations to enable the module with allowed request limit in an allowed time frame. An optional message can be shown when the limit is reached.
Access Rules has two option to enable rate limiting service for all web-service request or based on IP. If IP based rate limiting is selected then there is an IP based white listing option available.
The following points were assumed while developing the module.
Accept
headers
or _format
query string with "json", "hal_json" and "xml" values.This module stores all it's rate limiter hit counts in Drupal's cache. So clearing cache will remove all the items. Assumed that in a production environment caches are not cleared more often.
_format
to determine a service request
and Response.