Skip to main content

PHP-FPM Pool options " Best Values " for Managing CPU Usage in Shared Hosting Environment

Comments

12 comments

  • IGSteven
    Hello, Are you able to tell me what CPU you have? cat /proc/cpuinfo
    As your thread count can make a difference, Also do you know if you have Hyperthreading on?
    0
  • risecompany
    How to check Hyperthreading is on ? also need answers for the above questions, Thanks. processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 60 model name : Intel(R) Xeon(R) CPU E3-1231 v3 @ 3.40GHz stepping : 3 microcode : 0x28 cpu MHz : 3333.593 cache size : 8192 KB physical id : 0 siblings : 8 core id : 0 cpu cores : 4 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb invpcid_single ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear spec_ctrl intel_stibp flush_l1d bogomips : 6799.61 clflush size : 64 cache_alignment : 64 address sizes : 39 bits physical, 48 bits virtual power management: processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 60 model name : Intel(R) Xeon(R) CPU E3-1231 v3 @ 3.40GHz stepping : 3 microcode : 0x28 cpu MHz : 3334.216 cache size : 8192 KB physical id : 0 siblings : 8 core id : 1 cpu cores : 4 apicid : 2 initial apicid : 2 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb invpcid_single ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear spec_ctrl intel_stibp flush_l1d bogomips : 6799.61 clflush size : 64 cache_alignment : 64 address sizes : 39 bits physical, 48 bits virtual power management: processor : 2 vendor_id : GenuineIntel cpu family : 6 model : 60 model name : Intel(R) Xeon(R) CPU E3-1231 v3 @ 3.40GHz stepping : 3 microcode : 0x28 cpu MHz : 3377.587 cache size : 8192 KB physical id : 0 siblings : 8 core id : 2 cpu cores : 4 apicid : 4 initial apicid : 4 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb invpcid_single ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear spec_ctrl intel_stibp flush_l1d bogomips : 6799.61 clflush size : 64 cache_alignment : 64 address sizes : 39 bits physical, 48 bits virtual power management: processor : 3 vendor_id : GenuineIntel cpu family : 6 model : 60 model name : Intel(R) Xeon(R) CPU E3-1231 v3 @ 3.40GHz stepping : 3 microcode : 0x28 cpu MHz : 3604.406 cache size : 8192 KB physical id : 0 siblings : 8 core id : 3 cpu cores : 4 apicid : 6 initial apicid : 6 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb invpcid_single ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear spec_ctrl intel_stibp flush_l1d bogomips : 6799.61 clflush size : 64 cache_alignment : 64 address sizes : 39 bits physical, 48 bits virtual power management: processor : 4 vendor_id : GenuineIntel cpu family : 6 model : 60 model name : Intel(R) Xeon(R) CPU E3-1231 v3 @ 3.40GHz stepping : 3 microcode : 0x28 cpu MHz : 3400.622 cache size : 8192 KB physical id : 0 siblings : 8 core id : 0 cpu cores : 4 apicid : 1 initial apicid : 1 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb invpcid_single ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear spec_ctrl intel_stibp flush_l1d bogomips : 6799.61 clflush size : 64 cache_alignment : 64 address sizes : 39 bits physical, 48 bits virtual power management: processor : 5 vendor_id : GenuineIntel cpu family : 6 model : 60 model name : Intel(R) Xeon(R) CPU E3-1231 v3 @ 3.40GHz stepping : 3 microcode : 0x28 cpu MHz : 3395.642 cache size : 8192 KB physical id : 0 siblings : 8 core id : 1 cpu cores : 4 apicid : 3 initial apicid : 3 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb invpcid_single ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear spec_ctrl intel_stibp flush_l1d bogomips : 6799.61 clflush size : 64 cache_alignment : 64 address sizes : 39 bits physical, 48 bits virtual power management: processor : 6 vendor_id : GenuineIntel cpu family : 6 model : 60 model name : Intel(R) Xeon(R) CPU E3-1231 v3 @ 3.40GHz stepping : 3 microcode : 0x28 cpu MHz : 3400.415 cache size : 8192 KB physical id : 0 siblings : 8 core id : 2 cpu cores : 4 apicid : 5 initial apicid : 5 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb invpcid_single ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear spec_ctrl intel_stibp flush_l1d bogomips : 6799.61 clflush size : 64 cache_alignment : 64 address sizes : 39 bits physical, 48 bits virtual power management: processor : 7 vendor_id : GenuineIntel cpu family : 6 model : 60 model name : Intel(R) Xeon(R) CPU E3-1231 v3 @ 3.40GHz stepping : 3 microcode : 0x28 cpu MHz : 3224.023 cache size : 8192 KB physical id : 0 siblings : 8 core id : 3 cpu cores : 4 apicid : 7 initial apicid : 7 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb invpcid_single ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear spec_ctrl intel_stibp flush_l1d bogomips : 6799.61 clflush size : 64 cache_alignment : 64 address sizes : 39 bits physical, 48 bits virtual power management:
    0
  • cPRex Jurassic Moderator
    In my experience, it's unlikely that any of the values you mention would decrease the CPU usage, unless you lowered them to the point you start limiting traffic. To decrease CPU, you want to raise the RAM usage, which means getting more things stored in cache. It's much quicker for the system to use cached data than to read new values each time, so I would look toward caching if you wanted to free up CPU resources.
    0
  • risecompany
    In my experience, it's unlikely that any of the values you mention would decrease the CPU usage, unless you lowered them to the point you start limiting traffic. To decrease CPU, you want to raise the RAM usage, which means getting more things stored in cache. It's much quicker for the system to use cached data than to read new values each time, so I would look toward caching if you wanted to free up CPU resources.

    How could we raise the RAM usage? Actually we selected some clients that we know them that they are using old scripts, also selected clients that their purpose from hosting is emails only and have sites consuming cpu, also we have some clients with poor scripts always been in Process Manager with much cpu using without need! We changed their Pools Values to : Max Requests : 1 / Max Children: 1/- Process Idle Timeout: 1 + We Closed the Log errors / Error Reporting that was adding every second line inside error log file, Cause of old scripts are not compatible with php 7+, The log file size increased to huge numbers, We Found a client with 50 GB error log was using vbulletin v4 that are not compatible with 7.4 thus all the error log file was about php issues with that script. Another client also was sending many requests to phone app we changed Max Requests to 10 instead of 20 that was very good also to the load on cpu. Finally We Solved our issue and cpu decreased about the half with out any issue and cpu stable again, No Huge increase now on cpu as the load are playing around 0.3 ~ 2 ~ 4 before was 2 ~ 4 ~ 8. The server is fine and no issue reported to us until now but we need to know more about php pool with best practice values.
    0
  • cPRex Jurassic Moderator
    We have some additional details about fine tuning the pool settings here, so I would recommend checking out that page for more details specifically related to that:
    0
  • jndawson
    We have some additional details about fine tuning the pool settings here, so I would recommend checking out that page for more details specifically related to that: Should we shut off php-fpm?
    0
  • cPRex Jurassic Moderator
    @jndawson - it's completely a personal preference so it's up to you. We've found that some users get better "out of the box" performance with lsapi than with PHP-FPM as there is less tuning involved. Give it a chance and see if you notice any differences on your machine - that's really the only way to know for certain if you'll experience a noticeable improvement.
    0
  • jndawson
    @jndawson - it's completely a personal preference so it's up to you. We've found that some users get better "out of the box" performance with lsapi than with PHP-FPM as there is less tuning involved. Give it a chance and see if you notice any differences on your machine - that's really the only way to know for certain if you'll experience a noticeable improvement.

    We have php-fpm AND lsapi BOTH running on our accounts on our CL boxes. So, use one or the other? What about customers using WordPress Tool Kit? Will that break if we turn off php-fpm on each account?
    0
  • cPRex Jurassic Moderator
    No, I would expect that to work fine. WordPress Toolkit requires PHP-FPM for the cPanel daemon to be running, but not for the webserver on the machine. Details on that can be found here:
    0
  • jndawson
    No, I would expect that to work fine. WordPress Toolkit requires PHP-FPM for the cPanel daemon to be running, but not for the webserver on the machine. Details on that can be found here:
    0
  • cPRex Jurassic Moderator
    Sure thing!
    0
  • jndawson
    Update: (I thought I had updated this but had not.) Essentially, according to CloudLinux, if you use lsapi, then don't use php-fpm as they do basically the same thing and may conflict in certain situations.
    0

Please sign in to leave a comment.