BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

maximum number of threads

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
Jurgen Simons
Guest





PostPosted: Wed Oct 22, 2003 3:01 am    Post subject: maximum number of threads Reply with quote



I would like to know how many threads can run on a Indy TCP/IP Server. How
many threads can run without problems on a P4 2.4Ghz with 1GB RAM?

Thanks!

Jurgen Simons


Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Wed Oct 22, 2003 3:20 am    Post subject: Re: maximum number of threads Reply with quote




"Jurgen Simons" <jsimons (AT) yucom (DOT) be> wrote

Quote:
I would like to know how many threads can run on a Indy TCP/IP Server.

Hundreds certainly, possibly thousands. Depending on the actual OS you are
using, the OS itself will start to buckle after a couple of thousand.

Indy 10 will include support for Fibers, which will significantly reduce the
number of threads needed. Multiple Fibers can run in the context of a
single thread, and by the time Indy 10 is released, the Fiber support will
be optimized to the point where you will hardly see any performance
difference between using threads and using fibers for handling client
connections.

Quote:
How many threads can run without problems on a P4 2.4Ghz with 1GB RAM?

That is an OS issue, not an Indy issue. Indy will keep making threads until
the OS and memory can't make anymore. Newer OSs have a higher limit than
older OSes over how many threads can be created.


Gambit




Back to top
Martin James
Guest





PostPosted: Wed Oct 22, 2003 3:35 am    Post subject: Re: maximum number of threads Reply with quote




"Jurgen Simons" <jsimons (AT) yucom (DOT) be> wrote

Quote:
I would like to know how many threads can run on a Indy TCP/IP Server. How
many threads can run without problems on a P4 2.4Ghz with 1GB RAM?


Thousands can exist. Your question needs tightening up. What may be a
problem to you may not be to others. If you have thousands of clients
connected but very few are actually doing much, there should be no problem.
It all depends on the loading generated by your clients.

If you have 20 clients all doing intensive, concurrent database queries on
the TCP server, response will be slow as the CPU is shared amongst the ready
threads.

There are some issues with lots of threads. Around ~2000, the default
thread stack size has to be reduced to prevent the 2GB process virtual
address space running out. The thread stacks are given the same space as
the main thread. The default for this is 1 meg & so can be reduced greatly
without problems - it's in the linker options.

Rgds,
Martin





Back to top
Lluis Olle
Guest





PostPosted: Wed Oct 22, 2003 5:09 pm    Post subject: Re: maximum number of threads Reply with quote

I think the limit comes from tha fact that in a "normal" NT environment,
your application is confined into a 2Gb address space - the other 2Gb
address space being reserved for the system itself.

But each thread you create will "eat" by default 1Mb of address space - no
matter if phisically only allocates a few Kbytes of ram. So, if your sum the
main application own memory requirements, then I doubt you can create more
than 2000 threads (because 2000 x 1Mb = 2Gb). Sure, your application will
die much before, so don't count on having more than 1500 threads active for
one single process.

"Jurgen Simons" <jsimons (AT) yucom (DOT) be> escribió en el mensaje
news:3f95f334$1 (AT) newsgroups (DOT) borland.com...
Quote:
I would like to know how many threads can run on a Indy TCP/IP Server. How
many threads can run without problems on a P4 2.4Ghz with 1GB RAM?

Thanks!

Jurgen Simons





Back to top
Dmitry
Guest





PostPosted: Wed Oct 22, 2003 5:10 pm    Post subject: Re: maximum number of threads Reply with quote

I'm creating maximum 1600 threads in Windows XP!
If more - program will crash! =(

"Lluis Olle" <llob (AT) menta (DOT) net> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:3f96b9d0 (AT) newsgroups (DOT) borland.com...
Quote:
I think the limit comes from tha fact that in a "normal" NT environment,
your application is confined into a 2Gb address space - the other 2Gb
address space being reserved for the system itself.

But each thread you create will "eat" by default 1Mb of address space - no
matter if phisically only allocates a few Kbytes of ram. So, if your sum
the
main application own memory requirements, then I doubt you can create more
than 2000 threads (because 2000 x 1Mb = 2Gb). Sure, your application will
die much before, so don't count on having more than 1500 threads active
for
one single process.

"Jurgen Simons" <jsimons (AT) yucom (DOT) be> escribió en el mensaje
news:3f95f334$1 (AT) newsgroups (DOT) borland.com...
I would like to know how many threads can run on a Indy TCP/IP Server.
How
many threads can run without problems on a P4 2.4Ghz with 1GB RAM?

Thanks!

Jurgen Simons







Back to top
Chad Z. Hower aka Kudzu
Guest





PostPosted: Thu Oct 23, 2003 4:39 pm    Post subject: Re: maximum number of threads Reply with quote

"Lluis Olle" <llob (AT) menta (DOT) net> wrote in
news:3f96b9d0 (AT) newsgroups (DOT) borland.com:
Quote:
I think the limit comes from tha fact that in a "normal" NT environment,
your application is confined into a 2Gb address space - the other 2Gb
address space being reserved for the system itself.

Correct.

Quote:
But each thread you create will "eat" by default 1Mb of address space -
no matter if phisically only allocates a few Kbytes of ram. So, if your
sum the main application own memory requirements, then I doubt you can

You can adjust down the reserved space on XP (and maybe 2000) on a per thread
basis. On others you can adjust it only globally.

Quote:
application will die much before, so don't count on having more than
1500 threads active for one single process.

Correct. Really at 1,000 or so you should think about a different structure
anyways (other than 1 thread per connection).


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Want more Indy stuff? Try the Atozed Indy Portal at
http://www.atozedsoftware.com/
* More Free Demos
* Free Articles
* Extra Support


ELKNews - Get your free copy at http://www.atozedsoftware.com


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.