# How to load test apollo subscription on websocket?

**URL:** https://community.apollographql.com/t/how-to-load-test-apollo-subscription-on-websocket/7769
**Category:** Server
**Tags:** server
**Created:** [August 22, 2024, 5:30pm UTC](https://community.apollographql.com/t/how-to-load-test-apollo-subscription-on-websocket/7769 "2024-08-22T17:30:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![The\_Z](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/the_z/32/5262_2.png) [@The\_Z](https://community.apollographql.com/u/The_Z)
#### Post date: [August 22, 2024, 5:30pm UTC](https://community.apollographql.com/t/how-to-load-test-apollo-subscription-on-websocket/7769/1 "2024-08-22T17:30:00Z")

</div>

hi all ! i need an example for load testing apollo subscription on websocket. i tried artillery but no luck. i just need an example config or example file for any load testing library. my current artillery code is this if it helps:

```auto
  target: "ws://localhost:3001/subscription" # Your WebSocket server URL
  phases:
    - duration: 60 # Duration of the test in seconds
      arrivalRate: 5 # Number of new connections per second
  ws:
    connection:
      headers:
        Sec-WebSocket-Protocol: graphql-ws # Specify the graphql-ws subprotocol
        Accept-Encoding: gzip, deflate, br, zstd
        Accept-Language: en-US,en;q=0.9,az;q=0.8,tr;q=0.7,ru;q=0.6,tg;q=0.5,de;q=0.4
        Cache-Control: no-cache
        Connection: Upgrade
        Pragma: no-cache
        Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
        Sec-WebSocket-Version: '13'
        Upgrade: websocket
        User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
        Host: localhost:3001
        Origin: http://localhost:3001
        Sec-WebSocket-Key: "CkFMtBrl0VsPJyKJ4eagwA=="

    # proxy:
    # url: 'http://localhost:3000'

scenarios:
  - engine: "ws"
    flow:
      - send: 
          text: '{"type":"connection_init","payload":{}}'
      - send:
          text: '{"type":"subscribe","id":"1","payload":{"query":"subscription test { numberIncremented } "}}'
      - think: 5
      - loop:
          - send: 'Hello from Artillery'
        count: 10

```
