-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Object store - List bucket's content is very slow #4680
Comments
Do you see same slow behavior with the NATS cli? |
Is there any other CLI different from the one mentioned in the documentation - https://docs.nats.io/nats-concepts/what-is-nats/walkthrough_setup (https://github.com/nats-io/natscli/releases) and I have used? |
That's the one. |
Then yes. The slow behavior have been started from the CLI tool. As I mentioned in the beginning of the "Steps to reproduce" there was error: "nats: error: context deadline exceeded" when trying to list objects with
So almost 7s for the single file in the bucket. |
Would you be willing to create a stream snapshot of the ObjectStore and share with the Synadia team? |
How to do this? And does it make sense to upload huge files somewhere if this behavior is reproducible? I have taken for example a Fedora Rawhide distro (previously it was tested in Windows 10) with the latest NATS release:
Then I took a CentOS distro (12G) for example and put it into the object store bucket in the same way:
This is a log from the server with more details.
|
Just need to use full stream name, which you can see via |
If we can reproduce with your snapshot on our side, that would be very helpful. Thanks. |
You are correct, we can upload any large asset ourselves, will attempt to follow your steps and reproduce. Thanks for your patience and apologies for not reading more thoroughly. |
I can see the behavior here locally. Will keep you posted. And again thanks for the patience. |
…mber for deliver last by subject (#4712) Previously we would need to move through all msg blocks and load all of the blocks into memory. We optimized this regardless to flush the cache if we loaded it like other places in the code, but for this specifically we load subject's totals which is already in memory and for each matching subject we now simply load the last message for that subject and add the sequence number to the skip list. This drastically improves consumers that want last per subject, like KV watchers and object store lists. Signed-off-by: Derek Collison <[email protected]> Resolves: #4680
Observed behavior
Listing items in the specific bucket of the object store is very slow, even if there is only one item.
Expected behavior
Expected to get a list of the items faster.
Server and client version
nats-server 2.10.3
natscli 0.1.1 (that is recommended here https://docs.nats.io/nats-concepts/what-is-nats/walkthrough_setup)
NATS.Client for .NET 1.1.0
Host environment
Microsoft Windows NT 10.0.19045.0
CPU: AMD Ryzen 9 5950X
NVMe: ADATA SX8200PNP
Steps to reproduce
I have created a bucket as in docs:
nats obj add testbucket
, and added a big file to it (~18G):nats obj add testbucket somefile.mp4
. When trying to get the list of the objects in the bucket:nats obj ls testbucket
I have received a message "nats: error: context deadline exceeded" with some delay.In the server log I got this message:
[68776] 2023/10/19 14:48:10.303340 [WRN] Internal subscription on "$JS.API.CONSUMER.CREATE.OBJ_testbucket.32td3LZE.$O.testbucket.M.>" took too long: 6.8698428s
When upgraded timeout to 10s:
/nats obj ls testbucket --timeout=10s
it was ok.I supposed that this is client-side problems and created a simple app using the latest NATS.Client for .NET 1.1.0:
It was also failing with default timeout. After some tuning it started working and in a consequent 10 runs time to get the list with the single object there was varying from 3.5s to 5.0s. A bit better but anyway very slow. Adding the second 14G file push this delay to 7.5+ seconds, another 8G file added one more second to this process and so on.
At the same time getting files by name is quick. It starts to download immediately.
As I see, the name of the file is added to the end of the stream (the last block file). I don't know yet how the storage is organized internally , but if it is using streams, maybe it would make sense to separate blob stream from the stream with meta-information to remove this functional dependency on the blob size? Because small objects works much faster.
The text was updated successfully, but these errors were encountered: