want to increase the speed of one site to more than 1024 limit

taker18

Verified User
Joined
Oct 18, 2021
Messages
141
Location
USA
at the PHP setting memory is 1024, However, that is only 20% of my server.

How can I increase the global memory for all sites?
 
You can edit the configuration file. locate your php.ini file. The location might vary, but it's commonly found in
/etc/php/7.x/cli/php.ini or /etc/php/7.x/fpm/php.ini (replace 7.x with your PHP version).

Open the file in a text editor and find the line:
memory_limit = 1024M

Change it to the desired value, for example:
memory_limit = 2048M

Save the file and restart the web server (Apache/Nginx) for the changes to take effect.
 
You can edit the configuration file. locate your php.ini file. The location might vary, but it's commonly found in
/etc/php/7.x/cli/php.ini or /etc/php/7.x/fpm/php.ini (replace 7.x with your PHP version).

Open the file in a text editor and find the line:
memory_limit = 1024M

Change it to the desired value, for example:
memory_limit = 2048M

Save the file and restart the web server (Apache/Nginx) for the changes to take effect.
sorry for the late reply, it took me a while to do so.

so I am using Apache

in order to check the PHP.ini

sudo php --info | grep "php.ini"
come out like this
Configuration File (php.ini) Path => /usr/local/php81/lib


Loaded Configuration File => /usr/local/php81/lib/php.ini

The interesting part that I found it the
memory_limit = 128M
only
anyway i I changed to
memory_limit = 2048M
and i restarted HTTPBD
sudo service httpd restart


I restated the PHP-Fpm81 at the front end panel


DirectAdmin Web Interface:
  • Log in to DirectAdmin.
  • Navigate to "Admin Tools" > "Service Monitor."

where I can find out if the memory limit is increased, why it was only 128
 
sorry for the late reply, it took me a while to do so.

where I can find out if the memory limit is increased, why it was only 128

128MB is a sane default that is sufficient for more simple scripts. You don't want to give a user unlimited resources, because that way they can disrupt the stability of your entire server. Even if you are the sole user, giving an unlimited amount can still cause issues due to improper scripting and memory leaks. Hence the default.

As to finding it out, create a PHP script somewhere on your domain, name it something like test.php and throw this in:

PHP:
<?php
phpinfo();
?>

Then, visit that script and it'll show you the settings for the used PHP interpreter. Afterwards, be sure to remove that file as it leaks information about your environment.

Cheers.
 
becarefully, it could freeze your server.

but if it's just for admin backend site and not use too much in the same time, then it still safe.

About "memory_limit", maybe it could be php-fpm "php_admin_value" prevent/rewrite from changing in global "php.ini".
when you using Per User php.ini settings , it will save options as "php_admin_value".
 
Last edited:
@johannes

because it's per-connection limit.

Imagine there have some customer using resource around 1.5gb, it meant if there have concurrent connection 10 time it could consume resource 15gb ( 1.5 * 10 ). this will freeze other site to use resource until old connection ended.
 
Can't you just use the custom fields in Custom HTTPD Configurations for individual user's php.conf's....... This is better than setting it globally....... That said, not sure if you set 80MB in the main php.ini, you can set it higher per user.
 
Can't you just use the custom fields in Custom HTTPD Configurations for individual user's php.conf's....... This is better than setting it globally....... That said, not sure if you set 80MB in the main php.ini, you can set it higher per user.
Can you please elaborate more in this, while the global limit still
well, that is the case, my server is 64G Ram, and according to Direct admin is 1024M is the limit which is about 20%. but I have one site that has courses and is heavy on RAM and CPU which I mainly want to increase its resources
1- increase the global Ram instead of only using about 20%
2- control every site from wp config or htaccess file.
so how can I achieve this
 
128MB is a sane default that is sufficient for more simple scripts. You don't want to give a user unlimited resources, because that way they can disrupt the stability of your entire server. Even if you are the sole user, giving an unlimited amount can still cause issues due to improper scripting and memory leaks. Hence the default.
so how much should it be, do you mean that needs to stay the same 128M?
Thank you
 
I would keep the default at 128 M and every user which needs more, can set this in his user account in the php settings to a higher level.
So if you have one site needing 1024 (which is a very lot) then it can be set in his user account.

If wp sites need more let them set this too via their account.

So this way sites which do not need more, are kept on 128 M which is often enough for most sites.
 
I would keep the default at 128 M and every user which needs more, can set this in his user account in the php settings to a higher level.
So if you have one site needing 1024 (which is a very lot) then it can be set in his user account.

If wp sites need more let them set this too via their account.

So this way sites which do not need more, are kept on 128 M which is often enough for most sites.
Welcome @Richard G that was my original idea to control each site separately. which makes sense mostly to everyone in the thread.

there is one thing that I am missing, Does the global Ram is really limited to 1024M by direct admin ?
what is the server is more than that that, and adding more sites soon, I need to increase the 1024m.
am I stuck in my 20% or my server Ram?

That I am not able to get it clearly why the global is limited 1024 and how can I increase it.
 
what is the server is more than that that, and adding more sites soon, I need to increase the 1024m.
No you don't, why would you? :)
Your 64 GB Ram is devided or better said, it's used by multiple things, so also apache and mysql/mariadb etc. make use of that RAM.

It's not like "the more sites I have, the more of 1024 RAM I need".
There is a way to make it able by customisation that a customer can choose more than 1024 M, but I would advise against that.

For example, when you look at a heavy used forum like this one, often 256M is already enough or maybe 512M.

I've got a server with a lot of Wordpress sites and some forums and the server is running fine and the Wordpress sites just use 128M and some 256.

Suppose you have 10 sites and you all give them 1024M and they then it's already 10 GB. Like explained it can eat up your resources.
Very very little sites need 1024 M RAM.

That I am not able to get it clearly why the global is limited 1024 and how can I increase it.
It's like @jeroenlaylo and @Ohm J already explained how it works and also that it can be dangerous for your server. You can increase it globally but there is no reason to.
We have our servers not really very full with users. So for example one server has 88 users which have 229 domains. Some are testing or empty so lets say of those 229 around 180 have a website and we also have a global of 128 and only some users have more.
Suppose 88 users and let's say 80 have a website and everybody would be used at the same time. It's 80x1024M is 81,9 GB and your server is stuck.
So with 128M it's 80x128M=10 GB in use and your server still keeps running.
So suppose you give some people who really need it some more and the rest you keep at 128.

It's RAM which is used by php-fpm, it's not like with a VPS where every users needs to get a certain amount of vCPU's and RAM.
 
It's RAM which is used by php-fpm, it's not like with a VPS where every users needs to get a certain amount of vCPU's and RAM.
Wow @Richard G thank for clearing it out.
I think that make sense.
I understand and it make sense to me.
I am only controlling each site by the config.file and that is more than enough.
Moreover
I might need to educate myself in subject even more.
Thank you all
Everything remain the same, back to business.
Thank you DA community
 
Back
Top