Details

      Description

      I've attached a tarball that should be extracted into the ejabberd-modules directory.

      This patch implements server responses to ping requests, and, after seeing EJAB-173 it can also be configured to send ping packets to clients (by default it only responds to pings). The timer is fixed, not based on an inactivity period, but otherwise should work well. I'm sure there's some kind of cost to running thousands of these things, but since it's a module it can be enabled and configured per host in the normal ways, and is off by default.

        Issue Links

          Activity

          Hide
          badlop Badlop added a comment -

          I've merged into road-to-exmpp in SVN r2419.

          Show
          badlop Badlop added a comment - I've merged into road-to-exmpp in SVN r2419.
          Hide
          nix Zarko Markovic added a comment -

          If I understand right, new timer resource is created on each user connection which can potentially lead to thousands of timers and CPU overhead. In addition, in MS Windows timers are a limited resource.

          How about having only one timer that will fire the ping function every xx interval in order to ping all connected users. Timer creation to not be dependant on each user login. The draw back is that after a user logs in, he/she may be pinged earlier than the interval, but subsequent pings will be made according to the configured time interval.

          Show
          nix Zarko Markovic added a comment - If I understand right, new timer resource is created on each user connection which can potentially lead to thousands of timers and CPU overhead. In addition, in MS Windows timers are a limited resource. How about having only one timer that will fire the ping function every xx interval in order to ping all connected users. Timer creation to not be dependant on each user login. The draw back is that after a user logs in, he/she may be pinged earlier than the interval, but subsequent pings will be made according to the configured time interval.
          Hide
          mremond@process-one.net Mickaël Rémond added a comment -

          Ejabberd does not use OS timers, but timers managed by Erlang VM who are cheap.

          Show
          mremond@process-one.net Mickaël Rémond added a comment - Ejabberd does not use OS timers, but timers managed by Erlang VM who are cheap.
          Hide
          ekhramtsov ekhramtsov added a comment -

          Hello, Zarko

          I'm not sure what you mean "timer resource". In Erlang a timer is a record in so-called "timer wheel" which is traversed and triggers a callback (likely a message send). Refer to emulator/beam/time.c for details.
          What you suggest is doing the same but in Erlang. Also, I don't see any Windows limitations in that file, could you describe it in more details?

          Show
          ekhramtsov ekhramtsov added a comment - Hello, Zarko I'm not sure what you mean "timer resource". In Erlang a timer is a record in so-called "timer wheel" which is traversed and triggers a callback (likely a message send). Refer to emulator/beam/time.c for details. What you suggest is doing the same but in Erlang. Also, I don't see any Windows limitations in that file, could you describe it in more details?
          Hide
          nix Zarko Markovic added a comment -

          Hi Evgeniy, as Mickaël cleared it out I was actually referring to OS timers. I was thinking with C++/Win32 in mind. As you described, there should be no limitations of Erlang based timers in Windows. If Erlang timers are very cheap, there seems to be no significant advantage of having one timer for all connections.

          Show
          nix Zarko Markovic added a comment - Hi Evgeniy, as Mickaël cleared it out I was actually referring to OS timers. I was thinking with C++/Win32 in mind. As you described, there should be no limitations of Erlang based timers in Windows. If Erlang timers are very cheap, there seems to be no significant advantage of having one timer for all connections.

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development