Skip to content

Commit

Permalink
chore: bolt timeout to 45s (sofastack#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzdx authored Jul 30, 2022
1 parent 0dbe997 commit b802ace
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ SOFARegistry 是蚂蚁金服开源的一个生产级、高时效、高可用的
- [发布历史](https://www.sofastack.tech/sofa-registry/docs/ReleaseNotes)
- [发展路线](https://www.sofastack.tech/sofa-registry/docs/RoadMap)
- 源码解析
- [SlotTable](https://www.sofastack.tech/projects/sofa-registry/code-analyze/code-analyze-slottable/)
- [发布订阅推送](https://www.sofastack.tech/projects/sofa-registry/code-analyze/code-analyze-publish-subscription-push/)
- [registry meta 选主](https://www.sofastack.tech/projects/sofa-registry/code-analyze/code-analyze-registry-meta/)
- [SlotTable](https://www.sofastack.tech/projects/sofa-registry/code-analyze/code-analyze-slottable/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.util.Arrays;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.commons.lang.StringUtils;

/**
* @author shangyu.wh
Expand All @@ -44,6 +45,14 @@ public class BoltExchange implements Exchange<ChannelHandler> {
System.setProperty(Configs.TP_QUEUE_SIZE, String.valueOf(1000 * 10));
System.setProperty(Configs.TP_MIN_SIZE, String.valueOf(OsUtils.getCpuCount() * 10));
System.setProperty(Configs.TP_MAX_SIZE, String.valueOf(OsUtils.getCpuCount() * 10));

// bolt.tcp.heartbeat.maxtimes * bolt.tcp.heartbeat.interval
// If the client has not sent heartbeat for 45 seconds, it is determined as down
// The default value of 90s is too long. Change it to 45s to reduce the impact of physical
// machine downtime
if (StringUtils.isEmpty(System.getProperty(Configs.TCP_SERVER_IDLE))) {
System.setProperty(Configs.TCP_SERVER_IDLE, String.valueOf(45000));
}
}

@Override
Expand Down

0 comments on commit b802ace

Please sign in to comment.