News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

server php-fpm advice?

Started by drewactual, September 01, 2018, 12:57:24 AM

Previous topic - Next topic

drewactual

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. 

drewactual

..... 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. 

drewactual

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!

drewactual

i'm averaging around 100k page views a week, and have had around 70k posts since September... I've restarted the server only twice, and only for updates.  there are only 3 regens on a run of over a month now, and the cache-on-disk is only a touch over 2%.. OPCache is 100% and without flaw so far.

i've encountered something strange i will wait until the end of the season to investigate (don't fix it if it isn't broke, right?) which is workers dynamically increasing and decreasing as required by load.  i don't recall setting that up and i'm the only one who has accessed the server since September.  it rested at 100 workers and will run 5~10 or so, but when it's bumped to 15~20, all of the sudden there will be 150 workers available... i don't understand enough of how this works to know if this is a problem, but it seems to me staging workers is a drag on resources that may be unwarranted.  like i said, i'm learning, but the above settings seem to be working under moderate load.  well, the server has an absolute peak of 40% on this build for a few seconds at one point, but it's not like it was in any danger. 

Advertisement: