MemoryMbytes

In actor.json you can set:
{
"minMemoryMbytes": 128,
"maxMemoryMbytes": 256,
}
{
"minMemoryMbytes": 128,
"maxMemoryMbytes": 256,
}
However, this does not change the default, which is 4096MB. When the user first opens the actor and wants to run he will get this message: "You've set memory higher than the maximum of 256MB allowed for this Actor.". While it's not super hard for the user to change this, it would be more user friendly if the suggested default amount falls within the accepted range. Is this something we can change as a developer?
6 Replies
Hall
Hall•4w ago
Someone will reply to you shortly. In the meantime, this might help: -# This post was marked as solved by Matous. View answer.
Louis Deconinck
Louis DeconinckOP•3w ago
I see that the this setting is under "DefaultRunOptions" which can be changed through the Apify Client API: - https://docs.apify.com/academy/getting-started/apify-client#updating-actor - https://docs.apify.com/api/client/js/reference/interface/ActorDefaultRunOptions As far as I understand, this is something that gets changed by the end user, not the actor developer? Is it also possible for the developer to set an initial default?
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({
token: 'YOUR_TOKEN',
});

const actor = client.actor('YOUR_USERNAME/adding-actor');

await actor.update({
defaultRunOptions: {
build: 'latest',
memoryMbytes: 256,
timeoutSecs: 20,
},
});
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({
token: 'YOUR_TOKEN',
});

const actor = client.actor('YOUR_USERNAME/adding-actor');

await actor.update({
defaultRunOptions: {
build: 'latest',
memoryMbytes: 256,
timeoutSecs: 20,
},
});
Apify client | Academy | Apify Documentation
Interact with the Apify API in your code by using the apify-client package, which is available for both JavaScript and Python.
dependent-tan
dependent-tan•2w ago
Hi @Louis Deconinck, as far as I am concerned, there is no such option (I believe the reason for this is to make developers think about what values they really want to use to prevent some undesirable behavior or credit losses). On the other hand, if you create an actor, set the defaults and publish it, the public actor will have the defaults you specified (so the user shouldn't ever run into above mentioned message, unless a) developer set their Actor wrong b) user changes something).
Louis Deconinck
Louis DeconinckOP•2w ago
How do I set the defaults as the creator?
dependent-tan
dependent-tan•2w ago
Hi, you can either do it by API request: https://docs.apify.com/api/v2/act-put, or you can set it up in the Apify Console: your-actor -> Settings (see the image)
No description
MEE6
MEE6•2w ago
@Matous just advanced to level 2! Thanks for your contributions! 🎉

Did you find this page helpful?