PHP高性能http服务框架 or Golang or java
如何解决高并发的问题,一直以来高性能和生产力似乎总是相对立的。
一直以来PHP的性能总是被人诟病,以我过去的经验来讲PHP的开发应用的速度应该是java或者其他编译语言的2倍或则3倍。但是高并发似乎并不是其强项。
每次面试都会遇到如何解决高并发,大流量的问题,我就在想那你干毛用PHP去解决呢。java或者go不香吗?
那么PHP有没有解决高并发的方案呢?
答案肯定是有的。
有很多PHP C 扩展框架,例如yaf或者phalcon。 这些框架的确提升了PHP的并发或者性能问题,但同时确牺牲了生产力方面的问题。有人或者说yaf或者phaclcon没有生产力方面的问题,的确仁者见仁,智者见智。但是比起laravel真是差的不是一丁点,laravel的性能让人诟病。
还有PHP协程框架,例如swoole或者workerman。这的确是非常好的高性能PHP解决方案,这两个框架压力测试下的性能的确比golang 或者spring web 更快,但是我觉得那为什么不用golang或者java去解决这样的问题呢,何况这玩意只能CLI下面运行,而且性能差不了太多。
更重要的是java或者golang 我个人认为要比swoole或者workerman是更加成熟的解决方案。
当然PHP适合快速开Web应用,对于业务快速迭代的场景是有优势的。
随着业务不断的发展可以考虑硬件方面的扩展,个人认为可以解决业务规模初期或者中期的企业。业务不断壮大后个人认为采用Goalng或者Java会是更好的解决方案。
48 条评论
sikis izle · 2020年11月12日 下午11:21
If you want to use the photo it would also be good to check with the artist beforehand in case it is subject to copyright. Best wishes. Aaren Reggis Sela
porno · 2020年11月13日 上午4:42
Very good post! We will be linking to this particularly great article on our website. Keep up the great writing. Amberly Tripp Erikson
erotik izle · 2020年11月13日 下午11:25
Here is a superb Blog You might Come across Intriguing that we encourage you to visit. Fredericka Gael Wilkey
sikis izle · 2020年11月14日 下午9:14
A big thank you for publishing such a valuable article on this topic. I hope to find here much more from you, in the coming weeks. Ivory Hubert Shreeves
erotik · 2020年11月15日 上午6:08
Good article! We are linking to this particularly great content on our website. Keep up the great writing. Philippine Cullie Amaryl