Scrapling memory usage #112
-
|
Hello, I have created some endpoints that call Scrapling classes. However it seems the memory usage is very high (lots of processes spawning and high RAM usage). I would like to know what's wrong with my configuration: Is there a way to close browser and context after every call? I am using a systemd ubuntu service running simple_http_server. Below are the systemd stats 8 minutes after restart and a few calls: Below is the code: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Hi there, The Here are some things you can try:
Let me know how these options work with you. |
Beta Was this translation helpful? Give feedback.
Hi there,
The
StealthyFetcherclass uses more resources thanDynamicFetcherby default because it uses thecamoufoxbrowser, which causes this.Here are some things you can try:
DynamicFetcheris sufficient for your case or not. If it is, use it, as it uses much less resources.StealthySessioninstead to keep the browser open, instead of opening a new browser with every request.DynamicSessionfor the other way around.Let me know how these options work with you.