Connections not getting closed?

4 views
Skip to first unread message

travep

unread,
Apr 11, 2008, 8:56:29 AM4/11/08
to Php Object Generator
I use POG in a shared hosting environment that (according to host) has
150 database conneections at it's disposal. The site worked fine
during testing but now it will experience times when the page requests
never come back. It really sounds like database connections are
remaining open. I use only the POG methods for data access (GetList,
Get, Save, etc). I notice that POG relies on the connections to be
automatically closed upon script termination:

http://groups.google.com/group/Php-Object-Generator/browse_thread/thread/9abe26855bb8f087/68deefd83c8f0b50?lnk=gst&q=close#68deefd83c8f0b50

Does anyone have any ideas on how I can track down my issues? I am
not seeing any issues logged in the error.log - but then if it's just
spinning waiting on a connection that would not surprise me. The site
has been ramping up the number of users and we saw yesterday was maybe
50 for the whole day. There's not much data in the database and it
seems to be pretty well indexed. Has anyone had issues like this or
does anyone have ideas on what I can look at?

Travis

Joel

unread,
Apr 11, 2008, 10:55:27 AM4/11/08
to Php Object Generator
50 is quite light. There is definitely something else going on there.
could you post your site url? any other details that would helpme
debug it for you?

Leaving connections open in itself is actually better for performance
than closing and reopening each time you want to do a query. The
reason i'm puzzled is that you're using 3.0d which is the fastest
we've got...

On Apr 11, 6:56 am, travep <trave...@excite.com> wrote:
> I use POG in a shared hosting environment that (according to host) has
> 150 database conneections at it's disposal.  The site worked fine
> during testing but now it will experience times when the page requests
> never come back.  It really sounds like database connections are
> remaining open.  I use only the POG methods for data access (GetList,
> Get, Save, etc).  I notice that POG relies on the connections to be
> automatically closed upon script termination:
>
> http://groups.google.com/group/Php-Object-Generator/browse_thread/thr...

andy law (RI)

unread,
Apr 11, 2008, 11:04:23 AM4/11/08
to Php-Object...@googlegroups.com

> 50 is quite light. There is definitely something else going on there.
> could you post your site url? any other details that would
> helpme debug it for you?


There's nothing in your original description of the problem that nails
it down as a POG problem per se. Do static pages return OK - although
even that isn't proof?

Have you tried writing log messages before and after POG code calls to
prove that the server is getting that far.

Can you log in with shell access to your host and look at connections
and processes on that machine?

Does the mysql server behave itself when you hit it either on the
command line or from the cpanel interface (or whatever your host gives
you)?

Later,

Andy

-------------
Yada, yada, yada...

Roslin Institute is a company limited by guarantee, registered in
Scotland (registered number SC157100) and a Scottish Charity (registered
number SC023592). Our registered office is at Roslin, Midlothian, EH25
9PS. VAT registration number 847380013.

The information contained in this e-mail (including any attachments) is
confidential and is intended for the use of the addressee only. The
opinions expressed within this e-mail (including any attachments) are
the opinions of the sender and do not necessarily constitute those of
Roslin Institute (Edinburgh) ("the Institute") unless specifically
stated by a sender who is duly authorised to do so on behalf of the
Institute.

travep

unread,
Apr 11, 2008, 1:35:45 PM4/11/08
to Php Object Generator

Thanks for the responses (and sorry about my double question - I'm
new).

Joel,

I can't really show the site b/c it's an internal app for a client.
Design-wise, for most pages, I'm using a "control" page to do database
and control logic and then I'm forwarding it to a "view" page. I'm
used to doing java work with Struts so I think along those lines. At
any rate, I'm unable to direct you to the site.

Another thing I'm doing (not really advisable but shouldn't be a
problem here) is that I have established no parent/child relationships
through the mapping. It's a relatively small system (at least it
started that way) so I didn't take the time to learn about
establishing relationships in the domain objects to match the
database...I usually just do multiple queries.

Andy, I agree that this is definitely not directly tied to a POG
problem. I look at the generated class.database file and it looks
quite straght-forward. I will ask about the static pages although I'm
not sure that my user contact would really have noticed that as he's
probably only accessing the dynamic stuff (98% of the system) when it
happens. When it occurs again, I'll have him pay attention to it.

I have not tried to log messages yet. However, that seems easy enough
so I can try but the problem is not related to a specific page so that
might be difficult to tack down...but it would be worth a try.

Unfortunately, I have no access to the shell with this account. I am
at the mercy of the "experts" - which, in their defense, suggested the
logical db connection thing...at least, that is what it sounds like.

As for your final question, Andy, I'll suggest that next time there's
a problem, that we try to connect directly to the myphpadmin app to
see if the db is acting strangely when the application is taken out of
the mix.

I will post answers to these questions immediately as I get them or a
solution if one falls into my lap :-) The difficulty is that it
seems to happen a couple of times a week for only a couple of hours at
a time...at least that's when we notice it.

Thanks for your input...

Travis

On Apr 11, 10:04 am, "andy law \(RI\)" <andy....@roslin.ed.ac.uk>
wrote:

travep

unread,
Apr 30, 2008, 9:13:09 AM4/30/08
to Php Object Generator
All, I just wanted to follow up and close this issue. I have come to
believe that it's not really an issue. After logging the issed with
the hosting facility, I suspect that the guy jacked up the number of
available database connections and didn't tell us (not so nice, IMO).
The reason is that since we escalated it with them, the problem has
not resurfaced even though there are 30% more users now than there
were then. I suspect that in these shared environments, they probably
start you off on a low number of db connections and then make you ask
for more when you need them to keep from dedicating more connections
than needed before traffic patterns are established. Or, it's
possible, that the setup just under-allocated the number of
connections in error. At any rate, we haven't seen the problem again
and I've made no changes.

I just wanted to indicate a "resolution" for anyone that's
interested. Thanks again for the input...

Travis
> > Institute.- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages