I implemented memcache server listening on a TCP port. Later I found that UNIX domain sockets are faster than TCP sockets. While using TCP, my number of active connections were getting drastically high. Then I started using memcache with UNIX domain sockets and performance got improved.
Now I have to use multiple web servers and I am puzzled how to use memcache with UNIX domain sockets. One thing which I have to keep in mind that My web server has to use single memcache server.
Please suggest how can I incorporate memcache using UNIX domain sockets. Or if I use TCP then how can I improve performance. Any other optimization solutions are most welcome.
If by “My web server has to use single memcache server” you mean that your web server(s) must connect to a remote central memcache server then of course TCP is your only option since UNIX domain sockets are only local.
If your web server(s) are only making connections to a memcache server running on the local machine then UNIX domain sockets will work fine and you should use them if they are faster.