[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [mildly OT] Some info about Python
- From: "Pierre Chapuis" <catwell@...>
- Date: Thu, 16 Jan 2020 09:58:55 +0100
On Thu, Jan 16, 2020, at 00:30, Coda Highland wrote:
If you're referring to the CGI model where each view is handled by a separate heavyweight process, that is indeed very simple and very secure, but it is notorious for its poor scaling. Any model that involves initializing a new interpreter for every request is going to have poor scaling because you have to reinitialize the application state for each page view. The problem isn't an issue of HAVING many states; the problem is in STARTING many states.
Scalability is relative, but for many applications the performance of Lua CGI is good enough, thanks to the low interpreter startup time. This characteristic is shared with Perl, but not Python or Ruby for instance.
I have written Lua CGI code that could easily serve hundreds of dynamic pages per second on a single machine. The main issue is not really starting processes, it is opening connections to the database if you use one. This can be worked around by using things such as SQL Relay (but I never needed it myself).
Of course, if you need to serve more dynamic pages than that, it's probably better to choose a different model. But for things like personal and small business websites, it still works very well.
--
Pierre Chapuis