Forums

Are threads blocked in paid accounts as well?

I have tried to add some threading in a web2py application I am developing. Whenever I try to start a new thread though, I get the following error:

<class 'thread.error'> can't start new thread

I take it that the creation of threads is intentionally blocked for free accounts, in order not to abuse the resources. Do the paid accounts have the same limitation?

Thanks

Unfortunately right now we don't enable threads, though Web Developer accounts get multiple worker processes per domain (free and Hacker accounts don't).

It's a good idea, though. I'll see if we could enable at least a reasonable thread pool for paid accounts.

I will be looking forward to have such a feature. Thank you

Do I understand correctly, that it is not possible to access web2py application by more than 1 user simultaneously because threads are disabled? My application on free account here does not respond if a function in controller has not finished its work and I try to access other controllers.

So even on payed account it will not be possible to host web2py site here with about 50 people accessing it simultaneously? Or worker processes will act as threads in this case?

Yes, worker processes act as like threads in terms of the number of concurrent users you can support -- so it should be fine to host a web2py site like that on a paid account. The popular web2pyslices site is hosted here, with the default "Web hosting" number of workers, and it's pretty responsive.

Thanks. By "default "Web hosting"" you mean "Web Developer: $12/month" plan?

Upd. Also, Im sorry, but this is important for me to understand. Are "threads" that was talked about earlier and web2py "threads" the same thing? Because in a web2py blog it says "In web2py each request is served by a different thread.". Are concurrent, simultaneous requests by one user in a web2py application supported by PytohnAnywhere on free account? It seems like they are not working for me, only one at a time. May be Im doing something wrong.

Yes, that's the plan I mean.

I think that web2py must be able to see that we're not supporting threads and failing over to a simpler system that only supports one connection at a time -- that would explain the behaviour you're seeing.

Hello, I'm setting newrelic (http://newrelic.com/) in my application but I have a problem.

The log says:

The New Relic Python Agent requires that when using uWSGI that the enable-threads option be given to uwsgi when it is run. If the option is not supplied then threading will not be enabled and you will see no data being reported by the agent. For more details see https://newrelic.com/docs/python/python-agent-and-uwsgi.

Can I set enable-threads option? How?

Thanks in advance

Hi grantorneo,

We will enable threads for paying users as of next release. So expect it to happen in 1 or 2 weeks. It will just be automatic. You won't have to do anything.