We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Cache to different server

How can I separate caching to different servers, lets say I have 3 different VPS servers, one for database, one for caching and one for the program. How do we connect the caching from one server to the other? Lets say for file cache and redis cache. How do I start with it? whats the right approach? Im using the latest phalcon with PHP 7.



145.0k
Accepted
answer
edited Feb '17

For file cache - obviously not possible. For redis cache - just put correct ip. But if you are not connecting on LOCAL ip address like your vps servers are not in same lan network then this is really bad decision.



5.0k

Makes sense now, thanks for verifying the important points to consider

For file cache - obviously not possible. For redis cache - just put correct ip. But if you are not connecting on LOCAL ip address like your vps servers are not in same lan network then this is really bad decision.



43.9k

Hi,

if your vps provider use the openstack technology, it is able that he has the neutron environment implemented that gives you the ability to build virtual private LAN



5.0k

interesting, havent heard this before as I am new to this. do you think linode has this? because I am planning to host 3 vps within a same area. And probably just add more machine and a node balancer in the future as traffic grows.

Hi,

if your vps provider use the openstack technology, it is able that he has the neutron environment implemented that gives you the ability to build virtual private LAN



43.9k

Hi,

do you think linode has this?

had a quick look at linode offer, and I do not think so (neutron is an openstack software technology). But you can still use vpn: https://www.linode.com/docs/networking/vpn/

Note: you may also consider the impact it will have over performance. Caching data is used to speed up an application. Doing this over the network can be time consumming.



5.0k

If it can be time consuming, what do you think of this approach? Do i still need neutron here? https://www.digitalocean.com/company/blog/horizontally-scaling-php-applications/

Note: you may also consider the impact it will have over performance. Caching data is used to speed up an application. Doing this over the network can be time consumming.



43.9k

Hi,

that's another approach: load balancing. It is used to scale the infrastructure by adding server on demand (that mean, that you will have to use a monitoring tool wich can automaticaly deploy another droplet on demand and attach it to the cluster ... it's not trivial I think so; I've never tested that).

Looks like DO offer some kind of private networking https://www.digitalocean.com/community/tutorials/how-to-set-up-and-use-digitalocean-private-networking



5.0k

What if my droplets are in the same locations all NYC1. Do I still need to enable private networking? will it make a difference in speed or performance in horizontal scaling? Sorry bout the question really new to this.

Looks like DO offer some kind of private networking https://www.digitalocean.com/community/tutorials/how-to-set-up-and-use-digitalocean-private-networking

Yes, you still need it, connecting via public ip will cause slowdown.



5.0k

Thanks for clarifying. Great help from everyone

Yes, you still need it, connecting via public ip will cause slowdown.