3

We have a Symfony application deployed on a Swisscom provided Cloudfoundry Instance. Additionally we're using a Redis Service provided by Swisscom for caching.

It happened now two times that we're getting a timeout for the Redis Connection which causes our Application to fail:

Redis connection failed (connect() failed: Connection timed out): redis://password@domain.service.consul:47133

Some technical information:

  • symfony/symfony (v3.3.9)
  • predis/predis (v1.1.1)
  • cf version 6.32.0+0191c33d9.2017-09-26

config.ymllooks like that for Caching:

framework:
    cache:
        system: cache.adapter.apcu
        default_redis_provider: redis://%redis_password%@%redis_host%:%redis_port%
        pools:
            redis_pool:
                adapter: cache.adapter.redis
                public: true
                default_lifetime: 0
                provider: cache.default_redis_provider

and is used as a Service as defined here:

tag_aware_cache:
    class: Symfony\Component\Cache\Adapter\TagAwareAdapter
    arguments: [ '@redis_pool' ]

To my understanding we aren't using any persistent connection to Redis and it's usually working fine.

The only solution I found so far to get the application back in stable and running state is to re-deploy the whole application which isn't really a good solution.

Especially I don't understand what could be the root cause. How could I check this on my own and is Swisscom sure that Redis Service itself runs fully stable?

Sergio Tulentsev
  • 210,238
  • 40
  • 347
  • 343
LBA
  • 3,201
  • 1
  • 14
  • 42

1 Answers1

0

You can access the service directly when using 'cf ssh' to your app. The complete process on how to access your service using 'cf ssh' is described in Swisscoms documentation: https://docs.developer.swisscom.com/devguide/deploy-apps/ssh-apps.html

You're app should be able to handle connectivity issues by itself. Usually a simple retry keeps the app from crashing.

Lafunamor
  • 753
  • 3
  • 8
  • No, e.g. I cf ssh into my app and use a command to delete the cache (which should simply retry imho as you asked for) but nothing can be done until I re-stage the app. – LBA Oct 16 '17 at 14:19
  • Do you have a pipeline, that pushes the app and binds the service afterwards? Service bindings need a restage of the app to apply the new security groups. – Lafunamor Oct 16 '17 at 14:23
  • Binding happens with manifest before normal staging. And it's kind of strange as it only happens sometimes. What you're suggesting would occur every time, wouldn't it? – LBA Oct 16 '17 at 14:25
  • Yes it would. If the service is specified in the deployment manifest it should work fine. You should probably ping Swisscoms support and ask them to check your service instance. Maybe the service is crashing... – Lafunamor Oct 16 '17 at 14:27
  • what is the exact error message you get when trying to ping or curl your service? – Lafunamor Oct 17 '17 at 06:41
  • Will try and let you know next time when it happens. – LBA Oct 17 '17 at 07:38