Run more threads in processor

TumblingJazz Tumblr bot discussion
Post Reply
Moses
Posts: 289
Joined: Fri Feb 28, 2014 11:59 pm

Run more threads in processor

Post by Moses »

How can i run more threads in processor? would i need more internet speed or other resources?
User avatar
martin@rootjazz
Site Admin
Posts: 34712
Joined: Fri Jan 25, 2013 10:06 pm
Location: The Funk
Contact:

Re: Run more threads in processor

Post by martin@rootjazz »

Running MORE threads isn't always FASTER.

Your machine can ONLY processor X number of items at any one time, where X is the number of processors you have. In order to simulate multi threading, what happens is the processes are swapped in and out of the CPU. After a while, you lose more time due to this swapping trying to process a high number of threads at once that if you had a lower number of threads.
Moses
Posts: 289
Joined: Fri Feb 28, 2014 11:59 pm

Re: Run more threads in processor

Post by Moses »

So i will need more CPU to run more thread?
User avatar
martin@rootjazz
Site Admin
Posts: 34712
Joined: Fri Jan 25, 2013 10:06 pm
Location: The Funk
Contact:

Re: Run more threads in processor

Post by martin@rootjazz »

I mean, technically you can run more threads, but at any one instant, your computer can only compute X number of things at once, where X is the processor count.

I Think the current limit is a 100. That isn't going to be increased. Adding more processors would just speed up the processing of the queued tasks in the OS
Moses
Posts: 289
Joined: Fri Feb 28, 2014 11:59 pm

Re: Run more threads in processor

Post by Moses »

By 'processor' do you mean threads?
User avatar
martin@rootjazz
Site Admin
Posts: 34712
Joined: Fri Jan 25, 2013 10:06 pm
Location: The Funk
Contact:

Re: Run more threads in processor

Post by martin@rootjazz »

I mean processor cores, so if you upgraded your CPU from dual core to quad core, you can now at EXACTLY the same time, process 4 threads, not two, thus it would be quicker and helping with swapping processes into the processor.

Have a read up on google, of threading / CPU / processes of how it is all handled and how adding more and more threads isn't always faster. You'll get better answers than I can give
Moses
Posts: 289
Joined: Fri Feb 28, 2014 11:59 pm

Re: Run more threads in processor

Post by Moses »

I've been running 14 processor threads on my now without any slow issues i notice. My vps has 1GB / 1CPU/ 100mpbs connection.
User avatar
martin@rootjazz
Site Admin
Posts: 34712
Joined: Fri Jan 25, 2013 10:06 pm
Location: The Funk
Contact:

Re: Run more threads in processor

Post by martin@rootjazz »

14 is fine, but it also depends on how many each action thread has

so if you run each action thread with 10 threads, that is 14x10 = 140

Personally I try and keep it around 20. But test things and find out what works best for you
Post Reply