A nice thing of the new profiler is that does not require serialization of
each single request handling loop, you can use parallel (forked or
threaded) task without conflicts.
Watch out! the directory pointed by -F is going to fill up quickly on a
busy site!

mic


2013/9/24 Niphlod <niph...@gmail.com>

> socket is the responsible for every network communication, including for
> the most part database connection and depending on the handler (and on the
> debug) also for http traffic.
> If you debug by ncalls, you aren't able to see who calls what ^_^
>
> From 2.6.0 web2py supports dumping the profile of web2py only code into a
> dir, that you can later inspect with runsnakerun (really the best tool for
> the job of identifying what slows you down).
>
> web2py.py -a password -F folder
>
> will dump files into folder/
>
> If you're using handlers, then configure them appropriately (it's the
> profiler_dir argument)
>
>
>
>
> On Tuesday, September 24, 2013 10:23:52 PM UTC+2, Saurabh Kumar wrote:
>>
>> My website some times randomly slows down and recovers on its own. I used
>> a profiler to profile one of the controllers  and found out that
>> /usr/lib/python2.7/socket.py:**336(read) is being called 12704 times
>> taking 14.5 seconds. What could be the possible problem to cause this?
>>
>> root@dev:/profile_dumps# python check_Stats.py chat-20130924T201149.prof
>>          660623 function calls (648153 primitive calls) in 22.573 seconds
>>
>>    Ordered by: internal time, call count
>>    List reduced from 184 to 20 due to restriction <20>
>>
>>    ncalls  tottime  percall  cumtime  percall filename:lineno(function)
>>     12704   14.564    0.001   14.564    0.001
>> /usr/lib/python2.7/socket.py:**336(read)
>>      6352    1.579    0.000   16.289    0.003 /home/www-data/web2py/gluon/
>> **contrib/pymysql/connections.**py:215(__recv_packet)
>>       313    1.000    0.003    1.000    0.003
>> /usr/lib/python2.7/socket.py:**292(flush)
>>     94803    0.797    0.000    1.668    0.000 /home/www-data/web2py/gluon/
>> **contrib/pymysql/connections.**py:238(read)
>>       301    0.593    0.002    1.079    0.004 /home/www-data/web2py/gluon/
>> **dal.py:2005(parse)
>>    104734    0.525    0.000    0.525    0.000 /home/www-data/web2py/gluon/
>> **contrib/pymysql/connections.**py:253(advance)
>>     94803    0.427    0.000    0.427    0.000 /home/www-data/web2py/gluon/
>> **contrib/pymysql/connections.**py:267(peek)
>>     59543    0.413    0.000    0.413    0.000 /home/www-data/web2py/gluon/
>> **contrib/pymysql/util.py:3(**byte2int)
>>      4965    0.311    0.000    2.412    0.000 /home/www-data/web2py/gluon/
>> **contrib/pymysql/connections.**py:358(__parse_field_**descriptor)
>>     34897    0.219    0.000    1.157    0.000 /home/www-data/web2py/gluon/
>> **contrib/pymysql/connections.**py:291(read_length_coded_**binary)
>>     34895    0.195    0.000    1.923    0.000 /home/www-data/web2py/gluon/
>> **contrib/pymysql/connections.**py:310(read_length_coded_**string)
>>       301    0.154    0.001    0.350    0.001 /home/www-data/web2py/gluon/
>> **dal.py:1500(_select)
>>      8696    0.120    0.000    0.120    0.000 /home/www-data/web2py/gluon/
>> **dal.py:9896(__init__)
>>     14229    0.100    0.000    0.100    0.000 /home/www-data/web2py/gluon/
>> **dal.py:6756(__setitem__)
>> 11101/572    0.099    0.000   19.258    0.034 /home/www-data/web2py/gluon/
>> **dal.py:8247(__getitem__)
>> 10889/10233    0.090    0.000    0.101    0.000
>> /home/www-data/web2py/gluon/**dal.py:1347(expand)
>>       301    0.079    0.000   22.242    0.074 /home/www-data/web2py/gluon/
>> **dal.py:9763(select)
>>      5094    0.075    0.000    0.091    0.000 /home/www-data/web2py/gluon/
>> **dal.py:1862(parse_value)
>>      6352    0.073    0.000   16.362    0.003 /home/www-data/web2py/gluon/
>> **contrib/pymysql/connections.**py:210(__init__)
>>      4965    0.070    0.000   14.483    0.003 /home/www-data/web2py/gluon/
>> **contrib/pymysql/connections.**py:354(__init__)
>>
>  --
> 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 web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to