#1 2017-03-06 10:07:18

ep
Member
Registered: 2017-02-08
Posts: 4

Test Android application JMeter

Hello,

I'm trying to do a load test for my server and my android application with JMeter.

I set JMeter on the port 8080 and i declare the proxy on the port 8080 in my wifi profile of the android device to send mormot http request to JMeter too.

Here the problem, Once JMeter started, it doesn't handle anything when i connect to the mormot server.

Also, i saw related post with proxy definition and i change my code to define proxy in the tsqlresthttpclient :

FClient := TSQLRestClientHTTP.Create(aIP,
                                         aPort,
                                         FModel,
                                         false,
                                         false,
                                         '192.168.99.44',
                                         '8080',
                                         30000,
                                         30000,
                                         5000
    );

But it changes nothing...

Does someone have a feedback with the use of JMETER and MORMOT please ?

Offline

#2 2017-03-13 13:55:41

ep
Member
Registered: 2017-02-08
Posts: 4

Re: Test Android application JMeter

up

Offline

#3 2017-08-22 09:57:45

M477h13u
Member
Registered: 2017-08-08
Posts: 11

Re: Test Android application JMeter

Hello everyone!

I would really appreciate to get feedback on that matter! (:

I am able to authenticate my current user, but all my POST requests return with a 403 or 406 error ..

Hope to read you guys big_smile

Last edited by M477h13u (2017-08-22 12:16:36)

Offline

#4 2017-08-22 14:51:20

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,275
Website

Re: Test Android application JMeter

I guess you just don't sign the URI as expected by the server side.
mORMot security is pretty serious, you just can't send unsigned commands, even after authentication! wink

Don't use JMeter for the load testing, but a Delphi multi-threaded mORMot client.
For a complete sample of performance benchmark, see e.g. "21 - HTTP Client-Server performance" sample.
It will use less resource, and you won't have any problem with authentication.

Offline

#5 2017-08-24 08:26:36

M477h13u
Member
Registered: 2017-08-08
Posts: 11

Re: Test Android application JMeter

Hello Arnaud! big_smile

currently I am working on a very basic client(Android)/TSQLHttpServer with useBidirSocket option. The Client is just requesting an -Interface based- service (sicPerUser).

1) I change that option to useHttpApiRegisteringURI which is suppose to register my URI automaticaly.. but still, I got my 403 and/or 406 error while requesting the '._contract_' and my 'method's service' on JMeter (netsh cmd comfirmed that 'http://+:7274/root/' was indeed registered whereas it was not with useBidirSocket!) .
Anyhow, my initial project need to enable WebSocket + immediate event callbacks, so I guess I am obliged to set Server option to useBidirSocket +  use WebSocketsEnable() method ?
Thus, with this configuration, should I still sign my URI ? If so, how should I do ?

2) I take a look at the e.g. "21 - HTTP C-S performance".. Basically I just have to add TTestMultiThreadProcess & TSynTestsLogged objects on client side ?
It seem that I also need to adapt TTestMultiThreadProcess.Test method in order to do what I want in my own project ? I.E. it's the entry point of my android client ?

Hope to read you guys big_smile

NB: Sorry if I ask novice questions or if I missed something in the documentation ... but I am new to all that roll big_smile

Last edited by M477h13u (2017-08-24 09:10:20)

Offline

#6 2017-08-24 09:20:14

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,275
Website

Re: Test Android application JMeter

useBidirSocket is a proprietary binary format over WebSockets, so you won't be able to use JMeter on it, for sure!
Note that websockets callbacks are not available yet on SynCrossPlatform units, so you won't be able to use it directly: only plain REST requests will be available for interface-based services.
For real time websockets, you would need to use direct process, not the one integrated in SOA.
Note that I do not recommend websockets for a mobile client - with 3G/4G mobility, websockets stream is easily broken.

Anyway, you always need to sign the URI, to have a session and an user handled.
The SynCrossPlatform units do this for you.

Of course, you need to adapt TTestMultiThreadProcess.Test method to your project.

Offline

#7 2017-08-25 16:11:48

M477h13u
Member
Registered: 2017-08-08
Posts: 11

Re: Test Android application JMeter

Hello Arnaud! big_smile

First of all, thank you for these recommendations and highlights !

I did check about JMeter & WebSocket, and indeed, JMeter does not manage WS. On the other hand, I found that some pleople created a plugin in order to add WS samplers on JMeter, but I did not manage to get the proper server's answer!

So I analyze more carefully about what was done in the "21 - HTTP Client-Server performance" sample. If I get it right, it is just launching multithread in order to multi-insert in the SQLite Database ?
Correct me if I'm wrong: for my own load testing, I just have to use TSynTestsLogged and create my own 'TTestMultiThreadProcess', in order to multi-request my interface-based services in different thread and analyze the timers in correlation with the number of thread and user per thread ? roll

Hope to read you guys and I wish you a good week-end for the lucky ones! big_smile

Offline

#8 2017-08-30 16:48:24

M477h13u
Member
Registered: 2017-08-08
Posts: 11

Re: Test Android application JMeter

Hello Arnaud !! smile

I tried what you recommended me concerning the project 21.. but unfortunately these classes (TTestMultiThreadProcess & TSynTestsLogged) are not compatible with Android .. so I manage to use TTask object in order to make my multithread.. but I wasn't really convinced by these tests.. as I only managed once to get 50 users connected; the rest of the time, it is just not stable..
So I tried NeoLoad, another load testing solution which manage Websocket.. I first try this solution with my minimal project ... AND IT WORKS ! big_smile  I manage to do a full load testing...

Unfortunately when I do my load testing with my full project .. I still get the 403 error on '/root/MyServiceName._contract_' & '/root/MyServiceName.DoMethod' ...... I do not understand why, because I have the really same NeoLoad's configuration, my only clue would be a security measure proper to mORMot .. Do you have any clue ? sad

Hope to read someone on that matter !

Offline

#9 2017-08-30 17:31:45

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,275
Website

Re: Test Android application JMeter

Your mORMot server is using JSON kind of WebSockets, I guess.
Then each request should follow the mORMot JSON layout, including the signature.

Offline

#10 2017-09-01 10:05:36

M477h13u
Member
Registered: 2017-08-08
Posts: 11

Re: Test Android application JMeter

Hello Arnaud,

I hope you're all right (:

Yes indeed, our server is using JSON kind of Websockets!
But can you be more specific about the mORMot JSON layout ? I'm not sure what you mean yikes
But still, I do not understand why I am able to make a successfull load testing with correct request and answer with my minimalist project but not with the complete one..

I just noticed that our android client is not implementing the "FClient.WebSocketsUpgrade(TRANSMISSION_KEY)" that is suppose to upgrade http communication to websockets.. but it does not seem to be crossplatform and I did not find any equivalent in the SynCrossPlatform folder, am I missing something or is it not implemented yet for Android client ?

With the hope to read you! big_smile

Offline

#11 2017-09-01 16:13:14

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,275
Website

Re: Test Android application JMeter

The problem is not about WebSockets upgrade itself. It is perfectly standard as implemented with mORMot.
But over JSON WebSockets, you have a REST emulation, with URI digital signature.
Without proper REST (query/answer) process, and the signature of the URI, the server will reject the query as invalid, for logical and safety reasons.

Offline

Board footer

Powered by FluxBB