Giter Site home page Giter Site logo

Comments (6)

laruence avatar laruence commented on June 9, 2024

如果这个文件变更不是很频繁的话,我建议你们可以使用yaconf, 不会出现不一致的情况,Yac是有一定概率出错的。

from yac.

zhongweikang avatar zhongweikang commented on June 9, 2024

鸟哥,Yac 写入或者读出缓存的时候,不是有 crc 的校验么,为什么还会发生缓存不一致的问题呢?

在文章:https://www.laruence.com/2013/03/18/2846.html 里找到了这么一句话

可见, 最严重的错误, 就是A和B的缓存都失效, 但是Yac不会把错误数据返回给用户, 当下一次来查询Cache的时候, 因为存在crc校验, 所以都miss.

from yac.

letwang avatar letwang commented on June 9, 2024

crc碰撞 了解下,所以Yac还是会一定概率出错的。

from yac.

zhongweikang avatar zhongweikang commented on June 9, 2024

crc碰撞 了解下,所以Yac还是会一定概率出错的。

为什么一个bug会被这么理所当然的解释,而不是尝试去修复.

所以结论就是

想要上生产环境,就必须容忍这个bug,或者换成 yaconf

from yac.

letwang avatar letwang commented on June 9, 2024

实际上,我已经使用了APCu代替了YacYaconf
Yac的毛病,正如你发现的 1个BUG 还当成理所当然 当然是不对的,可用在不那么重要的数据上。
Yaconf的毛病,正如我提到的:laruence/yaconf#67 BUG提了1年了,还没修复,所以 我无法继续等待了。
而我发现APCu是PHP官网出品,功能不仅仅完美替代了YacYaconf,而且其他方面都更加强大~

比如我的项目HookPHP,使用了APCu和PHP8.1的预加载技术,你可以参考下:

  1. 业务配置字典文件支持多及目录 https://github.com/letwang/HookPHP/tree/master/app/admin/config
  2. 配置PHP服务启动时自动加载业务配置 https://github.com/letwang/HookPHP/blob/master/Dockerfile#L460
  3. 把配置数据预加载到服务器常驻内存 https://github.com/letwang/HookPHP/blob/master/preload.php
  4. APCu缓存管理面板 https://github.com/letwang/HookPHP/blob/master/apc.php

from yac.

zhongweikang avatar zhongweikang commented on June 9, 2024

实际上,我已经使用了APCu代替了YacYaconfYac的毛病,正如你发现的 1个BUG 还当成理所当然 当然是不对的,可用在不那么重要的数据上。 Yaconf的毛病,正如我提到的:laruence/yaconf#67 BUG提了1年了,还没修复,所以 我无法继续等待了。 而我发现APCu是PHP官网出品,功能不仅仅完美替代了YacYaconf,而且其他方面都更加强大~

比如我的项目HookPHP,使用了APCu和PHP8.1的预加载技术,你可以参考下:

  1. 业务配置字典文件支持多及目录 https://github.com/letwang/HookPHP/tree/master/app/admin/config
  2. 配置PHP服务启动时自动加载业务配置 https://github.com/letwang/HookPHP/blob/master/Dockerfile#L460
  3. 把配置数据预加载到服务器常驻内存 https://github.com/letwang/HookPHP/blob/master/preload.php
  4. APCu缓存管理面板 https://github.com/letwang/HookPHP/blob/master/apc.php

感谢回复

from yac.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.