realtime icon indicating copy to clipboard operation
realtime copied to clipboard

Bulk updates "break" realtime

Open GaryAustin1 opened this issue 3 years ago • 0 comments

Bug report

Describe the bug

Was writing a quick test to check performance of realtime in the face of lots of database updates.

Doing an update of 5000 rows in a table (single SQL statement) works for 5000 rows (completes browser console logs in 1 second with or without RLS) to a single subscription (very impressive)

Doing an update of 7000 records returns only 5000 messages with no error.

Doing an update of 10000 records returns no messages and generates no error.

EDIT: adding a 2nd client computer does not impact the above, including 5000 records in about 1 second.

This is all on a free instance.

I realize the test is not reflective of likely realworld apps, and realtime has warnings about overloading, but was looking into how fast realtime can generate payloads.

Is there any info or guidance on realistic bandwidth without failing silently?

To Reproduce

Create a table with 10000 rows with an id column and a count column. Use supabase.js to subscribe to the table. In the SQL editor run UPDATE table SET count = count +1 WHERE id < 5000 (works) UPDATE table SET count = count +1 WHERE id < 10000 (does not work)

Edit: This also works at 5000, fails at 10000.

 do $$
begin
for r in 1..5000 loop
insert into realtest(count) values(r);
end loop;
end;
$$;

Expected behavior

Having better info on "breaking" points for realtime for various instance sizes.

System information

Latest everything.

GaryAustin1 avatar Aug 02 '22 00:08 GaryAustin1