Skip to content
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

Performance issues with KVS holding lots of items locally #2723

Open
B4nan opened this issue Oct 25, 2024 · 1 comment
Open

Performance issues with KVS holding lots of items locally #2723

B4nan opened this issue Oct 25, 2024 · 1 comment
Labels
t-tooling Issues with this label are in the ownership of the tooling team.
Milestone

Comments

@B4nan
Copy link
Member

B4nan commented Oct 25, 2024

1 - Extract the attached file and do npm install
2 - Run it once : npm start
3 - It will generate KV with 100k keys. If you notice, KV will initialize in no time in first run
4 - Once complete, run it again with npm start
5 - Notice that it will freeze here. Ideally, that line should not do anything with size of data.

bottleneck-poc.zip

import { Actor } from 'apify';

await Actor.init();
console.log(`store initialisation started. It will freeze here when you run this POC second time.`);
const store = await Actor.openKeyValueStore('100k-keys');
console.log(`store initialised successfull`);

for (let i = 0; i < 100001; i++) {
    await store.setValue(`number-${i}`,"1");
    console.log(`storing ${i}`);
}   

console.log('100k KV stored');

await Actor.exit();

Originally posted by @dhrumil4u360 in #2722 (comment)

@github-actions github-actions bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Oct 25, 2024
@vladfrangu
Copy link
Member

A very painful dupe of #2248 ... It's really starting to bite our ass more and more because we cannot just preload everything without scanning the whole dir (or storing a metadata file mandatory)

@B4nan B4nan added this to the 4.0 milestone Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t-tooling Issues with this label are in the ownership of the tooling team.
Projects
None yet
Development

No branches or pull requests

2 participants