Official Community Forums
 
HomeHome  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log in  The Wiki  Website  github Project  

Share | 
 

 Server Load Testing

View previous topic View next topic Go down 
Go to page : 1, 2  Next
AuthorMessage
tichfuie
Super Contributor
Super Contributor
avatar

Posts : 257
Join date : 2013-02-07
Location : NA

PostSubject: Server Load Testing   Thu 4 Apr - 17:37

finally got the load testing files to run without any errors:

- simpleclient.sh
and

-simpleclient_multi.sh

when i run the script it practicly says the bot client is running.

but when i log into the world i dont see any bot or test client online

I even type in chat prompt /who
and no other players around but me.

is the load testing script supposed to spawn the bots in the world and make them visible to me?
or how does this work exactly?


below is the simpleclient.sh in action:


Code:

C:\multiverse/other/rhino1_5R5/js.jar;;
C:\multiverse/dist/lib/injected.jar;
C:\multiverse/dist/lib/multiverse.jar;
C:\multiverse/dist/lib/mars.jar;;
C:\multiverse/other/java-getopt-1.0.11.jar;
C:\multiverse/other/jython.jar;
C:\multiverse/other/log4j-1.2.14.jar;
C:\multiverse/other/bcel-5.2.jar;.
For test client 1, reading in script: C:/multiverse/config/common/simpleclient.py
For test client 1, found script file, running

Back to top Go down
rotello
Super Contributor
Super Contributor
avatar

Posts : 215
Join date : 2012-12-06

PostSubject: Re: Server Load Testing   Thu 4 Apr - 17:46

Wow big step. I completely forgot that one and I had a post related to that issue some week ago. Just checked it out and looks like we have a bummer here, the scripts are under multiverse/depreciated

I'm still curious though if it will work. Delurin should be able to answer this, here's the thread related

http://multiverse.forumotion.co.uk/t421-simulating-client-connections
Back to top Go down
rotello
Super Contributor
Super Contributor
avatar

Posts : 215
Join date : 2012-12-06

PostSubject: Re: Server Load Testing   Thu 4 Apr - 17:48

tichfuie, have you checked out the logs for errors?
Back to top Go down
tichfuie
Super Contributor
Super Contributor
avatar

Posts : 257
Join date : 2013-02-07
Location : NA

PostSubject: Re: Server Load Testing   Thu 4 Apr - 18:33

yea, there are no logs,

i even ran the script without the server online to see if threw any
server connection error but the output was the same as above,
so i dont think it is actually connecting to server
Back to top Go down
Delurin
Head of Platform Development


Posts : 424
Join date : 2011-08-03

PostSubject: Re: Server Load Testing   Fri 5 Apr - 2:18

