Skip to content

Instantly share code, notes, and snippets.

@tony612
Created July 12, 2016 17:40
Show Gist options
  • Select an option

  • Save tony612/49043f498960842fbb01912df0a361da to your computer and use it in GitHub Desktop.

Select an option

Save tony612/49043f498960842fbb01912df0a361da to your computer and use it in GitHub Desktop.
tsung config for Phoenix stress test
<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/local/share/tsung/tsung-1.0.dtd">
<tsung loglevel="info" version="1.0">
<clients>
<client host="localhost" use_controller_vm="true" maxusers="5000" />
</clients>
<servers>
<server host="serverhost" port="80" type="tcp" />
</servers>
<load>
<arrivalphase phase="1" duration="1000" unit="second">
<users maxnumber="3000" arrivalrate="300" unit="second" />
</arrivalphase>
</load>
<options>
<option name="ports_range" min="1025" max="65535"/>
</options>
<sessions>
<session name="http-login" probability="100" type="ts_http">
<request subst="true">
<dyn_variable name="token" jsonpath="token" />
<dyn_variable name="user_id" jsonpath="id" />
<http url="/api/sessions" method="POST" version="1.1" contents="email=user%%ts_user_server:get_unique_id%%@stress.test">
</http>
</request>
<change_type new_type="ts_websocket" host="serverhost" port="80" server_type="tcp" bidi="true"/>
<request subst="true">
<websocket type="connect" path="/socket/websocket?token=%%_token%%"></websocket>
</request>
<request subst="true">
<match do="log" when="nomatch">ok</match>
<websocket type="message">{"topic":"event:general:%%_user_id%%", "event":"phx_join", "payload": {}, "ref":"1"}</websocket>
</request>
<for var="i" from="1" to="1000" incr="1">
<thinktime value="30" />
</for>
</session>
</sessions>
</tsung>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment