0 votes
127 views
by Rookie

Hello, 

i have been looking on this url https://webinoly.com/en/documentation/webinolys/ it is shared here how to increase WP_MAX_MEMORY_LIMIT that is the commend php-max-mem to be included on /opt/webinoly/webinoly.conf however my question is how could i add WP_MEMORY_LIMIT ? is there a config for this?
 

  • WP_MEMORY_LIMIT = front end
  • WP_MAX_MEMORY_LIMIT = back end ( admin things )
by Expert
Just for the record, I don't know where you read, but Webinoly docs never mention anything about WP memory variables.
by Expert
And where do you see the WP prefix (variables) you mentioned before?
by Rookie

Do you mean variable WP_MEMORY_LIMIT? that is my question since  WP_MAX_MEMORY_LIMIT variable is php-max-mem in /opt/webinoly/webinoly.conf 

I was thinking if I would be increasing WordPress WP_MEMORY_LIMIT? is there a config for this? a user named handpressed answer is a workable solution but I was just wondering if there is a global configuration for this so we don't need to edit wp-config.php for all sites every time

Thanks,

by Expert

First of all, WP_MAX_MEMORY_LIMIT is NOT the same as php-max-mem, Webinoly docs never mention it.

And no, I don't know how to define server-wide WordPress variables.

Here is a link to a short and good explanation: 

https://decrypto.net/the-difference-between-wp_memory_limit-and-wp_max_memory_limit/

by Rookie
edited by

thanks for the response, yes that's the same guide I check before I post this question, 

and with regards to your statement that WP_MAX_MEMORY_LIMIT and php-max-mem are not the same, uhm but looks like it has the same function or let's say effect? ( could you please elaborate why this is so? )

screenshot from server

screenshot from wordpress



what I have been trying to solve and asked if it's possible to set this WP LIMIT to higher value ( to all sites via webinoly )

currently only achievable by adding on define( 'WP_MEMORY_LIMIT', '128M' ); wp-config.php file, mannually per site.. 

by Rookie
edited by

Why do you feel there's a need to increase PHP memory usage globally for every WordPress site on your server? In my 15 years of using and developing with WordPress, I haven't had to worry about the WP_MEMORY_LIMIT setting that often. Surely it's an advantage to have such fine grain control over each site's PHP memory usage? I think so anyway.

From the post linked above:

As is often the case with computing resources, setting a higher memory limit doesn’t necessarily increase the performance of your WordPress site. Since WP_MEMORY_LIMIT controls memory allocation PER SCRIPT, it’s actually in your best interest to set it as low as possible to reduce the chance of a rogue script saturating the RAM in your server.

by Expert

Documentation is very clear, also you can read the WordPress Codex about this topic.

  • wp_memory_limit is for each WP script (PHP).
  • wp_max_memory_limit is specifically for the WP admin area.
  • PHP memory_limit (php-max-mem) is for any PHP script running in your server. WP variables are limited by this one.
As you can see, they are three very different things.
Regards.
by Rookie

Ok, I do understand your point, 

what i simply express on this inquiry is wp_memory_limit is wordpress wp-config variable and as wordpress utilized PHP so it still relies to memory_limit (php-max-mem) settings on the server so whatever changes applied to global PHP settings php-max-mem will be applicable to all wordpress unless limited by a variable in wp-config by wp_memory_limit, 

we place it that these 3 variables are different, yes that is a correct argument however both wp_memory_limit and memory_limit share the same purpose, 

by Rookie

I understand, but I choose not to discuss the reason here on this thread as it would be out of topic, has something to do with WooCommerce optimization

Why do you feel there's a need to increase PHP memory usage globally for every WordPress site on your server? In my 15 years of using and developing with WordPress, I haven't had to worry about the WP_MEMORY_LIMIT setting that often. Surely it's an advantage to have such fine grain control over each site's PHP memory usage? I think so anyway.

1 Answer

0 votes
by Rookie

You can increase the WP_MEMORY_LIMIT for individual sites by adding a constant to the site's wp-config.php file, e.g.:

define( 'WP_MEMORY_LIMIT', '128M' );

What's the difference between WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT?

by Rookie
thank you, this could be a workaround, I hope there is a server-wide way :(
Welcome to the Community site for Webinoly.

Our Optimized LEMP Web Server is a powerful set of commands for doing just about anything you could wish.

With Webinoly you can set up your NGINX web server in just one step.

* * * * * * *

If you have a question about Webinoly, please ask in English or Spanish.

To report a bug, please ask a question here with the bug tag.

Donations

Webinoly Support Paypal Donations Webinoly Support Bitcoin Donations

Your regular donations is what keep this project moving forward. If you like Webinoly, buy me a coffee or a beer to show support.

Affiliate Links

It is very important that any visitor to the site read the disclaimer, terms of use and privacy and legal statement before start browsing.

...