mechanism, in the high concurrency of the site, often led to 502 errors, I guess the reason is php-fpm to the request from the NGINX queue did not deal well. However, I am currently using PHP 5.3.2, do not know if there is still this problem in the PHP 5.3.3.
Our solution now is to set this value as large as possible
") is a high-performance HTTP and reverse proxy server and an IMAP/POP3/SMTP proxy server.Install and configure Nginx/PHP-FPM on Fedora17/16/15/14, CentOS6.2/6.1/6/5.8 and Red Hat (RHEL) 6.2/6.1/6/5.8Let's get started.
Step 1 switch to the root user[Plain]Su-##Or ##Sudo-I
Step 2 install necessary software sources2-1. Install Remi source in Fedora 17/16/15/14[Plai
1. PrefaceThe previous article described how to compile and install MySQL, although it can be installed through Yum install or RPM, but the Yum install and RPM installation has one feature, that is, some parameters are customized according to the needs of the public, if you need to specify their own specific parameters, This is difficult to do, so a certain Linux based people are compiled installation or according to the company's specific environment to create a suitable environment for the ins
, there are also records in the error log file. As follows:
[19-dec-2016 15:55:37] WARNING: [Pool www] child 18575, script '/home/web/htdocs/sandbox_canglong/test/tt.php ' (Request: "get/test/tt.php") Executing too slow (1.006222 sec) Logging
[19-dec-2016 15:55:37] notice:child 18575 to stopped for tracing
[19-dec- 2016 15:55:37] Notice:about to trace 18575
[19-dec-2016 15:55:37] notice:finished trace of 18575
System log: Record system related information: http://blog.csdn.net/ty_hf/article/d
OverviewNginx ("Engine X") is a high-performance HTTP and reverse proxy server, also a IMAP/POP3/SMTP proxy server. Nginx has the advantage of being able to handle a large number of static page requests with low memory efficiency.You can refer to the following: three major web server comparison analysis (Apache, Lighttpd,nginx)PHP-FPM is a patch written for the
problem is always solved, since PHP-FPM does not have a CPU affinity (affinity) binding directive like Nginx, then we can use Taskset binding php-fpm process to fixed cpux to solve the problem:#!/bin/bashcpus=$ (grep-c processor/proc/cpuinfo)pids=$ (ps aux | grep "php-
Framework Official Guide Series 52--topic: Performance Tuning
Summary: The performance of a network application is affected by many factors. Database access, file system operations, network bandwidth, and so on are all potential factors. Yii has reduced the performance impact of the framework in all aspects. But in t
processed by a php-cgi process accumulates to 500.But why restart the process?Generally in the project, we will more or less use some PHP third-party libraries, these third-party libraries often have a memory leak problem, if you do not periodically restart the php-cgi process, it is bound to cause memory usage is increasing. So
violation of this principle does not comply with the minimum permission principle.
?
After reading nginx on the Internet ,? Articles and tutorials on php-fpm configuration and some books on the market have found many people misled by these articles and directly run the php-fpm sub-process with the account of the websi
. Compile php as an extension of Apache and load and activate Php_module when Apache starts. At this time, php-cgi resident within the httpd process. When a dynamic request arrives, the httpd no longer generates php-cgi, but forwards the dynamic request directly to its internal php-cgi. However, there is also a problem
especially important for improving security in a shared environment. FastCGI reduces the memory overhead of the Web server while ensuring performance.
Advantages:1. compatible with most Web servers2. smaller memory than mod_php3. more configuration items, including PHP and suexecDisadvantages1. complicated configuration2. not well known
PHP-
already have this image open source github[2], so if this happens to be a problem you often encounter, please feel free to check it.
Why is Nginx?
PHP-FPM with Nginx can produce better PHP application performance [3], but the downside is that the php-
This article mainly introduced about the PHP-FPM process number management, has a certain reference value, now share to everyone, the need for friends can refer to
PHP-FPM
Let's start by understanding some noun concepts:
CGIis the Common Gateway Interface(通用网管协议) protocol used to communicate with the interactive progr
, the first thing to say is the CGI (Common Gateway Interface) and FastCGI the two protocols.CGI is the protocol for Web server to interact with the background language, and with this protocol, developers can use any language to process requests from the Web server and dynamically generate content. But CGI has a fatal disadvantage, that is, every request to deal with a new process fork, with the rise of the Web, high concurrency is becoming the norm, so inefficient way obviously can not meet the
obviously unreasonable! So how did fastcgi do it? First, fastcgi initiates a master, parses the configuration file, initializes the execution environment, and then starts multiple workers. When the request comes in, master passes it to a worker, and then immediately accepts the next request. This avoids duplication of labor, and efficiency is naturally high. And when the worker is not enough, master can pre-boot several workers according to the configuration and so on, of course, the idle worke
PHP: CGI, FASTCGI, php-fpm, mod_php, mod_cgi, mod_fcgid can be confused when some common concepts are not noticed.
1. CGI is a Common Gateway Interface. the HTTP server uses this interface program to communicate with other applications (such as PHP interpreter programs). because CGI adopts the fork and execution
Here's a summary of some of the most frequently asked questions in recent hiresPhper when asked about your program performance? How much can the concurrency of the program achieve? Where is the bottleneck of the program? How many servers should be purchased to meet business requirements? How many units does the PHP application server need in load balancing?Perhaps these problems in the interview will be set
number of child processes created in pm.max_children:static mode or the maximum number of php-fpm that are allowed at the same time in dynamic mode.The maximum number of requests that the PM.MAX_REQUESTS:PHP-FPM process can handle.Pm.start_servers: The number of starting PHP-FPM
Reference website:Https://www.fujieace.com/php/php-fpm.htmlHttps://www.fujieace.com/php/pm-max_children-2.htmlHow big is the Pm.max_children?The php-fpm.conf has two key parameters:One is "max_children" and the other is "request_terminate_timeout".Pm.max_children represents the maximum number of child processes that
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.