sensitive-blue
sensitive-blue2w ago

Do i need to set memory limits

Do i need to set memory limits programmatically or from actor sittings
4 Replies
aciku
aciku2w ago
Let’s say the user decided to set 8192 MB in the run options, and since you didn’t have a limit set, I assume Apify just let it run. Let’s take this run as an example it says 4m 23s, which is 263 seconds.
aciku
aciku2w ago
No description
aciku
aciku2w ago
So:
1 CU = 1024 MB * 1 hour
1 CU = 1024 MB * 1 hour
So the formula would be:
CU = ( MEMORY (MB) / 1024 ) * DURATION (HOURS)
CU = ( MEMORY (MB) / 1024 ) * DURATION (HOURS)
Memory in CU = 8192 MB / 1024 = 8 CU/hour

Time in hours = 263 / 3600 = 0.07305555555


Total CU = 8 × 0.07305555555 = 0.5844444444 CU

Total cost = 0.5844444444 × $0.40 = $0.23377777776
Memory in CU = 8192 MB / 1024 = 8 CU/hour

Time in hours = 263 / 3600 = 0.07305555555


Total CU = 8 × 0.07305555555 = 0.5844444444 CU

Total cost = 0.5844444444 × $0.40 = $0.23377777776
and your revenue would be
1 actor start = $ 0.001

8 Email Validation = 0.0015 * 8 = $0.012

Total = $0.012 + $ 0.001 = $0.013
1 actor start = $ 0.001

8 Email Validation = 0.0015 * 8 = $0.012

Total = $0.012 + $ 0.001 = $0.013
That’s why it’s important to set memory limits, otherwise your memory costs will eat you up.
extended-salmon
extended-salmon7d ago
Thanks

Did you find this page helpful?