Skip to content

Implementing API Endpoint Throttling Tied to User Sessions #1944

Description

@URVL

Impress and Node.js versions

No response

Platform

No response

Describe the bug

Currently, there is a single queue for all users per API endpoint to manage throttling. This setup allows a single user to flood an endpoint with requests, leading to performance degradation for the API experienced by other users. To address this, we propose binding the throttling mechanism to individual user sessions. This change aims to ensure that the excessive requests of one user do not negatively impact the API performance for others.

A piece of video discussing this problem

//Example method with timeout and queue:

({
  timeout: 1000,

  queue: {
    concurrency: 1,
    size: 200,
    timeout: 3000,
  },

  method: async ({ a, b }) => {
    const result = a + b;
    return result;
  },
});

To Reproduce

No response

Expected behavior

No response

Screenshots

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions