Hi ! I'm developing a little Hub Server for Direct Connect Protocol (P2P), and
I'm experiencing some big performance problems.
When I posted the first messages Niklas answered me that it could be the
database which could block threads, so he told me that I had to use some O/R
product like Hibernate.
So I used Hibernate, performance with its cache and connection pooling
mechanisms effectively are better, but no sufficient to be considered a good
product.
I'm searching for performance tips...So I have a question...but before a
little example about the communication between client and server (a login
handshake)
clients connect...server sends a key and the hubname
S: $Lock fdsjfsiodfjaiosdjfsaomfoos Pk=somekey|
S: $HubName myhubname.mydomain.com|
...
clients asks the server to validate the nick, sends his info and asks for the
userlist:
C: $Validate MyNick|
C: $MyINFO $ALL MyNick iinfo....|
C: $GetNickList|
server answers with all the MyINFO of the connected users:
S: $MyINFO $ALL user1 info...|
S: $MyINFO $ALL user2 info...|
S: $MyINFO $ALL user3 info...|
S: $MyINFO $ALL user4 info...|
S: $MyINFO $ALL user5 info...|
...
S: $MyINFO $ALL user1000 info...|
...
Now the question is, according to you it's better to write on the IoSession
one single time with a big message or fragment the big message in more
writes ?
Then...now I tryied to use a threadPool of 10 elements in my overriden class
of ServiceRegistry...what about this ? How can I tune this parameter ? What
are the refs ?
Best regards,
Alessandro Torrisi
|