Search found 18 matches

by icepick
24 Jun 2009, 17:55
Forum: Server Side Extension Development
Topic: DatabaseManager and connection pooling
Replies: 17
Views: 22965

Start a separate thread in init() and just do queries from a timer in that thread?
Yes, correct.

Also, since DbManager uses a connection pool, will this prevent other connections in the pool from going stale as well?
Yes, I think so.

Seems to be working so far... I'm sure I'll be back here if ...
by icepick
23 Jun 2009, 16:37
Forum: Server Side Extension Development
Topic: DatabaseManager and connection pooling
Replies: 17
Views: 22965

But it seems that if no queries are done for about an hour or so, the next query will take at least a few minutes, which is totally unacceptable
Ok I see. In this case it is possible that the connection between SFS and the DB becomes stale.

In order to avoid this you can simply keep it alive from ...
by icepick
23 Jun 2009, 15:19
Forum: Server Side Extension Development
Topic: DatabaseManager and connection pooling
Replies: 17
Views: 22965

Again, I think we're not looking at the right problem.
Why would a query take so long? 1 minute? whoa :shock:
I think the problem here is the database response time not the timeout.

Is the database overloaded or are you using monster queries? :)

I'm pretty sure the holdup is networking/firewall ...
by icepick
23 Jun 2009, 13:42
Forum: Server Side Extension Development
Topic: DatabaseManager and connection pooling
Replies: 17
Views: 22965

The problem is that the extension is single threaded and scalability is lost.
Since database calls can hold the extension thread for a long time (ms or even seconds) when compared to other calls (nanoseconds) you will to resize the pool of threads used by the ExtensionHandler stage of the server ...
by icepick
23 Jun 2009, 04:12
Forum: Server Side Extension Development
Topic: DatabaseManager and connection pooling
Replies: 17
Views: 22965

Bringing this thread back from the dead... Lately these timeouts have become more frequent, although they are extremely unpredictable.

I added more logging statements to the extension and the database queries are hanging the extension for up to 14 minutes at a time! Although this happens ...
by icepick
24 Apr 2009, 23:58
Forum: Server Side Extension Development
Topic: DatabaseManager and connection pooling
Replies: 17
Views: 22965

You probably have an extension scalability problem due to the many database accesses.
Extensions are by default handled by a single thread, but high traffic on the database usually requires that you adjust the ExtensionHandler to work with a larger pool of threads.

http://www.smartfoxserver.com ...
by icepick
23 Apr 2009, 22:59
Forum: Server Side Extension Development
Topic: DatabaseManager and connection pooling
Replies: 17
Views: 22965

The timeouts are persisting, although I haven't seen any "pool exhausted" messages since. Anything else you can think of to minimize or help debug the timeouts?

It may be a firewall issue as well, I am looking into that.
by icepick
23 Apr 2009, 16:30
Forum: Server Side Extension Development
Topic: DatabaseManager and connection pooling
Replies: 17
Views: 22965

Lapo wrote:Yep, that will help a lot
Thanks Lapo, I will try that. Your customer support is excellent, by the way!
by icepick
23 Apr 2009, 14:45
Forum: Server Side Extension Development
Topic: DatabaseManager and connection pooling
Replies: 17
Views: 22965

DbManager could not retrive a connection. org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted

Restarting smartfox fixed that, but I'm wondering why it occurred and what we can do to prevent it from happening again.

You can simply configure your DatabaseManager to ...
by icepick
21 Apr 2009, 20:36
Forum: Server Side Extension Development
Topic: DatabaseManager and connection pooling
Replies: 17
Views: 22965

Regarding the socket timeouts, I should also mention that while our database and smartfox are not on the same server, they are in the same data center (ping time is <1ms). It works without timing out 99% of the time.
by icepick
21 Apr 2009, 16:46
Forum: Server Side Extension Development
Topic: DatabaseManager and connection pooling
Replies: 17
Views: 22965

DatabaseManager and connection pooling

Hi,
We have a zone-level extension and while it has been working fine, we have been seeing some database-related issues in the last few days.

Earlier today, our extension could not execute any queries to the database, with the following error in the SFS logs:

DbManager could not retrive a ...
by icepick
18 Mar 2009, 23:27
Forum: Server Side Extension Development
Topic: Python documentation is not up to date :)
Replies: 18
Views: 25811

I wouldn't think a shebang line or comment would be necessary, but my Python experience only goes back to 2.3, so maybe it is a 2.2 or Jython restriction. Either way, it's working for me now with just a comment there.

hmmm normaly you have to set at the first line the right script interpreter ...
by icepick
18 Mar 2009, 22:11
Forum: Server Side Extension Development
Topic: Python documentation is not up to date :)
Replies: 18
Views: 25811

Very weird... I added a comment at the top of the python module, and now it's working

So this works...

1 #foo
2 import os, sys
3 sys.path.append(os.getcwd())


...but this does not...

1 import os, sys
2 sys.path.append(os.getcwd())


Hope that works for you as well, Thierry! Lapo, any ...
by icepick
18 Mar 2009, 21:56
Forum: Server Side Extension Development
Topic: Python documentation is not up to date :)
Replies: 18
Views: 25811

ThierryStiegler wrote:I get the same issue, I use the latest version 1.6.5.
Glad it's not just me! Or maybe not, since this probably indicates that it's more difficult to fix. I am using 1.6.2, was going to upgrade to 1.6.5 but looks like that won't solve it.
by icepick
17 Mar 2009, 23:30
Forum: Server Side Extension Development
Topic: Python documentation is not up to date :)
Replies: 18
Views: 25811

Yes, that's correct.
Actually the import code should be done outside of the init() method.
I will make sure that the example is updated.

Thanks for noticing

I'm trying to manipulate my path in a python module. I do the following at the top of my python module, outside of the init() function ...