Connection: http://www.oschina.net/question/29420_138135
See a blog post about Golang and PHP performance comparison, here to reply. The results of this test are clearly misleading.
1,php The Opcache is not turned on, read the disk file every time. and compile php for opcode. Performance naturally will be poor, open opcache try it.
2, Php+redis must be extended version of the Redis client, because the Redis extension is long-connected, you can avoid the network overhead of short connections.
3, php-fpm or Apache, even if only 20 processes are opened. The pure memory operation of Redis absolutely can return the result within 2ms (2ms is already very poor, generally 0.5ms can get a response). Then each process can provide at least 500QPS of processing power (2ms1 times, the PHP process is serially executed, 1 seconds can be 500 times). 20 processes can provide at least tens of thousands of QPS.
4, Redis/mysql if there are such operations, then the bottleneck of the program must be on the IO. Don't say Golang and PHP performance gap is not too big, even with the assembler rewrite and PHP will not be too big gap. There is no intensive calculation at all. Static language, dynamic language is only the language itself has performance differences, and Io Independent.
5, large concurrency and QPS are irrelevant. The concurrency in the test is also small, and the-C parameter for AB is 200. 200 is not high concurrency.
Reply: "Golang VS PHP Performance Comparison"