推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
alsoran1
V2EX  ›  Python

求问 gunicorn 不同的 work 进程中,能共享一个对象,然后主进程定期去更新这些对象吗?

  •  
  •   alsoran1 · Jan 29, 2018 · 2383 views
    This topic created in 3050 days ago, the information mentioned may be changed or developed.
    3 replies    2018-02-26 10:07:42 +08:00
    alsoran1
        1
    alsoran1  
    OP
       Jan 29, 2018
    因为这个对象构建起来代价太大,并且需要保持一致性
    tonghuashuai
        2
    tonghuashuai  
       Jan 29, 2018
    这个问题用其他的方案去解决代价应该会小一点……比如把你要共享的对象数据存到 redis 中
    sinly100
        3
    sinly100  
       Feb 26, 2018
    你的这个问题本质就是多进程之间共享数据,一般最简单的方法是通过外部存储共享,如 MongoDB、Redis
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2972 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 09:27 · PVG 17:27 · LAX 02:27 · JFK 05:27
    ♥ Do have faith in what you're doing.