Hi,
Back with a question (or two). I am testing the performance of our web2py 
app. To get to the root of what is happening, I executed uwsgi with one 
worker and straced the process. In the output, I see a lot of data like - 
"
stat("/var/www/web2py/gluon/ast", 0x7fff540a5050) = -1 ENOENT (No such file 
or directory)
open("/var/www/web2py/gluon/ast.so", O_RDONLY) = -1 ENOENT (No such file or 
directory)
open("/var/www/web2py/gluon/astmodule.so", O_RDONLY) = -1 ENOENT (No such 
file or directory)
open("/var/www/web2py/gluon/ast.py", O_RDONLY) = -1 ENOENT (No such file or 
directory)
open("/var/www/web2py/gluon/ast.pyc", O_RDONLY) = -1 ENOENT (No such file 
or directory)
..
Is this expected?

I also see a lot of stuff like - 
"stat("/var/www/web2py/applications/everest3/languages/my.py", 
{st_mode=S_IFREG|0775, st_size=8210, ...}) = 0
stat("/var/www/web2py/applications/everest3/languages/nl.py", 
{st_mode=S_IFREG|0664, st_size=16825, ...}) = 0
open("/var/www/web2py/applications/everest3/languages/nl.py", O_RDONLY) = 9
fstat(9, {st_mode=S_IFREG|0664, st_size=16825, ...}) = 0
flock(9, LOCK_SH)                       = 0
fstat(9, {st_mode=S_IFREG|0664, st_size=16825, ...}) = 0
lseek(9, 0, SEEK_CUR)                   = 0
fstat(9, {st_mode=S_IFREG|0664, st_size=16825, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7fdeee172000
lseek(9, 0, SEEK_CUR)                   = 0
read(9, "# coding: utf8\n{\n'!langcode!': 'nl',\n'!langname!': 
'Nederlands',\n'\"update\" is an optional expression like 
\"field1=\\'newvalue\\'\". You cannot update or delete the results of a 
JOIN': '\"update\" is an optional expression like 
\"field1=\\'newvalue\\'\". You cannot update or delete the results of a 
JOIN',\n'%(nrows)s records found': '%(nrows)s records gevonden',\n'%d days 
ago': '%d dagen geleden',\n'%d weeks ago': '%d weken gelden',\n'%s %%{row} 
deleted': '%s rijen verwijderd',\n'%s %%{row} updated': '%s rijen"..., 
16384) = 16384
read(9, "py': 'Welkom bij web2py',\n'Welcome to web2py!': 'Welkom bij 
web2py!',\n'Which called the function %s located in the file %s': 'Die 
functie %s aanriep en zich bevindt in het bestand %s',\n'YES': 'JA',\n'You 
are successfully running web2py': 'Je draait web2py succesvol',\n'You can 
modify this application and adapt it to your needs': 'Je kan deze 
applicatie aanpassen naar je eigen behoeften',\n'You visited the url %s': 
'Je bezocht de url %s',\n}\n", 4096) = 441"

Does all this happen for every request?
Can I remove many languages from the folder and reduce the 'overhead'?

On Wednesday, October 2, 2013 1:13:26 AM UTC+5:30, Niphlod wrote:
>
> web2py.py is the main wrapper for presenting the widget and starting the 
> rocket webserver (fine for development and small-sized intranets).
> In production, web2py.py is not used, because the actual web application 
> doesn't need a widget and runs on a separate "production-ready" webserver 
> (actually, it runs behind a webserver (in your case, nginx), that 
> communicates with uwsgi that is the daemon executing the python code and 
> passing to the webserver the response in "wsgi format").
>
> There are handlers for practically all webservers (look at the /handlers 
> dir), and in your particular case (uwsgi daemon "mode"), the code gets 
> executed in wsgihandler.py, that in turns calls gluon/main.py, the real 
> "executor" that "holds" all the logic for executing merely the web 
> application, without the "bells and whistles" of the "development mode".
>
> Sorry for the multiple quotes ^_^
>
> If anything remains unclear, please ask.
>
> On Tuesday, October 1, 2013 5:47:25 PM UTC+2, Jayadevan M wrote:
>>
>> Hi,
>> I followed the deployment recipe posted here - 
>>
>> https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-nginx-uwsgi-centos64.sh<https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fweb2py%2Fweb2py%2Fblob%2Fmaster%2Fscripts%2Fsetup-web2py-nginx-uwsgi-centos64.sh&sa=D&sntz=1&usg=AFQjCNHTY4qtthAmtf1_wrAL4xigTljnWw>
>> and it works fine. The thing is, I don't get how web2py in actually 
>> getting initialized. If I check the process tree, I see
>> nginx    3:18          \_ /opt/python/bin/uwsgi --ini web2py.ini
>> nginx    0:00              \_ /opt/python/bin/uwsgi --ini web2py.ini
>> nginx    0:00              \_ /opt/python/bin/uwsgi --ini web2py.ini
>> nginx    0:00              \_ /opt/python/bin/uwsgi --ini web2py.ini
>> nginx    0:00              \_ /opt/python/bin/uwsgi --ini web2py.ini
>> web2py.py is not getting called anywhere. Could someone please explain 
>> the execution sequence?
>> Thanks,
>> Jayadevan
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to