• Resolved Tom

    (@tom-van-m)


    Hello all,

    A question: On a private server with 12GB and 8 cores we run a busy WordPress website and some other small websites.
    What should I set here in config.php to have it optimal running?

    define( 'WP_MEMORY_LIMIT', '????' );
    define( 'WP_MAX_MEMORY_LIMIT', '?????' );

    This for example?:

    define( 'WP_MEMORY_LIMIT', '1028M' );
    define( 'WP_MAX_MEMORY_LIMIT', '8224M' );

    Thanks sofar!
    Best,
    Tom

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘define( ‘WP_MEMORY_LIMIT’, ‘????’’ is closed to new replies.