OK. I will use modwsgi group.
Answers to your questions:
My wsgi program executes "pypy-c" program in separate process.
I was trying to use both embedded and daemon modes. Config is very simple:
<VirtualHost *>
ServerName py.sandbox.lt
ServerAdmin dal...@sandbox.lt
ServerSignature Off
AddDefaultCharset utf-8
CustomLog /var/log/apache2/py-access.log combined
ErrorLog /var/log/apache2/py-error.log
LogLevel info
WSGIScriptAlias / /home/dalius/wsgi/py.wsgi
</VirtualHost>
py.wsgi looks like this:
from pypysandboxserver import PyPyApp
application = PyPyApp()
That's very pure and basic wsgi application. I will try version 2.X with
daemon mode and will report result.
Thank you for very quick answer.
Regards,
Dalius
Graham Dumpleton wrote:
> Is the PyPy stuff run within the Apache/mod_wsgi process, or does it
> execute as a separate process form the Apache/mod_wsgi process which
> you then communicate with? Further, are you using embedded mode or
> daemon mode of mod_wsgi?
>
> If the process is being exec'd and using daemon mode, then probably:
>
> http://code.google.com/p/modwsgi/issues/detail?id=87
>
> Try patch or just use version from 2.X branch out of subversion:
>
> http://code.google.com/p/modwsgi/wiki/ChangesInVersion0204
>
> If not, will need to be clearer about mod_wsgi configuration being
> used and whether or not PyPy stuff is a separate process.
>
> BTW, appreciated if can use mod_wsgi list on Google Groups. That was
> conversation archived and answer can help someone else.
>
> Graham
>
> 2009/2/23 Dalius Dobravolskas <dalius.do...@gmail.com>:
>
>> Hello, Graham,
>>
>> I have problem with mod_wsgi (or most probably with Apache) and I think you
>> are the person who could answer me.
>>
>> I was experimenting with PyPy sandboxing and have written simple WSGI
>> program (see attachment if that helps to understand the problem). That
>> program basically does very simple thing: you write python code and program
>> executes it (using PyPy sandboxed interpreter). That's it. You can look at
>> this program running here http://py.sandbox.lt (behind mod_wsgi of course
>> ;-)).
>>
>> My problem is following: since I don't want my server to be abused or reused
>> as cheap computational power (that server runs several websites) I have
>> limited process to 5 seconds. In PyPy code process is terminated with
>> SIGTERM. The problem is that SIGTERM does not terminate PyPy process. I have
>> checked I can't kill process with simple kill command as well. Process can
>> be terminated only with SIGKILL.
>>
>> I have modified the code to use SIGKILL and that fits my needs but...
>> 1) I don't care too much here is process is SIGTERMed or SIGKILLed but maybe
>> I should?
>> 2) Is there way to use SIGTERM here?
>>
>> I have found some information in mod_wsgi documenation about signals and
>> Apache and tried experimenting with some mod_wsgi options but that does not
>> make any difference.
>>
>> Regards,
>> Dalius
>>
>>
--
Dalius
http://blog.sandbox.lt
While I think of something more intelligent to say, in your code you have:
page = """ ....."""
return page
Thus, returning string from WSGI application. This is very
inefficient. Result should be an iterable, which string qualifies as,
but end result will be that single character is flush at a time. Use
instead:
return [page]
Graham
Graham
2009/2/23 Graham Dumpleton <graham.d...@gmail.com>:
If it works on daemon mode, would expect it to work in embedded mode.
Which MPM is Apache configured to use? Are you running other web
application modules in Apache such as PHP?
Graham