# Azure query locks client node with high memory usage in CloudQuery

**URL:** https://community.cloudquery.io/t/azure-query-locks-client-node-with-high-memory-usage-in-cloudquery/679
**Category:** CloudQuery Plugins
**Created:** [October 9, 2023, 9:13pm UTC](https://community.cloudquery.io/t/azure-query-locks-client-node-with-high-memory-usage-in-cloudquery/679 "2023-10-09T21:13:41Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![modern-burro](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@modern-burro](https://community.cloudquery.io/u/modern-burro)
#### Post date: [October 9, 2023, 9:13pm UTC](https://community.cloudquery.io/t/azure-query-locks-client-node-with-high-memory-usage-in-cloudquery/679/1 "2023-10-09T21:13:41Z")

</div>

Hi there 👋

I’m running a PoC for CloudQuery and successfully implemented queries for AWS and GCP, with full table scans across multiple accounts/projects. However, I have an issue with Azure where my client node (c5.4xlarge) locks up completely when I do the same for Azure; before it does, memory usage will spike up and `kswapd0` will eat a CPU core which usually means something doesn’t play well with memory. If I can get CloudQuery to terminate, the VM might go back to being responsive, but I usually have to stop it from the AWS console (which takes some time and will eventually succeed).

I have tried both v9.3.7 and v9.3.8 with a straightforward configuration:

```yaml
kind: source
spec:
  name: azure
  path: cloudquery/azure
  version: "v9.3.8"
  tables: ["*"]
  destinations: ["postgresql"]
  spec:
  backend_options:
    table_name: "cq_azure_state"
    connection: "@@plugins.postgresql.connection"

```

Is there a good way of debugging this further?

---

<div class="post-metadata">

### Author: ![ben](https://sea1.discourse-cdn.com/flex001/user_avatar/community.cloudquery.io/ben/32/88_2.png) [@ben](https://community.cloudquery.io/u/ben)
#### Post date: [October 9, 2023, 9:15pm UTC](https://community.cloudquery.io/t/azure-query-locks-client-node-with-high-memory-usage-in-cloudquery/679/2 "2023-10-09T21:15:57Z")

</div>

Hi @included-collie,

Are you syncing lots of subscriptions? If you are, I would suggest that you try and lower the `discovery_concurrency` value…

---

<div class="post-metadata">

### Author: ![modern-burro](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@modern-burro](https://community.cloudquery.io/u/modern-burro)
#### Post date: [October 9, 2023, 9:17pm UTC](https://community.cloudquery.io/t/azure-query-locks-client-node-with-high-memory-usage-in-cloudquery/679/3 "2023-10-09T21:17:56Z")

</div>

Yep, absolutely do - do you have a hint on a sane value when there are many subscriptions? I might want to lower `concurrency` as well …

---

<div class="post-metadata">

### Author: ![ben](https://sea1.discourse-cdn.com/flex001/user_avatar/community.cloudquery.io/ben/32/88_2.png) [@ben](https://community.cloudquery.io/u/ben)
#### Post date: [October 9, 2023, 9:19pm UTC](https://community.cloudquery.io/t/azure-query-locks-client-node-with-high-memory-usage-in-cloudquery/679/4 "2023-10-09T21:19:30Z")

</div>

How are you sourcing your credentials for Azure?

---

<div class="post-metadata">

### Author: ![modern-burro](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@modern-burro](https://community.cloudquery.io/u/modern-burro)
#### Post date: [October 9, 2023, 9:19pm UTC](https://community.cloudquery.io/t/azure-query-locks-client-node-with-high-memory-usage-in-cloudquery/679/5 "2023-10-09T21:19:52Z")

</div>

They’re exported to env.

---

<div class="post-metadata">

### Author: ![ben](https://sea1.discourse-cdn.com/flex001/user_avatar/community.cloudquery.io/ben/32/88_2.png) [@ben](https://community.cloudquery.io/u/ben)
#### Post date: [October 9, 2023, 9:20pm UTC](https://community.cloudquery.io/t/azure-query-locks-client-node-with-high-memory-usage-in-cloudquery/679/6 "2023-10-09T21:20:59Z")

</div>

Ok. Just wanted to make sure you aren’t using `azure login` as that spawns a process for each authentication token that is needed.

---

<div class="post-metadata">

### Author: ![modern-burro](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@modern-burro](https://community.cloudquery.io/u/modern-burro)
#### Post date: [October 9, 2023, 9:26pm UTC](https://community.cloudquery.io/t/azure-query-locks-client-node-with-high-memory-usage-in-cloudquery/679/7 "2023-10-09T21:26:14Z")

</div>

I’ve now started another run with a conservative `discovery_concurrency: 50` and `concurrency: 1000` which is looking much better.

---

<div class="post-metadata">

### Author: ![ben](https://sea1.discourse-cdn.com/flex001/user_avatar/community.cloudquery.io/ben/32/88_2.png) [@ben](https://community.cloudquery.io/u/ben)
#### Post date: [October 9, 2023, 9:26pm UTC](https://community.cloudquery.io/t/azure-query-locks-client-node-with-high-memory-usage-in-cloudquery/679/8 "2023-10-09T21:26:47Z")

</div>

Great! Let us know how that goes.

---

<div class="post-metadata">

### Author: ![modern-burro](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@modern-burro](https://community.cloudquery.io/u/modern-burro)
#### Post date: [October 9, 2023, 9:27pm UTC](https://community.cloudquery.io/t/azure-query-locks-client-node-with-high-memory-usage-in-cloudquery/679/9 "2023-10-09T21:27:33Z")

</div>

Thanks for the pointer to the concurrency settings…!
