Re: [strongSwan] charon: how to determine minimum number of threads

2009-11-09 Thread Martin Willi
Hi,

 Scanning through the mailing list I can see that the recomended minimum 
 number of threads is 8-10 depending on the plugins used.
 
 Is there a way to determine the absolute minimum number of threads for a 
 given plugin configuration?

This additionally depends on how you'll use the plugins. The stroke
plugin for example uses a thread to serve ipsec statusall, and
actually two threads for ipsec up, one for the actual work, and one to
wait for completion of the tunnel setup. And if you do such things in
parallel, you'll need even more threads.

 For example, are the threads allocated 
 statically at start-up or are there cases when they are spawned on 
 demand after start-up.

Threads are spawned at startup and wait in the thread pool for work.
Some of them immediately take over dedicated jobs and do not come back
before shutdown, some of them are used for short jobs, but others might
get assigned longer lasting jobs dynamically.

 My system seems to work fine with 8 threads. Can I assume that, if I 
 don't change the plugin configuration, 8 threads will always be enough?

Most likely yes. But if you invoke ipsec up potentially twice in
parallel, you might need more threads.

 Are there any plans to introduce a single threaded mode, for embedded 
 devices?

No, I don't think this is worth the effort. If your embedded device has
enough power to handle the cryptographic functions, it also can run a
dozen of threads. Threads are really not that expensive, not by the
amount of used CPU cycles nor by the amount of used memory. What are the
limitations you run into on your embedded platform?

 Is a single threaded mode possible, realistically, or would it require 
 complete re-engineering of charon?

It would require a lot of work (several man-months) to implement a
single threaded mode, as the complete architecture is designed to be
multi-threaded. And I actually see no reason to support such a mode.

We have put A LOT of energy into the multi-threaded design of charon.
CPUs are going to be multi-core, even in the embedded area. To use such
platforms efficiently, there is no way around multi-threading...

Regards
Martin

___
Users mailing list
Users@lists.strongswan.org
https://lists.strongswan.org/mailman/listinfo/users


[strongSwan] charon: how to determine minimum number of threads

2009-11-03 Thread Dimitrios Siganos
Hi,

Scanning through the mailing list I can see that the recomended minimum 
number of threads is 8-10 depending on the plugins used.

Is there a way to determine the absolute minimum number of threads for a 
given plugin configuration? For example, are the threads allocated 
statically at start-up or are there cases when they are spawned on 
demand after start-up.

My system seems to work fine with 8 threads. Can I assume that, if I 
don't change the plugin configuration, 8 threads will always be enough?

Are there any plans to introduce a single threaded mode, for embedded 
devices?

Is a single threaded mode possible, realistically, or would it require 
complete re-engineering of charon?

Regards,
Dimitrios Siganos
___
Users mailing list
Users@lists.strongswan.org
https://lists.strongswan.org/mailman/listinfo/users