473,237 Members | 1,333 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,237 software developers and data experts.

What's with "long running processes" ?

I understand that Python has them, but PHP doesn't.

I think that is because mod_php is built into apache, but mod_python
is not usually in apache. If mod_python was built into apache, would
python still have long running processes (LRP)?

Do LRPs have to do with a Python interpreter running all the time? Or
is it something else?

I also understand that LRPs are the reason that shared hosting is less
common, and more expensive for python than php. The LRP have a major
effect on how many users can packed onto a single server.

As to LRPs: does it matter if you're using mod_python, fastcgi, wsgi,
scgi, cgi, or whatever?

Obviously, I am a little foggy about LRPs, can somebody help me out?

Sep 18 '07 #1
1 2395
walterbyrd a écrit :
I understand that Python has them, but PHP doesn't.
Really ?
I think that is because mod_php is built into apache, but mod_python
is not usually in apache.
Language etc aside, what the difference between mod_php and mod_python
(or mod_whatever) from apache's POV ?
If mod_python was built into apache, would
python still have long running processes (LRP)?
mod_php is not more 'built into' apache than mod_python. Both are
extension modules for apache. FWIW, when apache is configured to use
mod_python, it starts a first python interpreter process at startup,
then some more python "sub-interpreters" when needed, according to your
configuration.
Do LRPs have to do with a Python interpreter running all the time? Or
is it something else?
The notion of "long running process" is nothing Python-specific. The
most basic way to deliver dynamic content from a web server like apache
is to use CGI - which means that on each http request, the web server
starts a new (Python | Perl | PHP | Whatever) process. A more elaborate
solution is to have another process running independently, and some way
for both processes (web server and application) to communicate. This was
is usually known as a "long running process".
I also understand that LRPs are the reason that shared hosting is less
common, and more expensive for python than php.
Yes and no. You can use Python with apache without a LRP - either with
CGI or mod_python - but the first solution is very inefficient, and the
second is not really appropriate for shared hosting given how mod_python
works. Also, while LRPs have a big advantage (you don't need to rebuild
the whole world for each and every request), they have a couple
drawbacks when it comes to shared hosting. The first one is that your
host must provide some way to manage (run/stop/restart/monitor) the
process. The second is that, while CGI scripts are (more or less) under
control of the web server (IOW : they won't hang out forever), it's not
true for LRPs. Which means that a program error (ie: an endless loop
allocating memory on each iteration...) can potentially bring the while
server down. Not that there are no ways to limit the risks and
consequences, but this requires much more work for the host (and believe
me, shared hosting administration is not simple...).
The LRP have a major
effect on how many users can packed onto a single server.
Not necessarily. From a purely technical POV, they are usually less
wasteful wrt/ resources than CGI or mod_php.
As to LRPs: does it matter if you're using mod_python, fastcgi, wsgi,
scgi, cgi, or whatever?

Obviously, I am a little foggy about LRPs, can somebody help me out?
You can help yourself out, by installing apache on your own machine and
learning the different ways to deploy web applications with it. While
you won't have the same constraints as a shared hosting admin, you'll at
least get a better understanding of the whole damn thing.

Sep 18 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Joe Peterson | last post by:
I could not find another example of this via internet searches, so here it is... I am wondering if this is a python bug or otherwise. The first example of this happened in a larger program of...
1
by: Num | last post by:
Hi all, I have to convert a J2EE date as a long ("Millis") in a .NET date as a long ("Ticks") In Java, currentTimeMillis, is the difference, measured in milliseconds, between the current time...
17
by: Adam Ierymenko | last post by:
I have a question that might have been asked before, but I have not been able to find anything via groups.google.com or any web search that is definative. I am writing an evolutionary AI...
1
by: Markus Wollny | last post by:
Hello! I'm currently testing deployment of tsearch2 on our forum table. The table is huge in itself - some 2GB of data without the indexes. I have got PostgreSQL 7.4RC2 running on a test...
1
by: Dominic | last post by:
I'd like to tune the performance of my application in a web garden. Our server has dual processors. Is there any guideline to set this "maximum number of worker processes" for web garden? In my...
16
by: ondekoza | last post by:
Hello, I need to convert the string "FFFFFFFF" to a long. To convert this string I tried the following: >>> 0xffffffff -1 >>> 0xffffffffL 4294967295L OK, this is what I want, so I tried
3
by: ext | last post by:
"A "long" in C is an "int" in C#." Does this mean that whenever passing a parameter to a C function which expects a long type, the variable on C# side should be declared as int type? What if...
6
by: bananaguyc | last post by:
Okay, I'm running the following code in GCC 4.1.2: <stdio.h> int main(void) { long double test = 4.67e-4; printf("float: %f e-notation: %e\n", test, test); return 0; }
3
by: =?Utf-8?B?UGFvbG8=?= | last post by:
I'm getting this error message when running a LINQtoSQL query. My entity classes are as follows: public partial class Activity { #region Fields public DateTime Activity_Date { get; set; }
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.