简体   繁体   English

phpredis与Nginx + PHP-FPM持久连接

[英]phpredis persistent connect with nginx + PHP-FPM

I have classical server configuration schema with Nginx + PHP-FPM. 我有Nginx + PHP-FPM的经典服务器配置架构。 Most of pages on my site contain data that saved into redis. 我网站上的大多数页面都包含保存到Redis中的数据。 Thus it is too many indirect (through php-fpm) lite requests to redis from many independent users. 因此,有太多来自许多独立用户的间接(通过php-fpm)lite请求重做。 I use phpredis PHP extension to communicate with redis from PHP code. 我使用phpredis PHP扩展与来自PHP代码的Redis通信。 Can I use phpredis pconnect() method to decrease number of TCP connections between my backend servers and redis server? 我可以使用phpredis pconnect()方法减少后端服务器和Redis服务器之间的TCP连接数吗? Should I expect no mush up of different users data within shared connections? 我是否应该期望不会在共享连接中混入不同的用户数据?

PHP version is 5.3.x
phpredis version is 2.2.4

使用pconnect肯定会启用现有连接并帮助减少tcp连接数,从而提高性能

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM