How much do you know about TS and nts in PHP?
1. Introduction
TS (thread-safety) is thread-safe, multithreading access, the use of the lock mechanism, when a thread access to a class of data, to protect, other
Threads cannot be accessed until the thread is read, and other threads are not available. No data inconsistencies or data contamination PHP with ISAPI
This version is selected when PHP is loaded as an ISAPI.
NTS (None-thread safe) is not thread-safe, that is, does not provide data access protection, there is a possibility that multiple threads have changed data resulting in dirty data php to run in fast CGI when the choice of this version, with better performance;
ISAPI (Internet server Application Programming Interface), which is typically loaded by an HTTP server and run as a server module, is proposed by Microsoft and can only be run on the win platform. For example, the apache,iis[in win is said to work more stably with fast CGI, while PHP on Linux runs in Apache modules or PHP-FPM.
CGI (Common Gateway Interface): A tool used by HTTP servers to "talk" to programs on your or other machines, and, frankly, CIG is a background language that can communicate with servers. PHP is running as a standalone program at this time. The feature is memory consumption.
Fast CGI. is a resident (long-live) type of CGI, it can always execute, as long as the activation, it will not take time to fork every time. This approach is a language-independent, scalable, CGI-open extension, The main behavior is to keep the CGI interpreter process in memory and thus achieve higher performance.
The difference between CGI and fast CGI to find the Niang.
2. Select
Usually win under the PHP and Apache combination, in the way of ISAPI, while Linux can be apche+php,php often as the Apache module, while nginx+php, Phpfast CGI way, that is, PHP-FPM way to run.
It is said that php-fpm this way to release the Web server, so that it only processing requests and concurrency, and PHP processing PHP-FPM completed, so nginx+php is now very popular, has not been measured.