Author |
|
Materix
Joined: 30 Aug 2012 Posts: 42
|
Posted: Tue 23 Mar '21 21:53 Post subject: Memory vs CPU |
|
|
I have an Apache 2.4 with PHP on a Windows 2016-server, and there is a lot of traffic.
Therefore the CPU runs close to 100%, while only 4GB of 12GB is being used.
How can I move more of the load from the CPU over to the memory? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 23 Mar '21 23:46 Post subject: |
|
|
Well the CPU is doing the work. More RAM can't compensate that.
Do you use PHP as module or over fcgid? |
|
Back to top |
|
Materix
Joined: 30 Aug 2012 Posts: 42
|
Posted: Tue 23 Mar '21 23:47 Post subject: |
|
|
Thanks for the reply.
It runs as fcgid. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 23 Mar '21 23:52 Post subject: |
|
|
Then you can only have a second server and a load balancer OR more CPU cores.
Code: |
Apache Load Balancer <--------> Apache 1 with fcgid PHP
^
|
---------> Apache 2 with fcgid PHP
|
|
|
Back to top |
|
Materix
Joined: 30 Aug 2012 Posts: 42
|
Posted: Wed 24 Mar '21 0:22 Post subject: |
|
|
Thanks!
I will look into that. |
|
Back to top |
|
Jan-E
Joined: 09 Mar 2012 Posts: 1266 Location: Amsterdam, NL, EU
|
Posted: Thu 25 Mar '21 15:35 Post subject: |
|
|
Curious: which PHP version are you using? Is the OPCache module loaded? |
|
Back to top |
|
Materix
Joined: 30 Aug 2012 Posts: 42
|
Posted: Thu 25 Mar '21 15:54 Post subject: |
|
|
It is PHP 5.6.40 and no OPCache. Does OPCache help? |
|
Back to top |
|
Jan-E
Joined: 09 Mar 2012 Posts: 1266 Location: Amsterdam, NL, EU
|
Posted: Thu 25 Mar '21 16:16 Post subject: |
|
|
OPcache is tricky. I had it working for a Drupal 7 site for a long time with PHP 5.6 as mod_fcgid. In theory it should work.
Are you running the 64-bits or the 32-bits version of PHP 5.6.40?
Ever thought of upgrading to PHP 7 (7.4)? That version is quite mature now and faster than PHP 5.6. |
|
Back to top |
|
Materix
Joined: 30 Aug 2012 Posts: 42
|
Posted: Thu 25 Mar '21 20:10 Post subject: |
|
|
Thanks for the reply!
64-bit version of PHP.
It is a legacy application, so PHP 7/8 is not currently an option. |
|
Back to top |
|