cjyang1128
V2EX  ›  Java

生产环境的 tomcat 是不是不怎么用热部署的?

  •  
  •   cjyang1128 · Jan 19, 2017 · 3703 views
    This topic created in 3430 days ago, the information mentioned may be changed or developed.

    最近被 classloader 引发的内存泄漏弄得有点烦。。在想生产环境是不是直接 tomcat 重启算了。。。

    11 replies    2017-01-20 12:50:35 +08:00
    kanchi240
        1
    kanchi240  
       Jan 19, 2017
    一般禁止的吧
    snnn
        2
    snnn  
       Jan 19, 2017 via Android
    对!!!
    ihuotui
        3
    ihuotui  
       Jan 20, 2017
    应该思考为什么内存溢出。
    yidinghe
        4
    yidinghe  
       Jan 20, 2017 via Android   ❤️ 1
    一个办法是部署至少两个 tomcat ,使用 session 共享,前面再加个反向代理,更新时轮流重启,保证服务不中断。
    darrenfang
        5
    darrenfang  
       Jan 20, 2017
    开发环境都经常出问题😂
    Infernalzero
        6
    Infernalzero  
       Jan 20, 2017
    除非不用 spring,否则热部署其实没有太大意义,都要等初始化的时间
    而热部署次数多了就容易 OOM ,那还不如直接重启容器了
    xiaoyangsa
        7
    xiaoyangsa  
       Jan 20, 2017
    弄两台 tomcat 分开重启就行了
    mN71eOOprFyMsnPx
        8
    mN71eOOprFyMsnPx  
       Jan 20, 2017
    https://tomcat.apache.org/tomcat-7.0-doc/config/context.html

    reloadable

    Set to true if you want Catalina to monitor classes in /WEB-INF/classes/ and /WEB-INF/lib for changes, and automatically reload the web application if a change is detected. This feature is very useful during application development, but it requires significant runtime overhead and is not recommended for use on deployed production applications. That's why the default setting for this attribute is false. You can use the Manager web application, however, to trigger reloads of deployed applications on demand.
    cjyang1128
        9
    cjyang1128  
    OP
       Jan 20, 2017
    @ihuotui 找到原因了,但是感觉与其花代价去修复还不如直接禁用这个功能
    domty
        10
    domty  
       Jan 20, 2017
    一般都是 ls 那种做法
    靠 nginx 负载均衡和部署多服务来实现线上服务的部署的。
    只要保证任何时间都起码有一个能稳定提供服务的就行。
    cjyang1128
        11
    cjyang1128  
    OP
       Jan 20, 2017
    @domty soga
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2625 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 60ms · UTC 16:03 · PVG 00:03 · LAX 09:03 · JFK 12:03
    ♥ Do have faith in what you're doing.