As there seems to be no simple solution like just setting a Property, I investigated further and found the following solutions. Perhaps somebody may find them useful:
1) write a dedicated program just for the SFTP server, whose process priority may be decreased and according to Windows CE documentation, the threads of a process start with the same priority as the process, so they should have a lower priority, too.
Although this is the most obvious solution, I didn't go that way and preferred embedding the SFTP server into our application, so I could share resources like configuration files and logging.
2) intercepting the PathAccessAuthorization event and there lowering the thread priority like:
m_server = new FileServer();
m_server.PathAccessAuthorization += ( sender, e ) =>
{
Thread.CurrentThread.Priority = ThreadPriority.Lowest;
e.Allow();
};
It is not sufficient to do this only once in the Connecting event, as there seem to be several threads that are selected randomly to execute transactions. So, it is better to change the priority for every transaction.
This lowering of the priority was a solution for Reading files from our device (SFTP server -> client), but it had no effect when sending a big file to our device. Perhaps the OS just accepts the data and the application has to deal with it, no matter how its priority is set. So, for this case, I had to change the client to send the data much slower, e.g. only with 50000 bytes/s. This lowered the CPU load of the SFTP server significatly and the device was responsive again.