# How to do a large mutate transaction without killing other database connections

**URL:** <https://discuss.dgraph.io/t/how-to-do-a-large-mutate-transaction-without-killing-other-database-connections/9187>\
**Category:** Dgraph\
**Created:** [August 3, 2020, 2:25pm UTC](https://discuss.dgraph.io/t/how-to-do-a-large-mutate-transaction-without-killing-other-database-connections/9187 "2020-08-03T14:25:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nodeworks](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/nodeworks/32/3637_2.png) [@nodeworks](https://discuss.dgraph.io/u/nodeworks)\
**Post date:** [August 3, 2020, 2:25pm UTC](https://discuss.dgraph.io/t/how-to-do-a-large-mutate-transaction-without-killing-other-database-connections/9187/1 "2020-08-03T14:25:25Z")

</div>

How can I do a large import transaction without slowing down or killing other connections to dgraph? When I do an import of about 20k rows of data from a CSV (about 10 columns wide) dgraph because unqueryable during that time period so other people on the site can’t access data. How can I setup dgraph to not freeze everything while that is loading in?

---

<div class="post-metadata">

**Author:** ![anand](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/anand/32/5674_2.png) [@anand](https://discuss.dgraph.io/u/anand)\
**Post date:** [August 3, 2020, 4:09pm UTC](https://discuss.dgraph.io/t/how-to-do-a-large-mutate-transaction-without-killing-other-database-connections/9187/2 "2020-08-03T16:09:48Z")

</div>

Live loader has a “number of concurrent connections” parameter, which is 10 by default. Perhaps you could try live loader with lower concurrent connections.  
[https://dgraph.io/docs/deploy/#live-loader](https://dgraph.io/docs/deploy/#live-loader)

---

<div class="post-metadata">

**Author:** ![nodeworks](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/nodeworks/32/3637_2.png) [@nodeworks](https://discuss.dgraph.io/u/nodeworks)\
**Post date:** [August 3, 2020, 4:13pm UTC](https://discuss.dgraph.io/t/how-to-do-a-large-mutate-transaction-without-killing-other-database-connections/9187/3 "2020-08-03T16:13:01Z")

</div>

I’m doing this in the dgo library not the live loader. So I’m doing it in one transaction.

---

<div class="post-metadata">

**Author:** ![anand](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/anand/32/5674_2.png) [@anand](https://discuss.dgraph.io/u/anand)\
**Post date:** [August 5, 2020, 3:20am UTC](https://discuss.dgraph.io/t/how-to-do-a-large-mutate-transaction-without-killing-other-database-connections/9187/4 "2020-08-05T03:20:28Z")

</div>

When using a client, we make smaller batches (5k?) and load serially. This takes more time but keeps a manageable load on the server. You could also check active mutations and queries directly on dgraph via [activity metrics](https://dgraph.io/docs/deploy/metrics/#activity-metrics) and throttle the client at runtime. In order to see metrics, you can hit your endpoint as below.

```auto
curl http://<IP>:<HTTP_PORT>/debug/vars

```

[https://dgraph.io/docs//howto/retrieving-debug-information/#metrics-information](https://dgraph.io/docs//howto/retrieving-debug-information/#metrics-information)
