If you benefit from web2py hope you feel encouraged to pay it forward by contributing back to society in whatever form you choose!
Two Important Profiles for any Application:
  1. Speed
  2. Memory Usage
1.) Speed is easy to profile in the new versions of web2py:


python web2py.py -F profiler.log

2.) The easiest method I found to profile memory is as follows:

  • Install: https://github.com/fabianp/memory_profiler
    • pip install -U memory_profiler
    • easy_install -U memory_profiler
  • Run web2py:
  • python web2py.py
  • Determine the process running web2py:
  • ps -a
    • Find the process running CMD: python web2py.py
  • Run the following in python (via script or interpreter):
  • from memory_profiler import memory_usage
    import time
    while True:
         print memory_usage(WEBPY_PROCESS_ID, interval=.2, timeout=1)


It's not perfect, but it gives you an idea as you optimize your application.


Suggestions Welcomed!

Related slices

Comments (0)

Hosting graciously provided by:
Python Anywhere