views:

27

answers:

2

I have 5 python cgi pages. I can navigate from one page to another. All pages get their data from the same database table just that they use different queries.

The problem is that the application as a whole is slow. Though they connect to the same database, each page creates a new handle every time I visit it and handles are not shared by the pages.

I want to improve performance.

Can I do that by setting up sessions for the user?

Suggestions/Advices are welcome.

Thanks

A: 

Django and Pylons are both frameworks that solve this problem quite nicely, namely by abstracting the DB-frontend integration. They are worth considering.

muckabout
+2  A: 

cgi requires a new interpreter to start up for each request, and then all the resources such as db connections to be acquired and released.

fastcgi or wsgi improve performance by allowing you to keep running the same process between requests

gnibbler