Back

Clicking bucket freezes appwrite instance

  • 0
  • Storage
D5
27 Oct, 2023, 15:22

worker 5, 8, 12

TL;DR
The appwrite instance freezes when clicking on the bucket. Previews may not generate if the storage preview limit is set too low. Increasing the limit may help. The issue may be due to high CPU usage during image processing. Consider limiting CPU usage or upgrading to a larger server. It is unclear why the previews cause everything to freeze. The connection may be failing without any errors, possibly due to high CPU usage. Checking the stack trace logs may provide more information. Upgrading to a newer version of appwrite may be more demanding. Increasing CPU or server size may solve the issue.
ZachHandley
27 Oct, 2023, 15:22

Hm interesting

D5
27 Oct, 2023, 15:23
TypeScript
appwrite  | [2023-10-27 12:02:18 $8.0]  WARNING Server::check_worker_exit_status                   (): worker(pid=1212, id=11) abnormal exit, status=0, signal=9
appwrite  | Worker 12 started successfully
appwrite  | [2023-10-27 12:02:39 $8.0]  WARNING Server::check_worker_exit_status                   (): worker(pid=18, id=7) abnormal exit, status=0, signal=9
appwrite  | Worker 8 started successfully
appwrite  | [Error] Timestamp: 2023-10-27T12:02:56+00:00
appwrite  | [Error] Method: GET
appwrite  | [Error] URL: /v1/storage/buckets/:bucketId/files/:fileId/preview
appwrite  | [Error] Type: PDOException
appwrite  | [Error] Message: SQLSTATE[HY000] [2002] Connection refused
appwrite  | [Error] File: @swoole-src/library/core/Database/PDOPool.php
appwrite  | [Error] Line: 35
appwrite  | [2023-10-27 12:03:18 $8.0]  WARNING Server::check_worker_exit_status                   (): worker(pid=16, id=5) abnormal exit, status=0, signal=9
appwrite  | Worker 6 started successfully
ZachHandley
27 Oct, 2023, 15:23

I’d just give it more CPU personally, but it’s interesting that would happen, is 1.4.x more demanding than 1.3.x?

D5
27 Oct, 2023, 15:24

Would increase costs, and I try to avoid that

D5
27 Oct, 2023, 15:24

I'm using 1.3.8

ZachHandley
27 Oct, 2023, 15:25

Makes sense, how big is the file?

D5
27 Oct, 2023, 15:26

Also I had 3k request in a day with up to 40 realtime connections in such server and it handled it correctly with margin for even more requests so I don't think it's needed to have a bigger server 😅

D5
27 Oct, 2023, 15:26

2MB

ZachHandley
27 Oct, 2023, 15:27

You could exec into Appwrite and check the stack trace logs

ZachHandley
27 Oct, 2023, 15:27

Meh same as the error log potentially though

D5
27 Oct, 2023, 15:28

I got it right now so I have clean logs:

ZachHandley
27 Oct, 2023, 15:30

Funny how iPhones can do so much but can’t open a text attachment, one sec

ZachHandley
27 Oct, 2023, 15:32

It seems, to me at least, that the connection is simply failing, it might just be a simple “it’s reaching 100% for some reason because files are harder” or something similar because if the connection is just being refused without any errors, what else could it be?

D5
27 Oct, 2023, 15:51

Maybe error causes the connection failing?

ZachHandley
27 Oct, 2023, 15:56

Error probably causes it but the question is why? If it's just refusing the connection entirely, it's not much of an error, maybe it's a safety thing?

D5
27 Oct, 2023, 16:16

No idea, sincerely

D5
27 Oct, 2023, 16:17

A fact is that each file has a very large name

Drake
27 Oct, 2023, 16:49

sounds about right. it gets cached so it doesn't freeze anymore, but then the cache expires and then all the previews need to be generated again

D5
27 Oct, 2023, 16:59

And why when previews are being generated everything freezes?

D5
27 Oct, 2023, 17:00

I understand they could take much CPU power for them being generated, but 100% CPU in 2 cores and freezing the instance for about 10 seconds I think It's too much

D5
27 Oct, 2023, 17:04

If there isn't any solution, is there any way to limit CPU usage so the Appwrite instance doesn't gets freezed?

Drake
27 Oct, 2023, 17:57

image processing can use up a lot of CPU. The only env var we have for previews is _APP_STORAGE_PREVIEW_LIMIT

D5
27 Oct, 2023, 18:09

And setting that will improve anything?

Drake
27 Oct, 2023, 18:11

if it's low, the previews won't get generated

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