# Custom Protocol (thrift) testing... unable to simulate multiple users in repeated scenario.

**URL:** <https://community.gatling.io/t/custom-protocol-thrift-testing-unable-to-simulate-multiple-users-in-repeated-scenario/1967>\
**Category:** Gatling (Open-Source)\
**Created:** [February 4, 2015, 5:41pm UTC](https://community.gatling.io/t/custom-protocol-thrift-testing-unable-to-simulate-multiple-users-in-repeated-scenario/1967 "2015-02-04T17:41:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![harish\_sharma](https://avatars.discourse-cdn.com/v4/letter/h/f4b2a3/32.png) [@harish\_sharma](https://community.gatling.io/u/harish_sharma)\
**Post date:** [February 4, 2015, 5:41pm UTC](https://community.gatling.io/t/custom-protocol-thrift-testing-unable-to-simulate-multiple-users-in-repeated-scenario/1967/1 "2015-02-04T17:41:05Z")

</div>

Hi Gatling Users,

I am using 2.1.1 version of gatling.

I have written a custom Action/Actionbuilder for doing perf testing for our thrift server.

val mine = new ActionBuilder {  
def build(next: ActorRef , protocols: Protocols) = system.actorOf(Props(new MyAction(next,new ThriftClient(HOST,PORT), SCENARIO)))  
}

And i am using this action builder like this.  
val scn = scenario(SCENARIO)  
.repeat(ITERATIONS) {  
exec(mine)  
}  
setUp(scn.inject(rampUsers(NUM\_USERS) over (PICK\_UP\_DUR\_IN\_SEC)))

Now the problem is For all the users this test creates only one action which means only one connection to server and that means user simulation is wasted and there is no point of using multiple users if they use same socket/connection.

Now my question is what is it that i am doing wrong ? How can i make users create different actions so that each tries to talk to server on different connection.

Note: I have gone through the documentation here : [http://gatling.io/docs/1.5.6/developing\_gatling/implementing\_your\_own\_protocol\_support.html#the-action](http://gatling.io/docs/1.5.6/developing_gatling/implementing_your_own_protocol_support.html#the-action)  
which says actions can be shared by users , but what surprises me is no matter how many users i create it always create only one instance of Action and i know that gatling for http does create multiple connections to our http server.

Please help me if you have any pointer ?

P.S. [http://gatling.io/docs/1.5.6/developing\_gatling/implementing\_your\_own\_protocol\_support.html#the-action](http://gatling.io/docs/1.5.6/developing_gatling/implementing_your_own_protocol_support.html#the-action) This is the only documentation i could find and this seems to be outdated ? Is there any other new doc ?

[simulation.txt](https://community.gatling.io/uploads/short-url/mZULaQODkSazaqWSMXcbpc86YRr.txt) (990 Bytes)

[action.txt](https://community.gatling.io/uploads/short-url/5m9fGToyfFcHejJEfZKB7ylQehT.txt) (1.45 KB)

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [February 4, 2015, 10:56pm UTC](https://community.gatling.io/t/custom-protocol-thrift-testing-unable-to-simulate-multiple-users-in-repeated-scenario/1967/2 "2015-02-04T22:56:51Z")

</div>

Create a ThriftClient instance per virtual user and store it in the session, just like it’s being done for WebSockets. Don’t forget to close them.

---

<div class="post-metadata">

**Author:** ![harish\_sharma](https://avatars.discourse-cdn.com/v4/letter/h/f4b2a3/32.png) [@harish\_sharma](https://community.gatling.io/u/harish_sharma)\
**Post date:** [February 5, 2015, 6:21am UTC](https://community.gatling.io/t/custom-protocol-thrift-testing-unable-to-simulate-multiple-users-in-repeated-scenario/1967/3 "2015-02-05T06:21:01Z")

</div>

Hi Stephane,

Thanks for reply , can you please point me to the code of WebScoket which you are referring to. I am having a hard time figuring it out. ( I am new to scala / actors)
