Threads

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
GeXus
Forum Regular
Posts: 631
Joined: Sat Mar 11, 2006 8:59 am

Threads

Post by GeXus »

Would you say that you can ever have too many threads? Is there like a number that one should avoid going over for performance sake? or is it ok to have thousands of created threads.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

maybe fastCGI would help?
GeXus
Forum Regular
Posts: 631
Joined: Sat Mar 11, 2006 8:59 am

Post by GeXus »

huh?
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

GeXus
Forum Regular
Posts: 631
Joined: Sat Mar 11, 2006 8:59 am

Post by GeXus »

My question was if it is ok to have thousands of threads...
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

Thousands is a tad high. If you're on shared hosting you won't be for long.

Read about fastCGI and it will explain the pitfalls of many threads and offer you a solution.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

If you have the CPU and memory, then more threads or processes can be a good thing. But at some point you will start pushing against the performance tradeoffs of the OS in its scheduler. I would recommend doing some research on where those limits are.
(#10850)
User avatar
veridicus
Forum Commoner
Posts: 86
Joined: Fri Feb 23, 2007 9:16 am

Re: Threads

Post by veridicus »

GeXus wrote:Is there like a number that one should avoid going over for performance sake?
A gazillion. :wink:

It's very dependent on the OS and hardware. If you can't find any hard numbers for your configuration on the net then it's best to create a test and find out the hard way.
Post Reply