Hi, I've basically tried to ask this question before ( http://mina.markmail.org/message/bjpiogngdaxf3fyc?q=Buffering+question) but unfortunately I didn't manage to get much further. So I'll try to refrain my question a little bit in the hope to get some more answers.
I'm using Mina to broadcast lots of incoming data from external hardware devices to connected clients. We need a write-throughput of at least 40 Mbit/s and right now we're reaching _at most_ about 10MBits/s (but usually it's just around 3Mbit/s). The data is received by the Mina server as binary data but is converted into strings (the data is actually utf-8 encoded strings). When a new line has been detected, some meta-data is added to the detected row and the whole row is persisted to disk as well as being sent to all clients registered to receive data from this device. For each line one or more regular expression filters are applied (since the clients are only interested in certain data). Right now I'm using session.write(rowData) for each new line for each client who's registered as interested. But as soon as we get many clients (> 30 or so) the performance is declining. In some tests we've done it takes several minutes for the clients to receive all data after the hardware device has been shutdown. For encoding I'm using the TextLineEncoder and I suspect I may be suffering from the same issue as in http://mina.markmail.org/message/5xtmwbode6cgifox?q=performance+file("[TextLineEncoder] create a bunch of (small) IoBuffer objects for each individual line (or message object) which are then put into the writer's queue. This is quite inefficient since thousand of small IoBuffer objects will be sent over the wire instead of creating one buffer with a more appropriate buffer size"). I've tried using the mergeAll method but I don't see much difference, but mabey I'm not using it correctly. I've also taken a look at the Mina FTP server project. Here the data channels are made up of input and outputstreams stored in the session. Perhaps I'm better of using this approach for sending the data instead of going through the TextLineEncoder? I'm using Mina 1.1.7. What do you think? /Johan
