Skip to content

Instantly share code, notes, and snippets.

dotnet core 诊断

managed 侧未捕获异常

目前可以通过查看 stdout/stderr 的栈排查。

unmanage 侧异常

需要使用 lldb 看 core 文件。建议在 docker 镜像 su21/dotnet 内重现 然后用 镜像内的 lldb 以及符号排查。 SceneServer/SceneServer/debugcore 是一个看 coredump 的辅助脚本。

卡死问题

Three system configuration parameters must be set to support a large number of open files and TCP connections with large bursts of messages. Changes can be made using the /etc/rc.d/rc.local or /etc/sysctl.conf script to preserve changes after reboot.

1. /proc/sys/fs/file-max: The maximum number of concurrently open files.

fs.file-max = 1000000

2. /proc/sys/net/ipv4/tcp_max_syn_backlog: Maximum number of remembered connection requests, which are still did not receive an acknowledgment from connecting client. The default value is 1024 for systems with more than 128Mb of memory, and 128 for low memory machines.

net.ipv4.tcp_max_syn_backlog = 3240000

3. /proc/sys/net/core/somaxconn: Limit of socket listen() backlog, known in userspace as SOMAXCONN. Defaults to 128.

net.core.somaxconn = 3240000

diff --git a/build/build_win.ninja.template b/build/build_win.ninja.template
index 3edfb6a4..0f8cb372 100644
--- a/build/build_win.ninja.template
+++ b/build/build_win.ninja.template
@@ -1,12 +1,12 @@
rule cc
- command = ninja -t msvc -- $cc /nologo /showIncludes /FC @${out}.rsp /c ${in} /Fo${out}
+ command = ninja -t msvc -- $cc /nologo /showIncludes /FC @${out}.rsp /c ${in} /Fo${out} /source-charset:utf-8 /execution-charset:utf-8
description = CC ${out}
rspfile = ${out}.rsp
package main
import (
"log"
"github.com/gin-gonic/gin"
)
func main() {
engine := gin.Default()