Advertisement:

Author Topic: server php-fpm advice?  (Read 509 times)

Offline drewactual

  • Jr. Member
  • **
  • Posts: 305
    • College Football Fan Site CFB51
server php-fpm advice?
« on: September 01, 2018, 12:57:24 AM »
man, this dedicated server journey has been a long one..

I opted for ea4 MPM Worker, php7.0(only build on server), w/FastCGI and FPM

I seek advice on setting up the pools.

the server:
16 2.1ghz processors
32 GB RAM
1TB SSD 

it is dedicated to one site. 
the FPM is set up dynamic, and I'm considering going to static..

set to dynamic
max_children is set to: 160
with a timeout of 10 seconds
and max_requests set to 500 though i'm not sure this matters unless it's using ondemand?

i have php set to memory limit per script of 128m... memcahce is set to 512M, and OPCache to 128m w/7900'ish keys

so...

128m=.125 a GB... 160 active children from the pool = 20GB of total allowed RAM for the FPM...
32GB, allowing 2GB for system and then reserving another 10GB for cache's (OPCache) and sessions (memcache(d)), leaves the 20GB set for the FPM alone. 

I've never seen more than 60 concurrent users(within 60 seconds), and i've never seen (since setting up OPCache) the load over 10% (it's usually 7~15 concurrent users at any given time and load of less than half a percentage with total memory consumed of 7~8.5%)...

I have workers set to 1092....

that's about all the details I can conjure...

so.....

are my settings in the neighborhood? 
I keep reading conflicting information and don't have the luxury this time of year of 'playing with it'.  I don't think setting FPM to ondemand has any benefit for my application as the lag to spawn on costs me almost a full 500ms, and the memory is there so why not use it?  but honestly, I am just repeating what I've read... I really don't know...

I guess the biggest question here is "how clean is SMF php/scripts?"... are there any really expensive scripts to avoid with memory set to 128M?  take a look at my page if you will- I have stripped many of the inherit functions off- search is still available, but it takes a smart user to use it- there is no link...

thoughts?

than you hugely in advance. 
« Last Edit: September 01, 2018, 01:42:58 AM by drewactual »
https://www.cfb51.com is a College Football Fan Site, Store, and Publisher, launched in July of 2017

Offline drewactual

  • Jr. Member
  • **
  • Posts: 305
    • College Football Fan Site CFB51
Re: server php-fpm advice?
« Reply #1 on: September 01, 2018, 11:16:08 AM »
..... and- i asked this here instead of some server admin specific page because folks here are smart, and smart specifically about the demands of SMF.  I also run a WP on the site, but it is only accessed by a few and most the articles are fed via plugins. 
https://www.cfb51.com is a College Football Fan Site, Store, and Publisher, launched in July of 2017

Offline drewactual

  • Jr. Member
  • **
  • Posts: 305
    • College Football Fan Site CFB51
Re: server php-fpm advice?
« Reply #2 on: September 05, 2018, 11:17:32 AM »
so a little update here, and follow up if anyone runs into questions setting up their own server that may benefit from this experience-

a little over 3k posts later, the site is working well as configured above. 

apache has ran for four days straight without interruption, and i've not seen more than 25 workers occupied at the same time.  I DID reduce the TTL to ten seconds and reduced the memory to 128m.  OPCache is @ 100% with over 900 keys and a little over 45m of 128m available to it, and with zero wasted memory.  the swap is at a little over 1%, which means basically the cache held in RAM being moved to HDD is at a minimum. 

i've yet to see the server load break even 1.0 at any interval (there are 16 processors, so a 100% load would be 16.0) and is usually in the .10 to .40 range.  There is zero back-up. 

I've decided to NOT load mod_pagespeed on this server... the css and javascript is already minified and unless the css or js in inline, it is already optimized.. the script runs clean as observed in either SMF or server error logs.  the site isn't image heavy, and that is the only thing i'd gain by running mod_pagespeed... but... I'm still curious about it.  It worked VERY well on the old server. 

the only thing i've yet to figure out is why SSI won't work... everything is there for it to do so... crazy...

anyway, hope this helps someone along the way!
https://www.cfb51.com is a College Football Fan Site, Store, and Publisher, launched in July of 2017