autoscale pool trying to scale up without suffecient memory
Hi All,
im running a playwright crawler and am running into a bit of an issue with crawler stability. Have a look at these two log messages
autoscaled pool is trying to increase its concurrency from 4 to 5 since it was in its view idle. 20 seconds later though
which suggests memory was much tighter than autoscaledpool was considering, likley due to the additional ram that chromium was using. Crawlee was running in a k8 pod with a 4GB ram limit. Is this behaviour intended and how might i improve my performance? Does autoscaled pool account for how much ram is actually in use or just how much the node process uses?
6 Replies
View post on community site
This post has been pushed to the community knowledgebase. Any replies in this thread will be synced to the community site.
Apify Community
xenial-blackOP•7mo ago
heres a log export from my service. after this the pod autorestarts due to the memory limit
quickest-silver•7mo ago
The
AutoscaledPool
doesn't ensure the memory never goes above the limit, it just doesn't scale to more requests if it is close. So if there is a sudden memory spike, like on very heavy page, it can still cause troubles. You can either limit maxConcurrency
or play with the autoscaledPoolOptions
to reduce memory scaling.xenial-blackOP•7mo ago
but it seems to me that the pool was still trying to scale up, even while there was no extra memory to be had?
Hi @Crafty if the defaults settings doesn't work for you may adjust the ratios for scaling up by https://crawlee.dev/api/core/interface/AutoscaledPoolOptions in the Crawler options.
xenial-blackOP•7mo ago
Thanks for these, eventually i found the snapshotter used memory ratio and turned it down. 🙂