lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Le mer. 28 nov. 2018 à 12:55, Francisco Olarte <> a écrit :
 This is something needed for Lua programs that run threads to implement a web service,

NO, it is not. Lots of people run thread oriented web services without this.

It is not raisonnable at all to run any web service with threads for servicing each concurrent request that can steal unlimited amounts of resources needed by concurrent threads. You need a way to police them or at least ensure that each thread will get an equitable share of resource, i.e. equal share of time and memory, without also exceeding a maximum allowed quantum so that each thread can be sure to also have a minimum share and perform without failing always.

If the web service dies not do that, it is extremely easy to block with a DOS attack. All reasonable requests should then succeed and other requests exceeding their quota will be the only one to fail as expected.

We need limits always because absolutely no server has infinite amounts of resources. So we always need a way to strictly enforce these quota.

With basic Lua threads, we have absolutely no control in any thread that can deliberately use the allocator as much as they want, when they should fail early without causing damages to other competing threads, including hidden internal threads needed for the maintenance and monitoring of the web service itself, or for enforcing the policy, and perform cleanup of failing threads that have exhausted their allowed quota.