Original Post
I'm starting to develop multiplayer games, for now I'm working on simple things, like a extension dll.
My DLL Game Logic:

I am developing in Pascal, using ADO to connect to SQL, and Client / ServerSocket for TCP Connections in mode ctNonBlocking / stNonBlocking.
The above structure is used in a DLL which acts as an extension of a game, and works as follows:
1 - (Client<->Server->SocketThread->LoginThread) The dll is loaded by executable and connects to the server, then the player performs login to the server (2 Querys).
2 - (Client<->Server->SocketThread->GlobalInfoThread) After logging in, the client requests some information and the server returns data (7 Querys).
3 - (Client<->Server->SocketThread->RetraceInfoThread) When you open a window in question, the DLL sends a message to the server requesting data to update the client (7 Querys), that used, because items can be upgraded by purchasing through a browser.
4 - (Client<->Server->SocketThread->OpenPrizeThread) Players open a chest and the server return the prize (9 Querys).
Problems:
1 - Upon arrival at about ~ 300K queries, the connection to the database seems to be destroyed, not sure.
2 - I'd like some tips to improve my structure, because i think it's a bad design.
3 - The SQLServer (2000) ends up consuming somewhere around 1.5GB ram to get around the ~ 300k queries, and the server is slow...
Remarks:
My DLL Game Logic:

I am developing in Pascal, using ADO to connect to SQL, and Client / ServerSocket for TCP Connections in mode ctNonBlocking / stNonBlocking.
The above structure is used in a DLL which acts as an extension of a game, and works as follows:
1 - (Client<->Server->SocketThread->LoginThread) The dll is loaded by executable and connects to the server, then the player performs login to the server (2 Querys).
2 - (Client<->Server->SocketThread->GlobalInfoThread) After logging in, the client requests some information and the server returns data (7 Querys).
3 - (Client<->Server->SocketThread->RetraceInfoThread) When you open a window in question, the DLL sends a message to the server requesting data to update the client (7 Querys), that used, because items can be upgraded by purchasing through a browser.
4 - (Client<->Server->SocketThread->OpenPrizeThread) Players open a chest and the server return the prize (9 Querys).
Problems:
1 - Upon arrival at about ~ 300K queries, the connection to the database seems to be destroyed, not sure.
2 - I'd like some tips to improve my structure, because i think it's a bad design.
3 - The SQLServer (2000) ends up consuming somewhere around 1.5GB ram to get around the ~ 300k queries, and the server is slow...
Remarks:
- There are 4 threads calling SocketThread (Login, GlobalInfo, RetraceInfo, OpenBag), each with its connection to the database through a thread.
- I am using Query objects in the CursorLocation: adoUseServer to UPDATE / INSERT and the SELECT to adoUseClient.
- The average of people connected to the server through this dll is 150.
- Not sure if the logic posted, is problematic, since it was previously using a single database connection for all threads, and I think I have not done a full test with this logic.
- I will do a full test posted to this logic, with upgrade on SQLServer (2005 SP3) and upgrade in server hardwares, anyway, i would like to help me.