GithubHelp home page GithubHelp logo

Comments (6)

qzhuyan avatar qzhuyan commented on May 24, 2024

you could use following command to check if the value in use is correct

emqx eval 'emqx_config:get_listener_conf(tcp, default, [tcp_options, keepalive], "none")'

you could also enable debug log level , while you client connects, you should see some logs like:
2024-04-11T12:46:15.631182+02:00 [debug] msg: custom_socket_options_successfully, peername: 127.0.0.1:47138, opts: [{keepalive,true},{raw,6,4,<<5,0,0,0>>},{raw,6,5,<<12,0,0,0>>},{raw,6,6,<<3,0,0,0>>}]

if they looks ok. probably your OS/container doesn't allow setting the keep alive socket opts.

from emqx.

hzms avatar hzms commented on May 24, 2024

@qzhuyan
图片
图片

I can confirm that my configuration was retrieved by emqx, but it doesn't work

probably your OS/container doesn't allow setting the keep alive socket opts => the docker container is emqx:5.5.1, it's official, i didn't build it myself. If you have docker, you can try it yourself very quickly.
If this is a problem with the official docker image, I hope emqx organization can fix it.

from emqx.

qzhuyan avatar qzhuyan commented on May 24, 2024

Could you enable debug log?

from emqx.

qzhuyan avatar qzhuyan commented on May 24, 2024

Oh you attached the log in picture I missed it.
No debug log needed for now.

from emqx.

qzhuyan avatar qzhuyan commented on May 24, 2024

I started the container on ubuntu 22.04 with

docker run -p 1883:1883 -e EMQX_LISTENERS__TCP__DEFAULT__TCP_OPTIONS__KEEPALIVE="5,12,3" emqx/emqx:5.5.1

connect the client with bench tool.

./emqtt_bench conn   -c 1
Start with 6 workers, addrs pool size: 1 and req interval: 60 ms 

1s connect_succ total=1 rate=0.99/sec

tcpdump shows keep alive is sent after 5s idling then another keep alive after 12s.

from emqx.

qzhuyan avatar qzhuyan commented on May 24, 2024

test.pcap.zip
pcap is attached.

from emqx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.