The difference between php version nts and ts

How much do you know about ts and nts of php

  1 Introduction

ts ( Thread-Safety ) means thread safety. When multi-threaded access is used, a locking mechanism is adopted. When a thread accesses a certain data of this class, it is protected , other

A thread cannot access it until the thread has finished reading, and other threads cannot use it. There will be no data inconsistency or data pollution php to ISAPI

Select this version when php is loaded in ISAPI mode . , select this version when php is loaded inISAPI mode.

      nts ( None-Thread Safe ) is not thread-safe, that is, it does not provide data access protection. It is possible that multiple threads change the data successively, resulting inChoose this version when dirty data p hp runs in fast cgi mode, which has better performance;

ISAPI ( Internet Server Application Programming Interface ), usually refers to being loaded by the http server, running in the form of a server module, by the microSoft proposal, so it can only be run on the win platform, such as apache, iis under win [it is said that the fast cgi method is more stable], and php on linuxIt runs as an  Apache module or php-fpm.

cgi ( Common Gateway Interface ): A tool for the HTTP server to "talk" with programs on your or other machines. To put it bluntly, cig is a kind ofThe background language, which can communicate with the server. At this point php is running as a standalone program. The characteristic is that it consumes memory.

fast cgi. is a resident (long-live) CGI, it can be executed all the time, as long as it is activated, it will not take time to fork every time. This wayis a language-agnostic, scalable architecture open extension to CGI whose main behavior is to keep the CGI interpreter process in memory and thus gain relativelyhigh performance.

Find the difference between cgi and fast cgi.

2. Choose

 Usually, php and apache are combined under win and run in the way of isapi, while under linux it can be apche+php, php is often used as a module of apache,When nginx+php is used, the phpfast cgi method, that is, the php-fpm method, runs.

   It is said that php-fpm releases the web server in this way, so that it only handles requests and concurrency, while php processing is completed by php-fpm, so nginx+php is very popular now, never tested!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324690789&siteId=291194637