• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question "Nginx only" FPM handler settings?

Dukemaster

Regular Pleskian
Hi at all,
I'm sorry to ask this basics. But since the last few days I use "nginx only", static files also [isn't the option static files by nginx obsolet by the site related option: Nginx without Apache?) together with FPM71 served by nginx.

I feel that the great promised better performance and faster site-speed by using Nginx is not reality in my case. I feel that my sites are loading slower.
So, I again had sleepless nights by reading uncountable documentations from different sources, mostly PLESK.
Yesterday I had errors/warnings with server reached max_children setting (5) and Bad file descriptor (9)
these great tutorials 1 + 2 by PLESK solved the problems perfectly!!!


Mostly I want to ask You the simple questions where to set correctly the (FPM) FastCGI settings and which values (if possible globally, or for each domain?
Is "where" perhaps "additional nginx settings"?

Example from internet:

Code:
fastcgi_buffers 8 128k;
fastcgi_buffer_size 256k;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
proxy_buffer_size 128k;
proxy_buffers 8 256k;
proxy_busy_buffers_size 256k;

Problem: Seems(?) that there are settings only for Plesk and others for webhosting, but I'm not sure.
I want to describe the problems by a great articles by Alexandre Tumanov (I read so much good articles by him and other support members who do a great job)
One, two, three, The first I can't find anymore, there he described two possibilies for the same two options.
Sorry, I'm totally confused about FPM/FastCGI settings. I only want a standard configuration which is for 2000 - 5000 concurrent connections (visitors) on maximum 50 domains.

Help would be great in this case.

Greets
 
@Dukemaster

The articles by A. Tumanov are related to Plesk Panel, which has it's own Nginx instance (so to speak).

Actually, you need to tweak the settings of the Nginx instance that serves your domains, which is something completely else.

There is a golden rule when using Nginx: use Nginx as a forward proxy.

That is, use a Nginx + Apache stack, in order to use Nginx a powerful tool and/or to have some additional layer for

- distribution of workload between Apache and Nginx, (and)
- additional security: stop bad traffic at the Nginx level,

and these are the most important advantages.

There is another golden rule when using Nginx (stand-alone) or Nginx + Apache: keep it simple.

In essence, Nginx can already handle more than 10K simultaneous connections per second when using the default configuration.

Sure, the default Nginx configuration as shipped with Plesk requires some minor tweaks, since this default configuration is not optimal, but you can do without the tweaks.

Actually, you can tweak Nginx configuration per domain........ and as such, it is only required to tweak configuration if you have one specific domain requiring tweaking.

I would strongly recommend to keep the defaulf configuration.

However, with respect to the server reached max_children setting (5) and Bad file descriptor (9) issues, I can advise the following:

- check the logs to identify the domain on which the issues are occuring,
- determine whether you have a VPS or a dedicated server (this is the easy part),
- check the system settings to make sure that the Bad file descriptor (9) issues are not caused by OS related configuration,
- when using the Nginx + Apache stack, check the MPM mode under "Tools & Settings > Apache Web Server" and try the Prefork MPM mode (which often works better with the default FPM settings as shipped with Plesk, due to the fact that the Event MPM mode will cause FPM related issues when working with badly coded applications),
- tweak some Nginx config only when required

I am pretty sure that the Nginx + Apache stack with Prefork MPM mode will benefit you, but I am also very sure that you need to go hunting for bad code.

Hope the above helps a bit,

Regards..............
 
Firstly, thanks a lot for your detailed explanation. It was a lil crazy. It started with exactly the ...file descriptor error. So I made the tutorial and increased it manually to 40. I was full aware that I did it only for Plesk, the path indicates excatly where you configure something. Since last weekend the error was gone.
Later I saw the second link with the possibility doing something good for all websites, mostly forums but with 3-6 MB images in galleries with thousands of images. It ran the script, but didn't want to over-configure the system with values of visisitors I actually not have. So I took also the same value (40) for the websites.
But this night I read it again and thought about increasing this value, but I don't know why she takes the value 61444MB for 8 GB RAM. getting the average (other value is logic for me) I have 16 GB Ram in my counting it is 16000MB, 8 GB is 8000 MB, not around 61.000. Think I misunderstood something.

I think you are right with standard values. Plesk has so much improved. Over years there was only need to make some mysql tuning and a lil PHP tuning, nothing more. My server dies by being in sleep-like-modus one team member of Woltlab said to me.
But, sorry for my words, my bad problem is the whole community, also normal php sites loading so long. I use ONLY nginx, it was the chance to make it fast, but there must be a simple but with great consequences misconfiguration somewhere. My MPM has switched the last few weeks from prefork to Event or the other way by alone. Problem is, I realizes this problem hours or a day later, so I can't get the reason which change did it.

Okay. I throw everything with FPM out, believe it or not, I had the same inspiration last night, but I didn't want to see my wasted time....
Greets
 
I am pretty sure that the Nginx + Apache stack with Prefork MPM mode will benefit you, but I am also very sure that you need to go hunting for bad code.
I never ever was hunting for bad code and I never will do so.
Now I used to go new ways. Using Nginx alone and I must say last week for the first time between changing FPM several settings, openssl update, pagespeed, brotli, and wondering about automated MPM-switches between Event and Prefork I saw how fast PLESK and my websites could be. After completing my work I was never be able to find out what the trick really was.
Believe it or not, this spring my really experienced and professional server admin recommended that I could use my dedicated server just without Nginx, only running Apache without Nginx because it would be the best decision for performance. We did so and it was incredible how fast Plesk panel, websites, nearly everything was running. So, there are many ways to go to Rome.
A good support by articles leaded me to go the right way, also here PLESK has growing in an incredible way.
But, by recommending the default Plesk configuration it's not my way. Then you feel like in a sandbox surrounded by glass.
Around these different ways Apache only, Nginx only, Apache with Nginx as reverse proxy "Tags" and "Labels" would be an act of freedom for customers and users. "Nginx only" related, "Apache & Nginx" related, Nginx in both ways (!) related, perhaps "Apache" only and also Tags for OS-related and Plesk-configuration in general related.
I must say, in the moment you risk contraproductive issues and you have to read thousands but great (!) support articles, pulling out and decide if it fits to the complete environment or not.
NGINX as standalone - there is only less documenation for the moment. But it's logical because the possibility is only usable since a few years and PLESK improves by hard work of the support team and people like you, @UFHH01 and many others for better usage and also understanding PLESK itself.

Best wishes and kindest regards
 
Last edited:
Back
Top