Can you post some code to review?

-Jim

On Thursday, November 7, 2013 4:45:25 AM UTC-6, Arto Huhtala wrote:
>
> Hi,
>
> I am developing a test application with web2py to test database 
> performance. The idea is to see how long does it take to fetch information 
> from database on different loads.
> So far I have tested with SQLite and I've made test databases of size ~1K 
> and 10K.
> Now I'm trying to test a ~100K and ~1M databases, but once I have 
> populated the database to ~100K, the app is really slow. It takes forever 
> to load the plain index page.
> I tried to solve this by using PostgreSQL instead but still it takes 
> forever to load the index page. What gives?
>
> I have been looking advice on improving the performance and some have come 
> across (Deployment recipes from web2py book), but I also have questions 
> concerning them:
>
>
>    - Minimize the code in models: do not define functions there, define 
>    functions in the controllers that need them or - even better - define 
>    functions in modules, import them and use those functions as needed.
>
> Q: I need to manipulate database contents in separate functions but if I 
> place the code to a separate module it can't connect to the database.
> How can I access the database from separate module? Should I use the same 
> connection string in them as used in model files (db.py)?
>
>
>    - Do not put many functions in the same controller but use many 
>    controllers with few functions.
>
> Q: Do I need to create a view for every separate controller? Or can I use 
> the same view in many controllers?
>
> - Use indexes
> Q: Should indexes be defined in model file after defining tables or 
> somewhere else? So far I have found no difference in performance when 
> defining indexes.
>
> Thanks!
>
>

-- 
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