pomelo运行一段时间之后失去响应

  1. pomelo list和ps aux显示都正常运行

    serverId serverType pid rss(M) heapTotal(M) heapUsed(M) uptime(m)
    admin-server-1 admin 4186 264.08 221.84 201.38 15557.80

  2. gdb bt

    (gdb) attach 4186
    (gdb) bt

    0 0x00007f7152ca7619 in syscall () from /lib/x86_64-linux-gnu/libc.so.6

    1 0x000000000097328a in uv__epoll_wait (epfd=<optimized out>, events=<optimized out>, nevents=<optimized out>, timeout=<optimized out>) at ../deps/uv/src/unix/linux-syscalls.c:282

    2 0x0000000000971a28 in uv__io_poll (loop=0xe7fa80, timeout=1000) at ../deps/uv/src/unix/linux-core.c:187

    3 0x0000000000965558 in uv_run (loop=0xe7fa80, mode=<optimized out>) at ../deps/uv/src/unix/core.c:317

    4 0x000000000081cfe0 in node::Start(int, char**) ()

    5 0x00007f7152bd876d in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6

    6 0x000000000058d5b1 in _start ()

  3. strace

    sudo strace -p 4186
    clock_gettime(CLOCK_MONOTONIC, {12498531, 474744851}) = 0
    epoll_wait(5, {}, 1024, 396) = 0
    clock_gettime(CLOCK_MONOTONIC, {12498531, 871268177}) = 0
    clock_gettime(CLOCK_MONOTONIC, {12498531, 871300395}) = 0
    futex(0x7f6b1c0008c8, FUTEX_WAKE_PRIVATE, 1) = 1
    clock_gettime(CLOCK_REALTIME, {1410747202, 464533490}) = 0
    futex(0xe7fe24, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0xe7fe20, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1
    futex(0xe7fde0, FUTEX_WAKE_PRIVATE, 1) = 1
    clock_gettime(CLOCK_REALTIME, {1410747202, 464742281}) = 0
    epoll_wait(5, {{EPOLLIN, {u32=8, u64=8}}}, 1024, 432) = 1
    clock_gettime(CLOCK_MONOTONIC, {12498531, 871745189}) = 0
    read(8, "\1\0\0\0\0\0\0\0", 1024) = 8

标签: pomelo 开发求助
qklxtlx 在 2014-9-15 11:07发布 分享到 weibo
3 回复
#1 qklxtlx 2014-9-15 11:09 回复

挂载在这个backend server上的express还能正常工作

但是涉及本身的逻辑处理全挂了

#2 {2} wangxy 2014-9-15 11:55 回复

这个堆栈是很正常的

qklxtlx 2014-9-15 12:46 回复

嗯,堆栈是正常,就是代码工作不正常而已

我现在正视图用node remote debug. 不过还有其他方法么?

wangxy 2014-9-15 14:13 回复

@qklxtlx 可以使用node-inspector,不过这些调试方式都不咋太有效,建议在处理请求的逻辑处每一处都打日志,看日志吧

#3 {3} qklxtlx 2014-9-15 15:06 回复

@wangxy

最终解决了,没用Node-inspector,因为这东西需要一开始就挂上去不方便,最后直接用的node debug类似gdb的方式搞定了。等我有空写个blog做教程吧……实在是太难查了……

http://offthelip.org/2012/08/22/debugging-a-running-node-js-process/
http://nodejs.org/api/debugger.html

wangxy 2014-9-15 17:28 回复

@qklxtlx 赞~, 最后是啥问题,可以分享一下

EdwardZhou 2014-9-16 11:28 回复

为何不直接用 WebStorm 的Node Remote调试功能?

qklxtlx 2014-9-16 15:59 回复

@EdwardZhou 因为是生产服务器,运维管杀不管埋……在测试和开发服务器上复现不了我也是醉了。。。能用IDE当然上IDE

回到顶部