Original article: OptimizingNGINXandPHP-fpmforhightrafficsites Translator: youngsterxyf has been using Nginx with PHP for seven years. This article shows us how to optimize NGINX and PHP-fpm configurations for high-traffic sites. The following are
Original: http://blog.csdn.net/pcyph/article/details/46513521--------------------------------------------------------------------------------------------------------------- -----ObjectiveThere are two ways of communication between Nginx and FastCGI,
Both Nginx and PHP-FPM have created a status page during installation to count the relevant state information for Nginx and PHP-FPM. Here's how to turn on the status statistics for Nginx and PHP-FPM, and describe the meanings of each parameter.(a)
Use unixsocket or TCP for communication between nginx and php-fpm and Its Configuration
Preface
Nginx and fastcgi can communicate in either TCP or unix socke. The two methods have their own advantages and disadvantages. Here we first provide two
Use Nginx official source, Epel extension library and remi source, remi source based on epel, must first install epel source, remi contains php-fpm, mysql-server5.5, if you only need php-fpm, you can install php-fpm separately and disable this
Preface nginx and fastcgi have two communication modes: TCP and unixsocke. The two methods have their own advantages and disadvantages. Here we first provide two configuration methods, and then summarize the performance and security. Configuration
TCP Sockets
Allows communication between processes through a network, or through loopback, to communicate between local processes. UNIX Sockets
Allows communication between processes that are running locally. Analysis
As you can see from the
A few days ago, I saw a blog post saying that the server where php is located frequently creates TCP short connections in the case of high concurrency, And the 2MSL time of the server where php is located is too long, resulting in no port available,
The choice of communication mechanismare Nginx and PHP-FPM using a TCP socket or a UNIX socket?Reasonable configuration of Nginx processing request number#cat /proc/cpuinfo | grep processor #查看服务器cpu的处理器数量# vi /etc/nginx/nginx.conf16;
1.2 Software Installation PathZabbix is installed under the/usr/local/zabbix path, and its related configuration files and binaries are placed in it.Nginx installed under/usr/local/nginx, its related configuration files and binary execution program
Guide
With 7 years of experience with Nginx and PHP, this experience has taught us how to optimize nginx and PHP-FPM configurations for high-traffic sites.
here are some tips and suggestions:1. Switch TCP to UNIX domain sockets1.
The experience of using Nginx with PHP for 7 years has taught us how to optimize nginx and PHP-FPM configurations for high-traffic sites.Here are some tips and suggestions:1. Switch TCP to UNIX domain socketsUNIX domain sockets provide better
In the Nginx configuration file, you can set how many nginx processes are enabled, as follows: worker_processes2; you can also set the maximum number of connections for each process, as shown below: worker_connections1024; php-fpm in the
This article mainly introduces Nginx and php-fpm start, restart, stop script sharing, the script contains start, stop, reload, restart and other common management methods, and can join the system service and then use SERVICEM command Management, A
Based on keepalived implementation, the Nginx and PHP-FPM services in two Realserver servers are mainly fromIdea: Using two VIP, a positioning nginx, a positioning php-fpmSteps:1 , prepare two sets based on Lnmp architected servers (capable of
the choice of communication mechanism
Nginx and PHP-FPM are using either a TCP socket or a UNIX socket. reasonable Configuration Nginx processing request number
#cat/proc/cpuinfo | grep processor #查看服务器cpu的处理器数量
#
After nginx and php-fpm are installed, a download box is displayed when the php page is opened in the firefox browser, instead of a direct page? The nginx and php-fpm services have been enabled. The nginx configuration file's php processing
Relationship between nginx and php-fpm, nginxphp-fpm
People can perceive it, but the server cannot perceive it. We call it forward to the proxy server.
There is a server load proxy server in the center of Baidu for reverse proxy access.
This is not
Nginx and PHP-FPM restart script on the server Nginx and PHP are source code compilation and installation, does not support class & #20284; the previous nginx (start | restart | stop | reload. Self-help clothes and food. The following scripts are
is Nginx and php-fpm running in multi-threaded mode?Nginx is a non-blocking IO & IO multiplexing model that can handle requests from multiple clients in a single line thread with similar epoll functionality provided by the operating system.Nginx
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.