0 votes
by (290 points)

I have an app where I am using rebex file transfer pack version 4.0.6930. After upgrading to any version after 4.0.6930 the app is creating too many threads.

I am concurrently connecting to multiple ftp servers. In new version the app creates threads more than the open connections but earlier we were able to manage those connection with lesser number of threads.

E.g if we open 100 connections we were able to manage those using ~45 threads. Now it creates 100+ threads.

You can download the sample code from https://drive.google.com/open?id=1MDCVAm0BNtXPGASlIHYOVgZXyMf2L5UQ

I am using version 4.0.6930 in this app. Try updating to latest version and see the difference in number of threads in task manager.

1 Answer

0 votes
by (70.2k points)

We have not been able to reproduce this so far. Does it still occur with the latest release?

For other readers, this is the latest statement from our developers:

All Rebex FileTransferClient’s Async methods are currently implemented as blocking synchronous methods that are called via an equivalent of Task.Run. Therefore, if you call the ConnectAsync method 100 times, it will attempt to start 100 asynchronous operations in 100 asynchronous threads. Which means it doesn’t really scale (and starves the process of threads) when used this way.

We plan to eventually upgrade all the Async methods to be truly asynchronous, which will solve the issue and make FileTransferClient extremely scalable. Until then, the only solution is to take this behavior into account and design your application accordingly (by limiting the maximum number of concurrent Rebex FileTransferClient operations, for example).

On a side note, I noticed that your e-mail is not currently associated with any Rebex contract. If you already purchased a license, please let us know so we can update our database. Thanks!