Note: PHP maximum execution time, Pragma and post-check in PHP-FPM Mode

Source: Internet
Author: User
Tags stomp
20135 record 1: PHPPHP: Stomp? (Zheng yu Note 1, this time-out setting is unacceptable in the production environment. Generally 2 ~ 3 seconds timeout .) PHP: Stomp? Before an exception is thrown, the default number of attempts to connect to different hosts is 10.

2013/5 record 1: PHP: Stomp? Connection timeout = the default value is 60 seconds. Generally 2 ~ 3 seconds timeout .) PHP: Stomp? Before an exception is thrown, the number of attempts to connect to different hosts = the default value is 10. (Zheng Note 2, randomize = fals

2013/5

Record 1:

  • PHP
    • PHP: Stomp? Of (each) connection timeout = default value60 seconds(Zheng yu Note 1, this timeout setting is unacceptable in the production environment. Generally 2 ~ 3 seconds timeout .)
    • PHP: Stomp? Number of attempts to connect to different hosts = default value10 times(Zheng Note 2, randomize = false, a host will be replaced every cycle)
    • Maximum execution time of PHP scripts =? :
      • In PHP-FPM mode, the max_execution_time parameter does not have much effect, it controls the CPU usage time of the process,The default value is 30 seconds.;
        • Note: The set_time_limit () function and the configuration command max_execution_time only affect the execution time of the script. Anything happens in such as use? The maximum execution time of system calls, stream operations, database operations, and other scripts of system () is not included when the script has been run.
      • The real starting point is the role of php-fpm.conf? 0 s What does it mean? The? Timeout? (In? Seconds )? For? Serving? A? Single? Request? After? Which? The? Worker? Process? Will? Be? Terminated;The default value is 0, that is, off.;
      • Since? Request_terminate_timeout? = 0 &?? Max_execution_time? = 30 s, then by defaultIt is hard to tell exactly how many seconds the PHP script takes before it is terminated by the php fpm..
  • Mysql
    • Innodb_lock_wait_timeout: the timeout time for a InnoDB Transaction to encounter a row lock,The default value is 50 seconds.The "Lock wait timeout exceeded; try restarting transaction" error will be printed.
  • Nginx
    • Fastcgi_connect_timeout: the connection timeout time of the same FastCGI server. Default Value:60 seconds. It cannot exceed 75 seconds.; Set Online300 seconds = 5 minutes;
      • Note: Nginx 504 Gateway Time-out: the requested Gateway does not have a request, that is, no request to a PHP-CGI that can be executed. This may mean that the PHP process has reached the maximum number of processes and is being executed (or blocked). Therefore, the new request cannot be processed, and the new request will receive a 504 error after waiting for the second of fastcgi_connect_timeout.
    • Fastcgi_send_timeout :? Nginx process? FastCGI? Request sent by a process. The timeout value of the entire process. The default value is 60 seconds. The value is set to 300 seconds online;
    • Fastcgi_read_timeout :?? FastCGI ?? Process direction ?? Nginx ?? The timeout time of the entire process. The default value is 60 seconds. The online time is set to 300 seconds.

Record 2:

Pragma is just a Request header field command. If you put Pragma: no-cache in the Response header field, it doesn't make sense.. Refer to 1 and 2.

The HTTP/1.1 cache should regard "Pragma: no_cache" as if the client sent "cache_control: no-cache". No new pragma commands will be defined in http.

Record 3:

Do I really need the post-check and pre-check control commands?

It is often seen that there are "Cache-control: post-check = 0, pre-check = 0" control commands in the response header.

In fact, both post-check and pre-check are extension commands introduced by Microsoft from IE5. These two commands are not defined in Header Field Definitions in HTTP 1.1 Section 14th.

Therefore, if you just get used to writing post-check = 0 and pre-check = 0, you can stop this writing method. Use the HTTP 1.1 Standard Cache-control command.

?

-Over-

Several images are presented:

A picture shows a good technical architecture and a poor technical architecture.

?

?

Link to this article

Note: PHP-FPM mode PHP maximum execution time, Pragma and post-check, thanks to the original author to share.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.