Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shared cache between workers #35

Open
skekec1 opened this issue Apr 6, 2021 · 4 comments
Open

Shared cache between workers #35

skekec1 opened this issue Apr 6, 2021 · 4 comments

Comments

@skekec1
Copy link

skekec1 commented Apr 6, 2021

Hi everyone,

i have a question about Roadrunner and symfony and its behaviour regarding caching:

We are currently using symfony with two caching adapters in this order: array,redis

We noticed that this causes some problems and we get out-dated values from the cache. Are we right with our assumption that this is caused by none shared caches on the array level, so that all workers accessing their own representation and values?

If this is the case:

  • Can APCu solve this problem?
  • Are there other ways to solve this problem? What are you doing to solve this?

Thanks in advance!

Selcuk

@Baldinof
Copy link
Owner

Baldinof commented Apr 6, 2021

Hi! Thanks for using this bundle :)

I am not aware of a way to share memory between php cli scripts.

If you can afford some out dated data, I would recommend to simply reduce the expiration time of your items.

Otherwise you will be required to rely only on redis.

Maybe it's possible to setup something to keep data in array but invalidate via tags stored in redis, with https://symfony.com/doc/current/components/cache/cache_invalidation.html#tag-aware-adapters

[Edit]

It seems that something is already there on the RoadRunner side: https://github.com/spiral/roadrunner/tree/master/plugins/kv

I have no time to work on this for now, but I would be happy to merge a PR :)

@wolfy-j
Copy link

wolfy-j commented Jul 8, 2021

Hey, RR has new KV plug-in and SDK for it. You can use it for caching. :)

@Baldinof
Copy link
Owner

Baldinof commented Jul 8, 2021

Yeah, I will find time to integrate it with Symfony :)

@StanJansen
Copy link
Contributor

@Baldinof I see that this hasn't been done yet, I created a PR for this: #137

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants