19 messages in ru.sysoev.nginxRe: Is mod_php walking on its road?
FromSent OnAttachments
Steve ChuOct 23, 2007 2:01 am 
Aleksandar LazicOct 23, 2007 2:12 am 
Igor SysoevOct 23, 2007 2:15 am 
marc...@public.gmane.orgOct 23, 2007 2:24 am 
Alejandro VartabedianOct 23, 2007 2:42 am 
Manlio PerilloOct 23, 2007 2:46 am 
Igor SysoevOct 23, 2007 3:03 am 
Igor SysoevOct 23, 2007 3:05 am 
Manlio PerilloOct 23, 2007 3:27 am 
Steve ChuOct 23, 2007 3:51 am 
Alejandro VartabedianOct 23, 2007 4:03 am 
Manlio PerilloOct 23, 2007 4:05 am 
Steve ChuOct 23, 2007 7:13 pm 
Yusuf GoolamabbasOct 24, 2007 1:01 am 
Igor SysoevOct 24, 2007 3:14 am 
Steve ChuOct 24, 2007 8:22 am 
Thomas SeifertOct 24, 2007 8:50 am 
Igor SysoevOct 30, 2007 1:11 am 
Manlio PerilloOct 30, 2007 4:35 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: Is mod_php walking on its road?Actions...
From:Manlio Perillo (manl@public.gmane.org)
Date:Oct 23, 2007 2:46:25 am
List:ru.sysoev.nginx

Igor Sysoev ha scritto:

On Tue, Oct 23, 2007 at 05:02:09PM +0800, Steve Chu wrote:

Does anybody here have a plan or already be writing a nginx version mod_php that similar with apache's? If nobody does, we are try to write one.

I do not think that built-in nginx PHP will be better than Apache's one. For example, thttpd has PHP support, but all connections are blocked while PHP processes an request.

It should be possible to run the PHP code in a separate thread. This is what I'm planning to to with mod_wsgi, in order to support "legacy" applications.

Here is the idea: 1) mod_wsgi creates a pipe and register the file descriptor with the event module; it also creates a read event 2) mod_wsgi creates a worker thread (only one thread per worker process) where the Python code will be executed 3) when the request handler is called, mod_wsgi setups the read event, dispatches the "job" to the worker thread and returns control to Nginx 4) when the code execution is terminated, the thread writes a character to the pipe. This will calls an handler in the main thread that will retrieve the "job" result, sending it to the client. The "job" result is protected with a lock (the worker thread will wait until the lock is released by the main thread).