DOS Alert in 5.3

Sanjay Shah2 years ago

Commented as guided and it worked well.

However, still the permissions api is taking time for specific userid case when more devices are already associated with the same. eg. userid with 1000 entries with deviceid is taking long time compared to userid with 100 entries .

In case of 4.14 this works smooth in all cases.

Anton Tananaev2 years ago

Which specific API?

Sanjay Shah2 years ago

permissions api

Anton Tananaev2 years ago

Repeating what you already said doesn't really help. There are multiple permissions APIs. Adding/removing/listing, batch/single.

Sanjay Shah2 years ago

adding /api/permissions which will add record in tc_user_device table

To be more specific POST api for /api/permissions

{
    "userId": 2,
    "deviceId": 6043
}
Anton Tananaev2 years ago

Most likely the delay is caused by cache refresh. How many active devices does the device have? And how many users have access to this device?

Sanjay Shah2 years ago

It is not the device, the user has access to all the device on the platform. So permissions api used to map that device to this master user everytime device is added.

So this user is associated with 1000 device.

While the other user associated with 100 device takes less time.

So if I use same device with other userid the permissions api POST runs quick

But if I use this userid with any device the permissions api POST runs slow

Anton Tananaev2 years ago

That's expected. It invalidates everything linked to the user.

Sanjay Shah2 years ago

Meaning, the performance will be deteriorated ? Or some solution has to be found to resolve this delay in POST.

Sanjay Shah2 years ago

it is taking 50-60 second to submit a postman POST request on /api/permissions.

Isn't that killing

Anton Tananaev2 years ago

There might be a way to optimize it. If you're interested in sponsoring the work, let me know.

Sanjay Shah2 years ago

Surprised. you are asking me to sponsor. This is a bug which I tracked down as per your guidance, though not a coder myself. Disappointed to see this message.

Anton Tananaev2 years ago

A somewhat slow API response is not a bug.

Sanjay Shah2 years ago

50-60 sec response is considered as somewhat ?

Sanjay Shah2 years ago

After long debug we found the cache is flushed as and when new devices are added using device api and permissions are mapped using permissions api.

This closes all device ports on server and then connections are established again.

Completely making system unstable.