# PERFORMACE leadlists:update

**URL:** <https://forum.mautic.org/t/performace-leadlists-update/1867>\
**Category:** Product Support\
**Created:** [May 22, 2015, 11:54am UTC](https://forum.mautic.org/t/performace-leadlists-update/1867 "2015-05-22T11:54:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![squd](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@squd](https://forum.mautic.org/u/squd)\
**Post date:** [May 22, 2015, 11:54am UTC](https://forum.mautic.org/t/performace-leadlists-update/1867/1 "2015-05-22T11:54:38Z")

</div>

Hello,  
  
I see that mautic have bad performance when I do LISTS update (execute php /var/www/mautic/app/console mautic:leadlists:update --env=prodphp /var/www/mautic/app/console mautic:leadlists:update --env=prod)  
  
DB is MYSQL  
  
When I see current sessions in MYSQL I see that the mautic do the following SELECT:  
  
SELECT distinct(l.id)  
  
FROM leads l  
  
LEFT JOIN lead\_lists\_leads ll ON l.id = ll.lead\_id  
  
WHERE (l.id NOT IN (SELECT new\_check.lead\_id  
  
FROM lead\_lists\_leads new\_check  
  
WHERE (new\_check.leadlist\_id = 9)  
  
AND (new\_check.lead\_id = l.id)))  
  
AND ((l.realmid = ‘1’)  
  
AND ((ll.lead\_id IS NULL) OR (ll.date\_added \<= ‘2015-05-22 08:01:01’))  
  
AND (l.id \<= 400004))  
  
ORDER BY l.id ASC LIMIT 300 OFFSET 0;  
  
  
  
so I see than the mautic works batch of 300 rows.  
  
How can I improve my long process update of leadlists ?  
  
How can I increase the batch from 300 to 10000 ?

---

<div class="post-metadata">

**Author:** ![squd](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@squd](https://forum.mautic.org/u/squd)\
**Post date:** [May 22, 2015, 11:54am UTC](https://forum.mautic.org/t/performace-leadlists-update/1867/2 "2015-05-22T11:54:38Z")

</div>

Hello,  
I see that mautic have bad performance when I do LISTS update (execute php /var/www/mautic/app/console mautic:leadlists:update --env=prodphp /var/www/mautic/app/console mautic:leadlists:update --env=prod)  
DB is MYSQL  
When I see current sessions in MYSQL I see that the mautic do the following SELECT:  
SELECT distinct(l.id)  
FROM leads l  
LEFT JOIN lead\_lists\_leads ll ON l.id = ll.lead\_id  
WHERE (l.id NOT IN (SELECT new\_check.lead\_id  
FROM lead\_lists\_leads new\_check  
WHERE (new\_check.leadlist\_id = 9)  
AND (new\_check.lead\_id = l.id)))  
AND ((l.realmid = ‘1’)  
AND ((ll.lead\_id IS NULL) OR (ll.date\_added \<= ‘2015-05-22 08:01:01’))  
AND (l.id \<= 400004))  
ORDER BY l.id ASC LIMIT 300 OFFSET 0;

so I see than the mautic works batch of 300 rows.  
How can I improve my long process update of leadlists ?  
How can I increase the batch from 300 to 10000 ?

---

<div class="post-metadata">

**Author:** ![chad.windnagle](https://avatars.discourse-cdn.com/v4/letter/c/7feea3/32.png) [@chad.windnagle](https://forum.mautic.org/u/chad.windnagle)\
**Post date:** [May 22, 2015, 3:14pm UTC](https://forum.mautic.org/t/performace-leadlists-update/1867/3 "2015-05-22T15:14:01Z")

</div>

Hi Squd,

Mautic’s command line tools accept parameters for changing the batch limit as needed. So if you want to change this simply pass this param:

```auto
php /var/www/mautic/app/console mautic:leadlists:update --env=prod --batch-limit=10000
```

There’s some more documentation on the crons here:  
[https://www.mautic.org/docs/setup/index.html](https://www.mautic.org/docs/setup/index.html)

You should probably test this and watch top on the CLI and see exactly how much CPU or ram is getting consumed when this executes. I have a feeling 10,000 might be a bit much unless you’ve got some pretty heavy duty hardware. If you do run well I’d like to know the specs just so we can understand what the code / hardware is capable of.

---

<div class="post-metadata">

**Author:** ![roman](https://avatars.discourse-cdn.com/v4/letter/r/ed8c4c/32.png) [@roman](https://forum.mautic.org/u/roman)\
**Post date:** [May 22, 2015, 3:17pm UTC](https://forum.mautic.org/t/performace-leadlists-update/1867/4 "2015-05-22T15:17:12Z")

</div>

Hi @squd !

You must add:  
–batch-limit=X  
as it’s described in the really useful documentation that Mautic team is developing in [https://www.mautic.org/docs/setup/index.html](https://www.mautic.org/docs/setup/index.html)

---

<div class="post-metadata">

**Author:** ![squd](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@squd](https://forum.mautic.org/u/squd)\
**Post date:** [May 25, 2015, 5:36am UTC](https://forum.mautic.org/t/performace-leadlists-update/1867/5 "2015-05-25T05:36:40Z")

</div>

Thanks,  
Why WEB UI does not have the possibility to update on button ?

---

<div class="post-metadata">

**Author:** ![chad.windnagle](https://avatars.discourse-cdn.com/v4/letter/c/7feea3/32.png) [@chad.windnagle](https://forum.mautic.org/u/chad.windnagle)\
**Post date:** [May 25, 2015, 5:15pm UTC](https://forum.mautic.org/t/performace-leadlists-update/1867/6 "2015-05-25T17:15:58Z")

</div>

Hi Squd

We’ve been experimenting with different ways to trigger this. The Web UI is unable to deal with huge numbers of records. It can timeout and be unreliable, so the cron was a far more effective solution.

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [February 2, 2020, 10:59pm UTC](https://forum.mautic.org/t/performace-leadlists-update/1867/7 "2020-02-02T22:59:46Z")

</div>


