Welcome to RaGEZONE - MMORPG Development Forums (sponsored by tfn.gr) Mark forums read | View Forum Leaders
RaGEZONE - MMORPG Development Forums (sponsored by tfn.gr)

Habbo Development Discuss, [DEV] Holograph Emulator - Total Database Pooling at Habbo Hotel forum; Holograph Emulator - Total Database Pooling So, you may be wondering what DB Pooling is OR if you already do ...




Reply
Thread Tools
[DEV] Holograph Emulator - Total Database Pooling
 
 
Total Database Pooling

Rank: Member


Reply With Quote
 
Join Date: Aug 2006
Location: Some place in england
Posts: 286
10-31-2008, 12:02 AM
 

Holograph Emulator - Total Database Pooling

So, you may be wondering what DB Pooling is OR if you already do why is it diffrent from MYCHEMICALSELF's.
Let me start by saying a little about MYCHEMICALSELF's...
MYCHEMICALSELF's source opens and closes a connection every time it does a query, that can be over 100 open and closes per second, which can lead to crashing of MySQL knocking out the CMS aswell.

Now mine:
My DB Pooling puts mutliple querys into one query and mutliple querys into one connection.
It uses a connection based off Nillus's Woodpecker which is being used for the offical RageZONE retro.
This will cut down the load on the MySQL server and SHOULD speed up the game.

Now it does have bugs (after all I rewrote a huge amount of code) so I will need debug hotels to help.
If you are intrested in helping fix bugs in this source and have Database errors alot please send me a PM in this format:
Quote:
Hotel Name:
Average Users at one time:
C# Experience:
How frequently does your database crash:
Here is a list of the current testing hotels:
Code:
Test hotels to find: 1

Test Hotel 1: Habbz Hotel 
Test Hotel 2: Nabbo Hotel 
Test Hotel 3: Habbo Hotel
Test Hotel 4: Yuraka Hotel
Test Hotel 5: -
If your hotel is accepted you will be sent a link to the latest server (Which will be updated) and you will be told some important details on reporting errors

Once I feel the server is stable enough to be released it will be.


Have I forgot anything... don't think so (I am writing this for the second time )

Thanks, I will keep you updated!

Latest news 06-11-2008:
Will be released very shortly (For public testing purposes)

The above is old as I do not require test hotels anymore.

Public Release

Space: [Only Registered and Activated Users Can See Links. Click Here To Register...]
SVN: [Only Registered and Activated Users Can See Links. Click Here To Register...]

You will need MySQL Connector Net to run. The source was built for 5.2.3 how ever it should run later versions.
[Only Registered and Activated Users Can See Links. Click Here To Register...]
Go there and download the Windows Binaries and install :)

When you run it I recommend you go in Core.cs and edit:
PHP Code:
public static string serverVersion "Pooling Server Version 1.500 (DB Pooling test)"
to something more suited to your hotel like so:
PHP Code:
public static string serverVersion "Habbz Hotel Version 1.701"
I have not included a .sql file as it is not needed.

I removed the Pooling in the connection string as it would leak them for some reason.
You will also find that all database connection definitions have a number, this is not needed it was used for testing.

I also added a half working crappy bed lay fix (I was bored).

Enjoy, once this is stable enough I will work on a R25 source.

Last edited by cecer1; 12-12-2008 at 04:00 PM.
 
 
permalink
 

RaGEZONE is proudly sponsored by
 
Expect the Unexpected

Rank: Member


Reply With Quote
 
Join Date: Apr 2008
Location: Australia
Posts: 637
10-31-2008, 06:42 AM
 
What is wrong with you people, the database is fine how it is there is NO 100% CPU usage anymore, so quit wasting your time. From what i have seen database pooling only creates error after error.

EDIT: From what Nillus has said i guess i agree, but from my pooling experience nothing really worked.

Last edited by Rip-Curl; 11-02-2008 at 07:52 AM.
 
 
permalink
 

 
Hakuna Matata, bitches!

Rank: Moderator


Reply With Quote
Blog Entries: 5
 
Join Date: Dec 2007
Location: new holland
Posts: 4,695
10-31-2008, 07:19 AM
 
Well to be honest I don't know why I accepted this thread if you guys can't use it properly then this thread will eventually get closed and you can go back to the other thread.
 
 
permalink
 


 
Don Q Crystal + CocaCola