Okay I just took a quick look at it. The logs should be in the directory that you ran the script from logs/.out apparently it doesnt define a name or anything so they just get dumped there. I am not sure if the account_id (default of 1) you set is registered or even if it has characters if it does have both it looks like it fails because it uses the old method for retrieving the character data by sending an int value (7) to the LoginPlugin instead of the more current secure login method which requires it to send int(10) as well as the authentication token etc so if you want to use it we will have to update the login to match the current secure login or recreate the old insecure login method that it was build to use (I don't recommend the insecure version)
Back to top Go down
Delurin
Head of Platform Development


Posts : 424
Join date : 2011-08-03

PostSubject: Re: Server Load Testing   Fri 5 Apr - 2:36

It looks like you might be better off connecting to the master server and getting an authentication token from it than trying rewrite it into the Simpleclient
Back to top Go down
tichfuie
Super Contributor
Super Contributor
avatar

Posts : 257
Join date : 2013-02-07
Location : NA

PostSubject: Re: Server Load Testing   Fri 5 Apr - 3:15

ok, one question:

if using master server the script requires port config
which ports shall i use for the following?

ms_tcp_port (int)
ms_rdp_port (int)
Back to top Go down
tichfuie
Super Contributor
Super Contributor
avatar

Posts : 257
Join date : 2013-02-07
Location : NA

PostSubject: Re: Server Load Testing   Fri 5 Apr - 3:21

nvm

i found the ports in the master server properties config file.

will give it a try and post results in a minute
Back to top Go down
Delurin
Head of Platform Development


Posts : 424
Join date : 2011-08-03

PostSubject: Re: Server Load Testing   Fri 5 Apr - 3:30

You will still need to modify the SimpleClient java file in the getCharacters(userToken)
Code:
MVByteBuffer buffer = new MVByteBuffer(32);
       buffer.putInt(0);      // message length
       buffer.putInt(LoginPlugin.MSGCODE_CHARACTER_REQUEST); // Change this to MSGCODE_SECURE_CHARACTER_REQUEST

You might have to do some more but I am not sure I might have more time to explore later
Back to top Go down
tichfuie
Super Contributor
Super Contributor
avatar

Posts : 257
Join date : 2013-02-07
Location : NA

PostSubject: Re: Server Load Testing   Fri 5 Apr - 4:57

i did your mode to the SimpleClient java file but still no go.

now when i recompile the server java code and export it to jar file. i do include the all packages ie:
mars, server, simpleclient etc...


all except "testclient" package due of stock is all filled up with errors. so wont compile.

is this a needed package for the load test?




also when use master server in the simpleclient script, the script do not throw any logs at all, or i just cant find them.

and the master master.out log shows the simpleclient logins but they wont appear ingame.


Code:

DEBUG [2013-04-04 12:28:34,138] RDPCallback          RDPConnection.send: time in ms=1
DEBUG [2013-04-04 12:28:34,880] pool-1-thread-1      masterserver: username len=7
DEBUG [2013-04-04 12:28:34,880] pool-1-thread-1      masterserver: login username=BotUser
DEBUG [2013-04-04 12:28:34,880] pool-1-thread-1      login info: password=password
DEBUG [2013-04-04 12:28:34,889] pool-1-thread-1      username=BotUser, uid=3
DEBUG [2013-04-04 12:28:34,889] pool-1-thread-1      MasterServer: password verified, uid=3, token=-4
DEBUG [2013-04-04 12:28:34,889] pool-1-thread-1      SocketHandler: closed socket: Socket[addr=/127.0.0.1,port=54932,localport=9005]
DEBUG [2013-04-04 12:28:34,904] RDPServer            masterserver: new incoming connection: RDP(/127.0.0.1:56080)
DEBUG [2013-04-04 12:28:35,056] RDPCallback          masterserver: got name resolution request
DEBUG [2013-04-04 12:28:35,056] RDPCallback          masterserver.resolvename: looking up worldName sampleworld
DEBUG [2013-04-04 12:28:35,057] RDPCallback          masterverse.resolvename: resolved worldName sampleworld to localhost:5040
DEBUG [2013-04-04 12:28:35,057] RDPCallback          masterverse.resolvename: patcher for worldName sampleworld at http://MY_DOMAIN_NAME.COM/patcher/world_patcher.html with media at: http://update.MY_DOMAIN_NAME.COM/sampleworld/update/
DEBUG [2013-04-04 12:28:35,057] RDPCallback          MVByteBuffer.reallocate: size=41 requested=96 newSize=164

Back to top Go down
Delurin
Head of Platform Development


Posts : 424
Join date : 2011-08-03

PostSubject: Re: Server Load Testing   Fri 5 Apr - 5:05

I dont think that package is necessary and I also ignore it when exporting. Check also your login_manager.out and see if it is throwing an error. Check again for the logs I found them in the directory that simpleclient.sh was run from and in with a subdirectory logs/.out then a blank named file .out
Back to top Go down
Delurin
Head of Platform Development


Posts : 424
Join date : 2011-08-03

PostSubject: Re: Server Load Testing   Fri 5 Apr - 5:21

If you want you can hard code the log file into the simpleclient.sh (I am not sure how to get it to correctly get the multiverse log file)

Code:
log4j.appender.FILE.File = logs/${multiverse.loggername}.out
to
Code:
log4j.appender.FILE.File =  c:/multiverse/logs/simpleclient/simpleclient.out

then you will know exactly where the logs are located. In any event it looks like it has difficulty processing the master server response. It is probably trying to process the unsecured version.
Back to top Go down
tichfuie
Super Contributor
Super Contributor
avatar

Posts : 257
Join date : 2013-02-07
Location : NA

PostSubject: Re: Server Load Testing   Fri 5 Apr - 5:53

added the path to the log folder as you showed me and now we got logs, thanks.

ok, seems that logs shows that we have connection to master server, but when selecting character it throws an exception:
i did specify in properties :
character_name=bot_character

and made sure the there was a character named like that in that BotUser account


Code:

INFO  [2013-04-04 13:59:14,467] Runner-1            SimpleClient: starting interpolation thread
INFO  [2013-04-04 13:59:15,016] Runner-1            MasterServer login succeeded
INFO  [2013-04-04 13:59:15,093] RDPCallback          Resolved world id sampleworld to hostname=localhost, port=5040


ERROR [2013-04-04 13:47:55,313] Runner-1            exception performing SimpleClient.getCharacters(userToken) java.lang.RuntimeException: SimpleClient.getCharacters
      at multiverse.simpleclient.SimpleClient.getCharacters(SimpleClient.java:1134)
      at multiverse.simpleclient.SimpleClient.login(SimpleClient.java:587)
      at multiverse.simpleclient.SimpleClient$ClientRunner.run(SimpleClient.java:456)
      at java.lang.Thread.run(Thread.java:662)
Caused by: java.io.EOFException
      at java.io.DataInputStream.readInt(DataInputStream.java:375)
      at multiverse.simpleclient.SimpleClient.getCharacters(SimpleClient.java:989)
      at multiverse.simpleclient.SimpleClient.login(SimpleClient.java:587)
      at multiverse.simpleclient.SimpleClient$ClientRunner.run(SimpleClient.java:456)
Back to top Go down
Delurin
Head of Platform Development


Posts : 424
Join date : 2011-08-03

PostSubject: Re: Server Load Testing   Fri 5 Apr - 6:11

can you add this to the prop file and post the log (remove any necessary info) you are getting a different error than I am
Code:
log4j.appender.FILE.Threshold = INFO

underneath
Code:
log4j.appender.FILE = org.apache.log4j.RollingFileAppender
Back to top Go down
tichfuie
Super Contributor
Super Contributor
avatar

Posts : 257
Join date : 2013-02-07
Location : NA

PostSubject: Re: Server Load Testing   Fri 5 Apr - 6:20

here is my log output


Quote :


INFO [2013-04-04 14:16:08,139] main pid 8836@TICH1
INFO [2013-04-04 14:16:08,141] main The log level is 2
INFO [2013-04-04 14:16:08,142] main Multiverse server version 1.5 0 (- -)
INFO [2013-04-04 14:16:08,144] main Entered MarshallingRuntime.initializeBatch: reading type nums from '/typenumbers.txt'
ERROR [2013-04-04 14:16:08,146] main MarshallingRuntime.initializeBatch: type num file '/typenumbers.txt' does not exist!
INFO [2013-04-04 14:16:08,151] main Running SimpleClient.main
INFO [2013-04-04 14:16:08,151] main arg[0] = -t
INFO [2013-04-04 14:16:08,151] main arg[1] = /typenumbers.txt
INFO [2013-04-04 14:16:08,151] main arg[2] = -e
INFO [2013-04-04 14:16:08,151] main arg[3] = C:/multiverse/config/common/simpleclient.properties
INFO [2013-04-04 14:16:08,151] main arg[4] = -s
INFO [2013-04-04 14:16:08,151] main arg[5] = C:/multiverse/config/common/simpleclient.py
INFO [2013-04-04 14:16:08,181] main props has 21 elements
INFO [2013-04-04 14:16:08,182] main Starting Packet Aggregator thread with an aggregation interval of 25
INFO [2013-04-04 14:16:08,183] main You picked s with an argument of C:/multiverse/config/common/simpleclient.py

INFO [2013-04-04 14:16:08,217] Runner-null SimpleClient: starting interpolation thread
INFO [2013-04-04 14:16:08,758] Runner-null MasterServer login succeeded
INFO [2013-04-04 14:16:08,876] RDPCallback Resolved world id sampleworld to hostname=localhost, port=5040
ERROR [2013-04-04 14:16:08,886] Runner-null exception performing SimpleClient.getCharacters(userToken) java.lang.RuntimeException: SimpleClient.getCharacters
at multiverse.simpleclient.SimpleClient.getCharacters(SimpleClient.java:1134)
at multiverse.simpleclient.SimpleClient.login(SimpleClient.java:587)
at multiverse.simpleclient.SimpleClient$ClientRunner.run(SimpleClient.java:456)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.io.EOFException
at java.io.DataInputStream.readInt(DataInputStream.java:375)
at multiverse.simpleclient.SimpleClient.getCharacters(SimpleClient.java:989)
at multiverse.simpleclient.SimpleClient.login(SimpleClient.java:587)
at multiverse.simpleclient.SimpleClient$ClientRunner.run(SimpleClient.java:456)
at java.lang.Thread.run(Thread.java:662)



Back to top Go down
tichfuie
Super Contributor
Super Contributor
avatar

Posts : 257
Join date : 2013-02-07
Location : NA

PostSubject: Re: Server Load Testing   Sat 6 Apr - 6:13

delurin

any luck getting it to work?

Back to top Go down
Delurin
Head of Platform Development


Posts : 424
Join date : 2011-08-03

PostSubject: Re: Server Load Testing   Sat 6 Apr - 6:18

No I am stuck trying to get the authentication key from the master server... when I see byte arrays my brain tends to go wonky... I probably wont play around with it again until next week.
Back to top Go down
Delurin
Head of Platform Development


Posts : 424
Join date : 2011-08-03

PostSubject: Re: Server Load Testing   Tue 9 Apr - 3:34

It looks like part of my problem was that the world name I put in the mysql db did not match the world name of the server (Which seems to only be a problem when running the SimpleClient) Which means now I am at the same place as you. It looks like we are missing a step between the resolve world and the getcharacters where it gets the authentication code from the master server.
Back to top Go down
tichfuie
Super Contributor
Super Contributor
avatar

Posts : 257
Join date : 2013-02-07
Location : NA

PostSubject: Re: Server Load Testing   Tue 9 Apr - 3:40

yup,

i have looked at it over and over and over, but cant seem to find a solution.

hopefully you can come to a solution.
Back to top Go down
Delurin
Head of Platform Development


Posts : 424
Join date : 2011-08-03

PostSubject: Re: Server Load Testing   Tue 9 Apr - 4:57

I may try to write in a special case for the simpleclient... I havent decided yet.
Back to top Go down
tichfuie
Super Contributor
Super Contributor
avatar

Posts : 257
Join date : 2013-02-07
Location : NA

PostSubject: Re: Server Load Testing   Tue 9 Apr - 5:38

what do you mean by special case?

like adding extra features to it?
Back to top Go down
Delurin
Head of Platform Development


Posts : 424
Join date : 2011-08-03

PostSubject: Re: Server Load Testing   Tue 9 Apr - 5:47

I might add a special login to the server for the simpleclient to connect to that bypasses the master server that should be disabled when the game is launched
Back to top Go down
Delurin
Head of Platform Development


Posts : 424
Join date : 2011-08-03

PostSubject: Re: Server Load Testing   Wed 10 Apr - 2:05

Ok I got it to login...I havent tested it past this point yet
Basically I copied the master private key to the simpleclient.py and added it just like it is in master.py so that I can bypass the master server for authentication (it still uses it to look up the world information)

The I changed

Code:
// send token id - string
       MVByteBuffer buffer = new MVByteBuffer(32);
       buffer.putInt(0);      // message length
       buffer.putInt(LoginPlugin.MSGCODE_CHARACTER_REQUEST);
       buffer.putString("1.5");   // client version
            buffer.putInt(4);      // auth code; this is a string in the
            buffer.putInt(userToken);  // protocol, so this is a hack

to this

Code:
SecureTokenSpec masterSpec = new SecureTokenSpec(SecureTokenSpec.TOKEN_TYPE_MASTER,
                                                            "master",
                                                            System.currentTimeMillis() +
                                                            120000L);
            masterSpec.setProperty("account_id", userToken);
            masterSpec.setProperty("account_name", scProps.username);
            byte[] masterToken = SecureTokenManager.getInstance().generateToken(masterSpec);
           
       MVByteBuffer buffer = new MVByteBuffer(32 + masterToken.length);
       buffer.putInt(0);      // message length
       buffer.putInt(LoginPlugin.MSGCODE_SECURE_CHARACTER_REQUEST);
       buffer.putString("1.5");   // client version
        buffer.putByteArray(masterToken);


One of the things I noticed is that to prevent people from accessing the account they also inverted the userToken so you will either need to add a negative account of the one you want to login to or you need to remove the account inversion.

We may also eventually want to have it actually authenticate with the master server but it will require a new function that send the challenge request and sends the response to get the masterToken but I figure we can do that after we get this fully working.
Back to top Go down
Delurin
Head of Platform Development


Posts : 424
Join date : 2011-08-03

PostSubject: Re: Server Load Testing   Wed 10 Apr - 3:09

It looks like this works but does not actually do anything other than open a connection to the proxy server. It looks like the load test scripts are in the /server/src/multiverse/simpleclient/
runloadtestclients.sh or one of the others.... so we have more work ahead.
Back to top Go down
Delurin
Head of Platform Development


Posts : 424
Join date : 2011-08-03

PostSubject: Re: Server Load Testing   Wed 10 Apr - 3:41

Got it to work with runplayerclients.sh moved from simpleclient directory and updated the MV_HOME I can see the test player running around randomly. Now I need to look at making a whole bunch of them to actually load test.
Back to top Go down
Sponsored content




PostSubject: Re: Server Load Testing   

Back to top Go down
 
Server Load Testing
View previous topic View next topic Back to top 
Page 1 of 2Go to page : 1, 2  Next
 Similar topics
-
» .^f2F-.Swemmei Recruting in server 1
» Lag playing in Taiwan server from Shanghai
» Proxy Server Taiwan: How To.
» WoW "Development" Server
» Omnos (( Maybe another name depending on server)) Sunbearer

Permissions in this forum:You cannot reply to topics in this forum
 :: Development :: Getting Started-
Jump to: