1. Open a connection with ssh:connect()
2. Open a channel with ssh_connection:session_channel()
3. Call ssh_channel:start_link() to create my handler process.
4. In my callback module, init() will call ssh_connection:exec() to invoke
the remote program.
5. Incoming data gets sent to my handle_ssh_message() callback. I send data
with ssh_connection:send()
Do I have it right?
It would be nice if there was a "port" abstraction for an ssh channel, so I
could treat locally and remotely invoked programs identically... I guess it
wouldn't be hard to write my own wrapper for that.
Thanks,
Dan.
Far from a complete one - but might be useful.
Kenji Rikitake
In the message <AANLkTi=xDOQ7P8nfCW-=P+98daXyKW=RJhO4N...@mail.gmail.com>
dated Wed, Sep 01, 2010 at 11:17:21AM -0500,
________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-questio...@erlang.org
This might be of interest to the list, so I'll share it...
I stress tested Erlang and SSH by establishing 1000 concurrent SSH client
sessions. Each server sent back an 8 byte message every 250ms. On my
Windows Core2Duo 3GHz, system load was ~25%.
To compare, I also wrote the client in Python using Paramiko for SSH (1 OS
thread per connection). CPU load and memory usage was consistent with the
Erlang solution, but it died at 400 connections due to address space
exhaustion (thread stacks were too big...probably fixable, but I didn't try
too hard)
Also, I wrote a Python client that used plink.exe for SSH. (1 OS process per
connection). CPU load was consistent with the Erlang solution, but memory
use was insane. It died at ~500 connections due to lack of file descriptors
(also probably fixable, but I didn't try).
In all cases, the server was a single linux machine running Erlang/SSH. The
actual use case for all this is to talk SSH to 1000 individual embedded
systems on a large LAN. I am pleased with the way Erlang has behaved.
Dan.
--
Daniel Goertzen
-----------------
da...@networkintegritysystems.com (work)
daniel....@gmail.com (home)
-----------------
1 204 272 6149 (home/office)
1 204 470 8360 (mobile)
-----------------