Skip to content
Storage

Bandwidth & Storage Egress

Bandwidth & Storage Egress

Bandwidth & Storage egress#

Free Plan Organizations in Supabase have a limit of 10 GB of bandwidth (5 GB cached + 5 GB uncached). This limit is calculated by the sum of all the data transferred from the Supabase servers to the client. This includes all the data transferred from the database, storage, and functions.

Checking Storage egress requests in the SQL Editor#

You can use the following query to get the number of requests for each object. Run it in the SQL Editor with the query source set to Logs.

1
select
2
log_attributes['request.method'] as http_verb,
3
log_attributes['request.path'] as filepath,
4
(log_attributes['response.headers.cf_cache_status'] = 'HIT') as cached,
5
count() as num_requests
6
from logs
7
where source = 'edge_logs'
8
and (
9
log_attributes['request.path'] like '%storage/v1/object/%'
10
or log_attributes['request.path'] like '%storage/v1/render/%'
11
)
12
and log_attributes['request.method'] = 'GET'
13
group by http_verb, filepath, cached
14
order by num_requests desc
15
limit 100;

Example of the output:

1
[
2
{
3
"filepath": "/storage/v1/object/sign/large%20bucket/20230902_200037.gif",
4
"http_verb": "GET",
5
"cached": 1,
6
"num_requests": 100
7
},
8
{
9
"filepath": "/storage/v1/object/public/demob/Sports/volleyball.png",
10
"http_verb": "GET",
11
"cached": 0,
12
"num_requests": 168
13
}
14
]

Calculating egress#

If you already know the size of those files, you can calculate the egress by multiplying the number of requests by the size of the file. You can also get the size of the file with the following cURL:

1
curl -s -w "%{size_download}\n" -o /dev/null "https://my_project.supabase.co/storage/v1/object/large%20bucket/20230902_200037.gif"

This will return the size of the file in bytes. For this example, assume that 20230902_200037.gif has a file size of 3 megabytes and volleyball.png has a file size of 570 kilobytes.

Now, we have to sum all the egress for all the files to get the total egress:

1
100 * 3MB = 300MB
2
168 * 570KB = 95.76MB
3
Total Egress = 395.76MB

You can see that these values can get quite large, so it's important to keep track of the egress and optimize the files.

Optimizing egress#

See our scaling tips for egress.