About PHP ts and nts, how much do you know? This article introduces you to the content of the PHP ts and nts comparison, there is a certain reference value, there is a need for friends to refer to, I hope you have some help.
1. Introduction
ts (thread-safety): thread-safe, multi-threaded access, with the locking mechanism, when a thread accesses a data of this class, to protect, and other
Threads cannot be accessed until the thread has finished reading and other threads are available. No data inconsistencies or data contamination PHP in the ISAPI party
When loading, PHP chooses this version when it is loaded in ISAPI mode.
nts (none-thread safe): that is, non-thread-safe, is not providing data access protection, it is possible to have multiple threads to change the data caused by the resulting
Dirty data, PHP in the fast CGI mode when running the choice of this version, with better performance;
ISAPI (Internet server Application Programming Interface): usually refers to being loaded by the HTTP server, running as a module of the server, by the micro-
Soft proposed, it can only run on the win platform, for example, win Apache,iis[is said to work more stable with fast CGI], and Linux PHP
Run in the Apache module or PHP-FPM mode.
CGI (Common Gateway Interface): An HTTP server is a tool for "talking" to programs on your or other machines, and plainly, CGI is a
Background language, which can communicate with the server. At this point, PHP is running as a standalone program. It is a memory-consuming feature.
fast CGI: is a resident (long-live) type of CGI that can be executed all the time, so long as it is activated, it does not have to take a moment to fork each time. This way
is a language-independent, extensible architecture for CGI open extensions, whose main behavior is to keep the CGI interpreter process in memory and thus get a more
High performance.
The difference between CGI and fast CGI is the mother of the search.
2. Select
Usually win under PHP and Apache combination, run in ISAPI way, while Linux can be apche+php,php often as 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 is PHP-FPM completed, so nginx+php is now very popular, not measured!