Back

Record addition or update appears after 30 minutes!! Why is this delay caused?

  • 0
  • Self Hosted
  • Tools
Binyamin
24 Aug, 2023, 17:53

Use this gist to connect directly to your database and check if the data is being update in realtime

TL;DR
The user is experiencing a delay of 30-40 minutes when adding or updating records in a collection. It is suggested that the delay could be caused by having too many events in a given minute. The recommendation is to decentralize the databases or optimize the code to handle a larger number of devices sending data to the server. Flushing the Redis cache is suggested as a temporary solution to fix the delay. It is also recommended to use the provided gist to connect directly to the database and check if the data is being updated in real-time.
Binyamin
24 Aug, 2023, 17:54

If you want You can run this to clear the cache

TypeScript
docker exec -it appwrite-redis redis-cli
# then
127.0.0.1:6379> flushall
Binyamin
24 Aug, 2023, 17:54

To see if it then updated on the spot in the console

Binyamin
24 Aug, 2023, 17:55

Just know that flushing the cache can interfere for queue jobs so use it only if all of your code works in async most of the time

Yasin E.
24 Aug, 2023, 17:57

If this solves the problem. How can I fix this permanently?

Yasin E.
24 Aug, 2023, 17:57

Will manual cleaning always be required this way? How can I update redis settings? do you have a suggestion?

Yasin E.
24 Aug, 2023, 17:59
Binyamin
24 Aug, 2023, 18:03

It fixed it?

Yasin E.
24 Aug, 2023, 18:04

I'll try it in an hour when it slows down completely.

Binyamin
24 Aug, 2023, 18:06

From what I see it should clear the cache But, first let's make sure this is the problem before digging into it

Yasin E.
24 Aug, 2023, 18:30

flushall

Yasin E.
24 Aug, 2023, 18:30

I ran it and it's back to normal

Yasin E.
24 Aug, 2023, 18:31

my problem seems to be redis cache.

Yasin E.
25 Aug, 2023, 06:21

This is how I added events to a function. for how it should work

I am adding a record to these collections. but the event starts Function Executions after 30-40 minutes.

collections.647f40efa6de6e094841

Yasin E.
25 Aug, 2023, 06:23

event triggers are running too late.

Yasin E.
25 Aug, 2023, 06:29
Yasin E.
25 Aug, 2023, 11:25

@Binyamin Where do you think I can fix this?

Binyamin
25 Aug, 2023, 13:14

I think maybe it because you have too many events in a given minute Do you get error on running functions?

Yasin E.
25 Aug, 2023, 13:28
Yasin E.
25 Aug, 2023, 13:28

bigint(20) unsigned changed to double

Yasin E.
25 Aug, 2023, 13:28

now no error πŸ˜„

Yasin E.
25 Aug, 2023, 13:29

no errors at the moment it works flawlessly.

unable to write stats data.

Binyamin
25 Aug, 2023, 13:30

So you have error right now?

Yasin E.
25 Aug, 2023, 13:31

I think maybe it because you have too many events in a given minute

This is the problem but 50 devices are working right now.

If 1000 devices send data to the server, if the event runs, appwrite will fire.

won't the appwrite system be able to manage this?

Binyamin
25 Aug, 2023, 14:15

Will be able but those events are in a queue one after each other using <:redis:1042565927952199811> Redis. For most use-case the 6GB ram sound pretty enough for me.

If you continue to experience this delays with the databases I'll recommend decentralizing the databases.

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