PHPSocialNetwork / phpfastcache

A high-performance backend cache system. It is intended for use in speeding up dynamic web applications by alleviating database load. Well implemented, it can drops the database load to almost nothing, yielding faster page load times for users, better resource utilization. It is simple yet powerful.
https://www.phpfastcache.com
MIT License
2.38k stars 451 forks source link

Redis With ElastiCache #743

Closed rohitcoder closed 4 years ago

rohitcoder commented 4 years ago

Configuration (optional)

My question I was trying to integrate Redis with ElastiCache, I am getting this error.

Fatal error: Uncaught Phpfastcache\Exceptions\PhpfastcacheDriverConnectException: Redis failed to connect with the following error message: "Operation timed out" line 99 in

More info

If i try to connect it phpfastcache local Redis server, it starts working without any error, however if i try this same using an AWS Elasticache Redis server, i get this kind of error.

I am trying to connect with remote Redis server using below config, I don't know maybe be i am connecting in wrong way? I just replaced some chars of my host to redact it, host name format is absolutely same like below config.

$InstanceCache = CacheManager::getInstance('redis', new Config([
  'host' => 'redis-random.asdad23.sa.001.aps1.cache.amazonaws.com',
  'port' => 6379
]));  

Please let me know, What kind of more informations you need to debug this?

github-actions[bot] commented 4 years ago

Hello curious contributor ! Since it seems to be your first contribution, make sure that you've been:

rohitcoder commented 4 years ago

Bots Everywhere 🧐

Team,

I've gone through your documentation, and previous closed issues, someone also faced this problem and it seems this feature is not available right now.

Geolim4 commented 4 years ago

Hello,

Are you sure that the host is available on the Web-server host ? Phpfastcache currently returns an error detected by the Redis connector (which I can't act on at all). Also did you tried to take a look at the Redis config available in Pfc ?

https://github.com/PHPSocialNetwork/phpfastcache/blob/master/lib/Phpfastcache/Drivers/Redis/Config.php

Cheers, Georges.

Geolim4 commented 4 years ago

Also please, reformat your issue using the default issue template, as I'm not a wizard and I can't guess the version you're using neither your OS/php version, thanks.

rohitcoder commented 4 years ago

Configuration (optional)

My question I was trying to integrate Redis with ElastiCache, I am getting this error.

Fatal error: Uncaught Phpfastcache\Exceptions\PhpfastcacheDriverConnectException: Redis failed to connect with the following error message: "Operation timed out" line 99 in

More info

If i try to connect it phpfastcache local Redis server, it starts working without any error, however if i try this same using an AWS Elasticache Redis server, i get this kind of error.

I am trying to connect with remote Redis server using below config, I don't know maybe be i am connecting in wrong way? I just replaced some chars of my host to redact it, host name format is absolutely same like below config.

$InstanceCache = CacheManager::getInstance('redis', new Config([
  'host' => 'redis-random.asdad23.sa.001.aps1.cache.amazonaws.com',
  'port' => 6379
]));  

Please let me know, What kind of more informations you need to debug this?

Geolim4 commented 4 years ago

Did you tried to connect to your Redis instance outside of Phpfastcache scope ? By using low-level library, just to make sure that Phpfastcache is not involved in your issue.

rohitcoder commented 4 years ago

Hi,

I figured it, actually i was trying to connect with Elasticache nodes outside of aws VPC, its not allowed! Redis was made for faster data access, and you can connect to redis from EC2 / same VPC.

Closing this thread, as resolved :)

Again many many thanks, for this awesome tool to speed boost our web-app performance.

Geolim4 commented 4 years ago

You're welcome ! Happy caching !