My Memcached server and Redis server are different from my web server, so that inside the PHP scripts I would have to make connections to these two external ip.
My concern is that, it would be better for my web server to keep its connections to the two memcached/redis servers. So that when new users request a php page, the web server does not need to connect to the memcached/redis again and again.
$redis = new Redis(); $redis -> close(); (or similarly with memcached and mysql)
I am unsure about what close actually means in this case. Does it mean close connection with the redis server for this particular php script execution? Given my previous concern, would calling close in fact hinder my performance?