idk what I have done to my Friendica but it shows a 502 Bad Gateway nginx error quite often....I added a few RSS sources from Reddit and that seemed to have messed it up but I don't understand what. I removed them since...
The nginx error logs show stuff like 2021/08/02 07:05:57 [error] 2732#2732: *1092 upstream timed out (110: Connection timed out) while reading response header from upstream, client: ******, server: social.trom.tf, request: "GET /ping?format=json&uid=22&_=1627677955767 HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.3-fpm-friendica.sock", host: "social.trom.tf", referrer: "https://social.trom.tf/network"
Didn't sleep trying to figure it out so am tired sorry for the messy message.
Basically now loads fine for a few minutes, then loads very slow to the point of nginx giving up as explained above. If any of you has any idea what I should try let me know. Gonna have some sleep now, not good to work on such things when you are zombie tired, you may mess things up more.
Thanks!
Friendica Admins reshared this.
Tobias
in reply to Tio • • •Not using nginx myself, the StackOverflow answer seems to be to increase the proxy wait time. Question is why Friendica needs more time to answer.
Is there any hint in the PHP logs or the logs from Friendica?
Tio
in reply to Tobias • •@Tobias Yes if I add
fastcgi_read_timeout 300; proxy_read_timeout 300;to the nginx.conf seems to work, but it takes a while to load...Tio
Unknown parent • •Michael πΊπ¦
in reply to Tio • • •php-fpmprocesses. Possibly you are running out of them.Tio
in reply to Michael πΊπ¦ • •Tio
Unknown parent • •pm.max_children = 5andpm.start_servers = 2if that's what you are asking. I increased these two now to see if it helps. And yes if I restart the php service it is temporary fixed for a few minutes. So maybe that's the issue?Tio
Unknown parent • •pm.max_children =?Michael πΊπ¦
in reply to Tio • • •max_childrenof 5 looks really much too few. You should have a logfile for this where the system should complain about too few children.Tio
in reply to Michael πΊπ¦ • •Tio
in reply to Michael πΊπ¦ • •Tio
Unknown parent • •Michael πΊπ¦
in reply to Tio • • •Tio likes this.
Tobias
in reply to Michael πΊπ¦ • • •Tio likes this.
Tio
in reply to Tio • •pm.max_children = 500 pm.max_requests = 1000everything seems to run smoothly. So far so good. Thanks a lot people! You are always so friendly and helpful.muppeth
in reply to Tio • • •Personally I am not really fan of setting max_children to cosmic values. Increasing the number is IMO dead end. The moment you have all children processes busy your load average will be too high and its the cpu that will become your bottleneck, and once you reach that there will be no extra value to kick up. Surely distro defaults are low, but setting to
500seems also crazy high.@Tio check gist.github.com/holmberd/44fa5β¦
I noticed that for things like social networks where amount of users online is one thing but the fact there is always content being pulled in and sent out so your instance is busy constantly even without anyone online, setting
pmtostaticis better approach.Adjusting child processes for PHP-FPM (Nginx)
GistTio likes this.
Tio
in reply to muppeth • •muppeth
in reply to Tio • • •Tio
in reply to muppeth • •pm.max_children = 500if our resources seem to be really ok, is that a bad thing? Now our Friendica works really well and it barely uses our CPU or RAM.Tio
Unknown parent • •