Groups | Blog | Home
all groups > sql server (alternate) > july 2003 >

sql server (alternate) : A Game Company in Trouble


BlackHawke
7/17/2003 6:50:28 PM
My Name is Nick Soutter, I am the owner of a small game company, Aepox Games
(We're in the middle of a name change from "Lamar Games"),
www.lamargames.net.



Our first commercial game, Andromeda Online (www.andromedaonline.net) is
going into beta soon. It runs on an evaluation edition of SQL Server 2000
(our intention is, when it launches, we earn the money to buy a copy before
the evaluation expires).



We have been testing Andromeda Online, and found that saves to the database
take about 10 seconds (we were anticipating less than 1). We felt we need
somebody experienced in optimizing sql databases to help us optimize the
database, and get it running in the best method for our particular
application.



Our program accesses the database in Java, and people with understanding in
how to optimize java connections would be a tremendous help.



My company is small, and we honestly cant afford much. Everybody on this
project, from the sound guys to the graphic artist, has worked for 1/10 to
1/100 of the value of the job. We're simply a starting company looking for
dedicated people who are willing to work more for credit than money.



We can offer credit on our website
(http://www.andromedaonline.net/credits.html) to anybody who helps us, but
little more (maybe $100, but we're very over budget, and in desperate need
of help). Because of how we intend the game to run (with maybe 100-200
concurrent games running online), a 10 second save time is simply
unacceptable.



Anybody who would be willing to help us, please send a resume to
help@andromedaonline.net. Experience would be nice, but not a requirement.
We're looking for someone who can talk with our programmer about the types
of calls made to our SQL database, and then can log into the DB and optimize
it to run as fast as possible considering our specific needs.



Thank you for your time.



Nick Soutter

Aepox (Lamar) Games

Chris Smith
7/17/2003 10:37:07 PM
[quoted text, click to view]

Some simple advice, without knowing anything about your application.
It's highly unlikely that the problem is related to your use of Java-
based interfaces to the database. The problem is almost certainly with
the SQL that you are running, and is independent of the means of issuing
that SQL to the database itself. An exception applies, though, if
you're using some high-level abstraction like an OR mapper that
generates the SQL for you. Is this hand-written JDBC and SQL, or
something more complex?

[quoted text, click to view]

Given your financial constraints, it would perhaps be more prudent for
you to take advantage of the advice freely offered on this newsgroup.
You'd be expected to take part in finding the solution, by for example
putting together test cases and doing some troubleshooting, but if you
have a real question about a factual or difficult issue, someone will
almost certainly jump in to help.

A good place to start is to look over the statements that are issued in
a save. Many databases have a logging mode that can capture this info,
but if your database doesn't have such a mode or flag, you could do it
from the application or with a filter JDBC driver. So to start with the
easiest solution, which database are you using?

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
Erland Sommarskog
7/18/2003 8:26:15 AM
BlackHawke (blackhawke@legacygames.net) writes:
[quoted text, click to view]

When did you download this evaluation edition? Beware that the original
evaluation edition is vulnerable for the Slammer worm. If you go to
http://www.microsoft.com/sql you can obtain a version of the Evaluation
Edition that is Slammer-safe.

[quoted text, click to view]

What exactly are you saving? Does it take 10 seconds to save a single
row to the database? Or does it take 10 seconds to save a player's
entire game?

The latter could mean a whole lot calls to SQL Server to insert data.
If all operations are through INSERT statements sent from the Java
code, there is a whole lot to win by using stored procedures. For even
higher speed, you could construct an XML document, and then unpack that on
the SQL Server side with OPENXML(). You save a lot of network roundtrips
that way.


--
Erland Sommarskog, SQL Server MVP, sommar@algonet.se

Books Online for SQL Server SP3 at
Allan Mitchell
7/18/2003 12:55:26 PM
To add to everybody else's statements.

Run Profiler against the DB and see exactly what is being sent. If you can
get statements out then you can look at the execution plans and perhaps that
will point out a reason for the preceived slowness.



--

----------------------------
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org



[quoted text, click to view]

Phil Britton
7/21/2003 4:00:47 PM
"BlackHawke" <blackhawke@legacygames.net> writes:

[quoted text, click to view]

You need to find out what it is doing during these 10 seconds. Run
some kind of profiling on your progarm to see what it is doing. i.e
Opening JDBC connection (if it's doing that), getting a connection
from a connection pool (you really should be doing something like
that), sending sql statement to server, waiting for server to complete
the statement,closing (or releasing) the dabase connection. When you've found
out how much time these various things are taking then you can see which parts
you need to optimise.

[quoted text, click to view]

Use pooling so that you don't have to open a connection every time you
want to access the database

If your problem is tha database then you'll more than likely get
improvements by looking at ths SQL you are using and seing if you can
rephrase your statement in a btter way (i.e. have a look at any joins
you are using and whic table is the driving table in a join, make sure
that any table lookups are using indexes etc. ) You'll fidn that any
optimistaion you make in this area will make much more of a difference
than any tweaking of database parameters that you can do.

[quoted text, click to view]

Good luck with your product, I hope it works out so that all the guys
who've been working for little money can start getting very lareg
pay-checks


[quoted text, click to view]

You can have this info for nothing, enjoy :-).

Here's some more advice for free. If you've got nobody on your team
who knows about databases and their design your design is probably a
bit if a mess. It will then probably take a bit more than some tunig
to sort out your problems. Just have a look at posts in some of the
Oracle newsgroups to get some idea of what professional database
people think about letting java programmers loose on databases :-)


[quoted text, click to view]

As someone else posted , get one of the programmers to come on here, but
get him/her to read the above first and come ready with answers to the
questions above and then getting answers back will be a lot quicker,

cheers

Phil


--

n0t999 NO[at]SPAM netscape.net
7/22/2003 4:22:28 AM
[quoted text, click to view]

Hi

Have noted what you guys are trying to do, and as a DBA and
ex-developer, thought I'd try and help point you in the right
direction. From the sounds of what you are doing and your tight
budget, I guess you're not running the SQL DB on a powerful,
multi-processor, multi-GB RAM, multi-SCSI Array system. If this is
the case and you're system is modest, then there isn't a great deal
you can do for tuning the SQL Server itself.

As someone mentioned earlier, you're more likely to get better
performance by looking at the way you do your SQL coding - think there
is a quote in the O'Reilly T-SQL Programming book, that says
"...optimising SQL Server settings only accounts for around 20% of
performance improvement, 80% is obtained by tuning your SQL code...".
Do you make use of Stored Procedures? This will help, as compared to
using SQL code from the Client. Don't use SQL Server Cursors - make
sure your code is Set-based (what RDBMS's are designed to run best
with). Look into the Metadata structure - are there loads of joins?
If so, consider denormalising and test to see if this gives an
improvement. Is it the SQL Server that is slow to update? or is it
the connection/network link? You might find that the actual writing
to the DB is quick and the bottleneck is elsewhere.

HTH

AddThis Social Bookmark Button