Rank: Subscriber


Reply With Quote
 
Join Date: Feb 2008
Location: South Side
Posts: 1,425
10-31-2008, 08:32 AM
 
How can you base it on Woodpecker? If you've never seen the source 8) maybe basing it on the IDEA of what woodpecker does, and no server can ever do it like woodpecker, and fyi woodpecker doesn't do it anyway like how you just described your method 8)
 
 
permalink
 

 
Holograph Developer

Rank: Member


Reply With Quote
 
Join Date: Aug 2007
Location: Cardiff, Wales
Posts: 1,103
10-31-2008, 08:54 AM
 
Quote: Originally Posted by Moogly View Post
How can you base it on Woodpecker? If you've never seen the source 8) maybe basing it on the IDEA of what woodpecker does, and no server can ever do it like woodpecker, and fyi woodpecker doesn't do it anyway like how you just described your method 8)
Nillus released his pooling source somewhere in the Holograph thread.
I expect he is basing it on that.
 
 
permalink
 

 
The mofo'ing Woodpeckah

Rank: Alpha Member


Reply With Quote
 
Join Date: Feb 2007
Location: The Netherlands
Posts: 3,428
10-31-2008, 08:55 AM
 
Quote: Originally Posted by Moogly View Post
How can you base it on Woodpecker? If you've never seen the source 8) maybe basing it on the IDEA of what woodpecker does, and no server can ever do it like woodpecker, and fyi woodpecker doesn't do it anyway like how you just described your method 8)
I have sent him Woodpecker.Storage.Database class. ;P

And I don't know what's up with you people above talking that this is 'useless' etc, well to be honest I have still coded Holograph more than any of you together, and I know where it's 'bugs' and 'weaknesses' are, and the database connection is one major weakness of it, that's why I spent alot of time on it in Woodpecker.
I appreciate the help from someone who also applies these changes in Holo a lot.
I've seen people's 'pooling implementations' before, but they were, as Cecer already said, nothing more than opening and closing the database connection for EVERY SINGLE QUERY, and then there's also no pooling at all since there are no 'Max Pool Size' parameters etc in the connection string.

To make a proper database system you have to rewrite all your queries, in Woodpecker it's like;
* create database object
* set parameters
* open connection
* execute queries
* execute queries
* and more queries
* close connection and dispose database object

If something like that has been done here too (or similar ofcourse), then thank you very much. =]
So goodluck with the testing etc!

- Nillus
 
 
permalink
 

 
2 sεcs σf uя ℓifε wastε∂

Rank: Alpha Member


Reply With Quote
Blog Entries: 2
 
Join Date: Aug 2008
Location: Reading YOUR location
Posts: 1,668
10-31-2008, 08:59 AM
 
looks nice.but ur a bit buggerd if u cant make rooms XD
 
 
permalink
 

 
Total Database Pooling

Rank: Member


Reply With Quote
 
Join Date: Aug 2006
Location: Some place in england
Posts: 286
10-31-2008, 01:55 PM
 
We couldn't even enter the hotel the day before :P
 
 
permalink
 

 
Total Database Pooling

Rank: Member


Reply With Quote
 
Join Date: Mar 2008
Location: Habbz Hotel
Posts: 367
10-31-2008, 02:50 PM
 
For anyone who's wondering about the moodlight.

It Now saves upon room exit/hotel reload and i've encountered no fatal errors with it yet

Quote: Originally Posted by Parker View Post
Well to be honest I don't know why I accepted this thread if you guys can't use it properly then this thread will eventually get closed and you can go back to the other thread.
Well It's a development... and it's going to succeed unlike half of the fake projects in the HH section


EDIT. For anyone who is hoping for V26/7. This server is not V26/7. It's hopefully going to be a stable V22/V23/V24 Server

Last edited by NitroHabbz; 10-31-2008 at 05:37 PM.
 
 
permalink
 

 
Alpha Member

Rank: Alpha Member


Reply With Quote
Blog Entries: 4
 
Join Date: Jan 2008
Location: CS:S
Posts: 1,890
10-31-2008, 05:48 PM
 
Aye i admit my pooling method was a very week and i have almost finished a version based on the same pice of code nillus sent you im just working on to mutch atm to get everything done.

anyway good luck with this and i hope you release it soon i wouldnt mind a decent holo hotel being around since frankly there all the same just with difrent logos atm :P

About the crashes they dont happen if you have a decent sized MySQL buffer or a decent amount of maximum connections.
 
 
permalink
 

 
People And A Nation.

Rank: Member


Reply With Quote
Blog Entries: 2
 
Join Date: May 2008
Location: Tilburg, The Netherlands
Posts: 409
10-31-2008, 06:07 PM
 
Quote: Originally Posted by warlord32 View Post
looks nice.but ur a bit buggerd if u cant make rooms XD
You code piece by piece, let him advance himself while coding, thank you.
 
 
permalink
 

 
The mofo'ing Woodpeckah

Rank: Alpha Member


Reply With Quote
 
Join Date: Feb 2007
Location: The Netherlands
Posts: 3,428
11-01-2008, 11:59 AM
 
Quote: Originally Posted by MYCHEMICALSELF View Post
Aye i admit my pooling method was a very week and i have almost finished a version based on the same pice of code nillus sent you im just working on to mutch atm to get everything done.

anyway good luck with this and i hope you release it soon i wouldnt mind a decent holo hotel being around since frankly there all the same just with difrent logos atm :P

About the crashes they dont happen if you have a decent sized MySQL buffer or a decent amount of maximum connections.
The thing that you guys call 'pooling' isn't just non-persistent connections FOR ANY QUERY lol.
Check the stuff I posted above, that's how Woodpecker communicates with it's database backend and I've stress-tested it etc, it works awesome.^_^
Do NOT just alter the methods in the database class and still use it like;
DB.runQuery("LOLWUT");
DB.runQuery("LMAO");
string j = DB.runRead("MEH");

Since you're opening and closing the database three times then, you should make it so that you open it, do the queries, and then close and dispose it.
That's how it works in Woodpecker.

- Nils
 
 
permalink
 

 
Total Database Pooling

Rank: Member


Reply With Quote
 
Join Date: Aug 2006
Location: Some place in england
Posts: 286
11-01-2008, 03:14 PM
 
Ok, we have a new test hotel :)

And that means more bug reports which means more stable once they have been fixed.
I am going to work on the Friends List now as it is buggy. (More so than the old source).
 
 
permalink
 

 
Total Database Pooling

Rank: Member


Reply With Quote
 
Join Date: Mar 2008
Location: Habbz Hotel
Posts: 367
11-01-2008, 03:25 PM
 
Quote: Originally Posted by cecer1 View Post
Ok, we have a new test hotel :)

And that means more bug reports which means more stable once they have been fixed.
I am going to work on the Friends List now as it is buggy. (More so than the old source).

Ok, If you need any help i'm on MSN
 
 
permalink
 

 
Total Database Pooling

Rank: Member


Reply With Quote
 
Join Date: Aug 2006
Location: Some place in england
Posts: 286
11-01-2008, 04:33 PM
 
I have made a REAL "HC Bug" fix.

I do not want to hear "But there is already an 'HC Bug' fix", that was not a fix.
All it did was remove the line.

It is like having a leaky toilet... how do you fix a leaky toilet? NOT by removing it and pissing on the floor!
You repair it like so.

PHP Code:
// Total Database Pooling
                
restingMonths Convert.ToInt32(dRow["months_left"]) - 1;
                
restingDays = (int)(DateTime.Parse(Convert.ToString(dRow["date_monthstarted"]), new System.Globalization.CultureInfo("en-GB"))).Subtract(DateTime.Now).TotalDays 32;
                
_clubMember true;


// Old Database Management
                
restingMonths int.Parse(subscrDetails[1]) - 1;
                
restingDays = (int)(DateTime.Parse(subscrDetails[2], new System.Globalization.CultureInfo("en-GB"))).Subtract(DateTime.Now).TotalDays 32;
                
_clubMember true
As far as I can tell this works :)
 
 
permalink
 

 
En Français, possible?

Rank: Member


Reply With Quote
 
Join Date: Apr 2007
Location: In Holograph Thread (L)
Posts: 482
11-01-2008, 04:56 PM
 
Subtract (DateTime.Now).TotalDays + 32

Why 32 ?
Why not 31 ? xD
 
 
permalink
 

 
I can do whatever I like!
Rec0rd's Avatar

Status: Banned


Reply With Quote
 
Join Date: Jul 2008
Location: United Kingdom
Posts: 1,098
11-01-2008, 04:57 PM
 
I have been working with Chris for quite a while, and i know he has made excellent progress with this server, especially DB Pooling which was his main concern.

So before you habboons controdict people, just think. Jee'z.

I know the progress of this, and I know what Chris is doing, but you lot don't, so keep your keyboards away, and for the love of christ, if you have nothing constructive to say here, then don't say it at all!



Chris, if this is all you're gonna get then let them suffer with a less efficiant, less coded database pooling.
 
 
permalink
 

 
Total Database Pooling

Rank: Member


Reply With Quote
 
Join Date: Aug 2006
Location: Some place in england
Posts: 286
11-01-2008, 05:05 PM
 
Quote: Originally Posted by Bjork View Post
Subtract (DateTime.Now).TotalDays + 32

Why 32 ?
Why not 31 ? xD
No idea, That is what Nillus put


@Above
I am going to finish this the best I can, I just ignore them :P
 
 
permalink
 

 
Holograph Developer

Rank: Member


Reply With Quote
 
Join Date: Aug 2007
Location: Cardiff, Wales
Posts: 1,103
11-01-2008, 05:10 PM
 
So, where do we shove the HC fix that you rustled up for us?
Also, great progress, can't wait for the end result.
 
 
permalink
 

 
Alpha Member

Rank: Alpha Member


Reply With Quote
Blog Entries: 4
 
Join Date: Jan 2008
Location: CS:S
Posts: 1,890
11-01-2008, 05:25 PM
 
Quote: Originally Posted by Nillus View Post
The thing that you guys call 'pooling' isn't just non-persistent connections FOR ANY QUERY lol.
Check the stuff I posted above, that's how Woodpecker communicates with it's database backend and I've stress-tested it etc, it works awesome.^_^
Do NOT just alter the methods in the database class and still use it like;
DB.runQuery("LOLWUT");
DB.runQuery("LMAO");
string j = DB.runRead("MEH");

Since you're opening and closing the database three times then, you should make it so that you open it, do the queries, and then close and dispose it.
That's how it works in Woodpecker.

- Nils
I know thats what im working on now ive been looking into how the woodpecker.storage class works as well and tbh i think im almost done.


Cecer the leaks you talk about may be unclosed connections that cant be retruned to the pool or the resorces arent being disposed of properly but i dont know good luck dued
 
 
permalink
 

 
Holograph Developer

Rank: Member


Reply With Quote
 
Join Date: Aug 2007
Location: Cardiff, Wales
Posts: 1,103
11-01-2008, 05:33 PM
 
Ah, I see where you are coming from now. And I see why there will be bugs, you are renaming and re-doing the whole of the SQL connection.

I hope the progress goes well.
 
 
permalink
 

 
Total Database Pooling

Rank: Member


Reply With Quote
 
Join Date: Aug 2006
Location: Some place in england
Posts: 286
11-01-2008, 05:38 PM
 
Quote: Originally Posted by TomSpit View Post
So, where do we shove the HC fix that you rustled up for us?
Also, great progress, can't wait for the end result.
Put it in virtualUser.cs
Go to Update voids
Go to refreshClub()
And replace the existing 3 lines (2 if you deleted the restingDays = (int).... line)

That should then work no matter where you are

EDIT:
Question: Is it true that a foreach loop is slower than a for loop? If so then I will edit all of the foreach loops I can.
 
 
permalink
 

 
The sun shines :D

Rank: Member


Reply With Quote
 
Join Date: Sep 2007
Location: Netherlands
Posts: 284
11-01-2008, 05:43 PM
 
I think foreach loop have the same speed as for loop but i don't know 100%
 
 
permalink
 

 
Holograph Developer

Rank: Member


Reply With Quote
 
Join Date: Aug 2007
Location: Cardiff, Wales
Posts: 1,103
11-01-2008, 06:26 PM
 
Quote: Originally Posted by cecer1 View Post
Put it in virtualUser.cs
Go to Update voids
Go to refreshClub()
And replace the existing 3 lines (2 if you deleted the restingDays = (int).... line)

That should then work no matter where you are

EDIT:
Question: Is it true that a foreach loop is slower than a for loop? If so then I will edit all of the foreach loops I can.
It won't work as it uses your new db method instead of the old one.
I'll just wait and add it in then =).
 
 
permalink