• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question RAM useage and php.ini and my.ini

abc500x500

New Pleskian
Hi Specialists.
Please help me.
In a dedicated server for shared hosting.
When we set an amount RAM in php.ini for creating a selling plan plesk linux. what meaning that?
For example we set memory_limit=64mb and and set time out to 30sec:
We have 10 host account and each account has 2 wordpress each wordpress has 7 Simultaneous viditor
Which is true:
maximum Amount of RAM usage of php on server will be
1- 10*2*7*64mb =8960 mb RAM usage
2- 10*2*64mb = 1280 mb RAM usage
3- 10*64 mb = 640 mb RAM usage

Also this about apache and mysql memory settings

Thanks.
 
Hi Specialists.
Please help me.
In a dedicated server for shared hosting.
When we set an amount RAM in php.ini for creating a selling plan plesk linux. what meaning that?
For example we set memory_limit=64mb and and set time out to 30sec:
We have 10 host account and each account has 2 wordpress each wordpress has 7 Simultaneous viditor
Which is true:
maximum Amount of RAM usage of php on server will be
1- 10*2*7*64mb =8960 mb RAM usage
2- 10*2*64mb = 1280 mb RAM usage
3- 10*64 mb = 640 mb RAM usage

Also this about apache and mysql memory settings

Thanks.

Hello, the value max_memory_usage only define the memory a php script can use during his process. It doesn't mean a php script will use all the allowed memory, and it's not related to the amount of visitors.
 
Hello, the value max_memory_usage only define the memory a php script can use during his process. It doesn't mean a php script will use all the allowed memory, and it's not related to the amount of visitors.
Thanks.
please clear this for me.
if i set memory_limit=1mb and 10000 visitor in one moment use script;
10000mb of RAM of server will be in use or only 1mb? (presuppose that script for each visitor when work use all 1mb RAM fully)
 
Thanks.
please clear this for me.
if i set memory_limit=1mb and 10000 visitor in one moment use script;
10000mb of RAM of server will be in use or only 1mb? (presuppose that script for each visitor when work use all 1mb RAM fully)

It will not be 10000mb. But there is no relation between visitors and ram usage
 
It will not be 10000mb. But there is no relation between visitors and ram usage
Therefor,why when visitors of a php script site increase, server can not work? Also why server sellers say increase of RAM of server need when visitor increase?
 
for exam they say for hosting 3000 account of wordpress (3000 different website) in one dedicated server need 256GB RAM and for 1500 wordpress need 128GB RAM?
 
for exam they say for hosting 3000 account of wordpress (3000 different website) in one dedicated server need 256GB RAM and for 1500 wordpress need 128GB RAM?

each wordpress instance will require some ram, and more resources if there are more visitors, but there is no direct relation. It's not 1000 visitors 1GB RAM, 2000 visitors 2GB RAM.
 
each wordpress instance will require some ram, and more resources if there are more visitors, but there is no direct relation. It's not 1000 visitors 1GB RAM, 2000 visitors 2GB RAM.
Can you please, how we can calculate HW of dedicated server when account of shared hosting increased?
also
for a wordpress website in shared hosting when alocated 256MB for account then php.ini memory limit=64mb; if an account alocated 1024MB RAM we must increase php.ini memory limit to what number?
 
It is not possible to pre-calculate the amount of RAM that is needed. It depends on how much RAM each websites requires at an unknown time t and how many requests are coming in at the same time, what script is executed, what the script does and so on. You must also consider that not only the PHP script will reserve RAM, but subsequent processes, e.g. database requests, maybe elaborate left joins over many tables, will also require RAM. That could well exceed what PHP was limited to, because these are not controlled by PHP settings.

You can try to use cgroups to limit the amount of RAM that a single website can use at any time, but you cannot control how many requests might come in at the same time. So even if you limit each website to for example 128 MB RAM and your server is hit with 1000 requests for a specific page that actually requires 128 MB you'd be at 128 GB total RAM usage instantly. However, this is a very unlikely scenario. Most content can be delivered with a much lower RAM utilization.
 
It is not possible to pre-calculate the amount of RAM that is needed. It depends on how much RAM each websites requires at an unknown time t and how many requests are coming in at the same time, what script is executed, what the script does and so on. You must also consider that not only the PHP script will reserve RAM, but subsequent processes, e.g. database requests, maybe elaborate left joins over many tables, will also require RAM. That could well exceed what PHP was limited to, because these are not controlled by PHP settings.

You can try to use cgroups to limit the amount of RAM that a single website can use at any time, but you cannot control how many requests might come in at the same time. So even if you limit each website to for example 128 MB RAM and your server is hit with 1000 requests for a specific page that actually requires 128 MB you'd be at 128 GB total RAM usage instantly. However, this is a very unlikely scenario. Most content can be delivered with a much lower RAM utilization.

Thank you for explaning.

I have 4 plan for shared hosting:

plan01=256gb ram + 1% cpu + 64mb php.ini
plan02=512gb ram + 2% cpu + ??mb php.ini
plan03=1024gb ram + 4% cpu + ??mb php.ini
plan04=2048gb ram + 8% cpu + ??mb php.ini

user start with one script like wordpress or other script on plan01 and memory limited in php.ini assigned 64mb.

if visitor of plan01 very increased and site hanked ; i upgrade site to plan02 ;and if again visitor increase i upgrade that to plan03 and ... finaly plan04.

But i do not know php.ini and my.ini for plan02 to plan04 what amount must set!
memory limit php.ini plan02=128mb?
memory limit php.ini plan03=256mb?
memory limit php.ini plan04=512mb?
or same 64mb of plan01?
or other amount for example plan04 ram of plan=2048 and memory limit php 1024mb
or...
 
Last edited:
As @virtubox already explained, the PHP RAM limit limits the amount of RAM that a single script on a single run can reserve. You can freely decide if you want to grant your users more or less RAM. This is more a question of marketing than a question of actual use. A 64 MB RAM limit is enough for many applications. Some shop system might need more, e.g. 128 MB, and very rarely scripts need 256 MB RAM. The value is not a function of system RAM or CPU power. It is a function of marketing and product line up.
 
Back
Top