Back

Despite not using or storing any files, the bandwidth usage is excessively high.

  • 0
  • Self Hosted
  • Flutter
  • Databases
  • Storage
new user
26 Apr, 2023, 20:43

why the bandwidth usage is excessively high.

TL;DR
The user is experiencing high bandwidth usage despite not using or storing any files. They are discussing a function in which they are fetching documents and filtering them by permissions. They are concerned about the bandwidth usage and computation involved. The solution suggested is to handle the filtering internally within the function and only send back the filtered results, thus reducing bandwidth usage. The user also mentioned a spike in bandwidth usage and asked about calculating the size of requests. The support team suggests checking the response size in the network tab and explains that the bandwidth usage may be higher due to larger response sizes. The cause of the excessively high bandwidth usage is not determined in this thread.
Binyamin
26 Apr, 2023, 20:46

What was returned in your 60k spike? If the size of each response was 1K then it will be 60MB and for you it seems like 2-3KB for each response.

It is not much but indeed bigger then average small responses

new user
26 Apr, 2023, 20:48

ok

new user
26 Apr, 2023, 20:49

how can we calculate this

Binyamin
26 Apr, 2023, 20:49

Do you know what are the requests?

Binyamin
26 Apr, 2023, 20:50

If there in web for example you can check the response size in the network tab

new user
26 Apr, 2023, 20:51

not really but i think request are generally response from server

Binyamin
26 Apr, 2023, 20:52

Maybe a database response with a lot of documents ?

new user
26 Apr, 2023, 20:52

ok

Binyamin
26 Apr, 2023, 20:54

In conclusion it’s a bit big response but nothing out of the ordinary

new user
26 Apr, 2023, 20:55

i have small doubt, if one collection contain 1 million documents of all user then when ever we make a request which means our bandwidth size will more ?

Binyamin
26 Apr, 2023, 20:56

If you will send back all the million documents in one response, then sure it will use a huge amount of bandwidth

new user
26 Apr, 2023, 20:58

then how to handle this because as i am fetching all documents and filtering them by permissions, which means more bandwith and computation

Binyamin
26 Apr, 2023, 20:59

You can do it inside a function. Then it will be only internal bandwidth. And after filtering it inside the function send back only the filtered results

new user
26 Apr, 2023, 21:06
TypeScript
        databaseId: databaseID,
        collectionId: collectionId,
        queries: [
          Query.limit(10000),
          //Query.equal("id", getuserId.$id),

        ]
      );``` here is how i am fetching document but its giving me particular users data i have just used permission for filtering data, now in this condition should i have to use function because data is filtered internally by appwrite (in my asumption, may be i can wrong)
Binyamin
26 Apr, 2023, 21:07

Yes that will work. When you’re initializing the function. Provide the use JWT instead of the API key

new user
26 Apr, 2023, 21:08

nor using api key neither jwt

Binyamin
26 Apr, 2023, 21:09

I mean in the function

new user
26 Apr, 2023, 21:11

ok, Thank you.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more