Forums

RuntimeError: can't start new thread

RuntimeError: can't start new thread getting a lot of these errors lately is there limit on no of threads that can be launched. if so how many can be launched per scheduled task/console. Is there workaround like upgrading my plan will increase this limit?

Yes, there's a limit of 128 threads/processes (from the OS's perspective, they're the same kind of thing). We can bump up the limit for your account within reason, but in general there's not much point in having lots of threads; after all, the server where your code runs has a limited number of CPUs.

please bump up the limit upto whatever value is feasible from ur end.

We'd need to know some more specifics first; 128 is a normal default for general use of our services. Could you let us know what you need the extra processes for?

i execute trading strategies and each strategy is run in a separate thread

128 threads is the maximum, so you will need to keep the threads that you start below that number.

Cool