There is no “optimal number for everyone.”
Basically, you want to ensure that WordPress has enough memory to do its job properly, but not so much that if something goes wrong with a request, that you’re not using the server’s entire memory.
Thread Starter
Tom
(@tom-van-m)
Hello Jason, thank you for your reply.
if I set it to:
define( 'WP_MAX_MEMORY_LIMIT', '8224M' );
will this make I use max 8gb of the servers total of 12gb? And when I when it to 2048, will this make 10gb unused?
The memory limit you set here is per request – not the total amount of memory you’re letting WordPress use. Setting a memory limit of 8GB per request seems completely bonkers in the vast majority of settings.
I would encourage you to use a plugin like Query Monitor to check how much memory is actually used by various page requests, and use that information to set a reasonable limit. Again, you want to shoot for there being enough memory to handle all requests without issue, without it being so large that a bad script or request waste’s 90% of your server’s available memory.
Thread Starter
Tom
(@tom-van-m)
Thanks, and I see WP_MEMORY_LIMIT is for the frontpage processes and WP_MAX_MEMORY_LIMIT is for backend.
I will mark this topic as solved.
Best, Tom
