frankenwp icon indicating copy to clipboard operation
frankenwp copied to clipboard

Limit memory usage for sidekick cache

Open Seriyyy95 opened this issue 1 year ago • 4 comments

Hi.

Am I understand correctly, that Sidekick cache uses cache location on disk as backup between reloads but all cached data is placed in memory?

For sites with limited resources (e.g. small VPS) that may be a problem because there Caddy may consume all memory that needed for another processes.

It would be a great to have ability to limit memory amount that can be used for caching purposes or at least number of pages that can exist in the cache in the same time.

Seriyyy95 avatar Oct 15 '24 13:10 Seriyyy95

I believe this can be controlled by the php.ini option opcache.memory_consumption ?

kmott avatar Dec 26 '24 18:12 kmott

It would be a great to have ability to limit memory amount that can be used for caching purposes or at least number of pages that can exist in the cache in the same time.

Currently no, and there were much more issue about concurrent, I'll suggest disable it for stability now. And I'm also working on it to fix it now... Currently just only fix some concurrent issues, it will need almost full rewrite to fix all the issues. Should be available soon but no ETA. You can try it in this branch: https://github.com/cs8425/frankenwp/tree/fix-sidekick-cache

I believe this can be controlled by the php.ini option opcache.memory_consumption ?

No, the memory used by "sidekick cache", which belong to golang without limit currently . I'm also plan to add it, just after fixing all concurrent issues.

cs8425 avatar Sep 05 '25 12:09 cs8425

Hi, I’ve completed an (almost rewritten) initial version of the sidekick cache. For the sidekick cache part (and some compilation fixes), please check this branch: https://github.com/cs8425/frankenwp/tree/fix-sidekick-cache

The main branch additionally add a docker compose template, with the main changes:

  1. using a Unix socket connection.
  2. replaced phpMyAdmin with Adminer.
  3. WordPress cron is now handled by a separate container running wp-cli.

If encounter any issues, please feel free to report them, I’ll do my best to fix them.

cs8425 avatar Sep 07 '25 14:09 cs8425

@cs8425 your fixes look pretty interesting, I plan on taking a look at your branch in early October, and will let you know if I find anything with my testing.

kmott avatar Sep 21 '25 21:09 kmott