You should really have
db = DAL('postgres://name:password@localhost:5432/db',pool_size=20)
The reason is that client-server databases may set a max to number of
open connections and it takes time to perform the 3-way handshake to
establish a new connection at every http request. Without pooling you
may hit the max sooner than you should.
This will also make your app faster.
Massimo
On Jan 17, 1:39 pm, VP <[email protected]> wrote:
> Here it is with private information replaced with generic information.
>
> if request.env.web2py_runtime_gae: # if running on Google
> App Engine
> db = DAL('gae') # connect to Google
> BigTable
> session.connect(request, response, db = db) # and store sessions
> and tickets there
> else: # else use a normal
> relational database
> db = DAL('postgres://name:password@localhost:5432/db')
> # db = DAL('sqlite://storage.sqlite')
>
> On Jan 17, 1:19 pm, Massimo Di Pierro <[email protected]>
> wrote:
>
>
>
>
>
>
>
> > Are you using connection pooling? Can I see the line db = DAL(...)?
>
> > On Jan 16, 2:24 pm, VP <[email protected]> wrote:
>
> > > Kenneth (see post above) had the same problem with MySQL.
>
> > > On Jan 16, 3:55 am, ron_m <[email protected]> wrote:
>
> > > > Is there any chance to try another server based database such as MySQL.
> > > > Since SQLite did not exhibit a problem that is a valid data point but
> > > > it is
> > > > an embedded database so called directly by the web2py server code
> > > > instead of
> > > > using a driver. There is a possibility there is a problem with the
> > > > driver on
> > > > PostgreSQL if the connections are being reused in a pool. This is very
> > > > difficult to find without some further logging. I gather the page
> > > > request
> > > > you see failing as a user simply never completes. I saw this once while
> > > > testing the application but the loading is only myself running tests. I
> > > > use
> > > > PostgreSQL in this app but I also have a version that runs on MySQL
> > > > which
> > > > has only a connection string difference plus the content of the
> > > > databases
> > > > directory. Maybe I can try this tomorrow, it is almost 2 am here so I
> > > > don't
> > > > want to start something new right now. I just need to learn how to use
> > > > ab
> > > > which I take it isn't going to be much to figure out.