Closed totten closed 1 year ago
So I've gotten a lot further with using pop
than I did in prior years. My goal today was to load large dummy data-set. In particular, I ran these:
examples/basic-10k.yml
(10,000 individuals) worked. Runtime was around 10 min.examples/basic-100k.yml
(100,000 individuals) eventually worked (notwithstanding some snags -- like overfilling the mysql-partition). Runtime was around 2 hours.After running these, I just wanted to braindump some observations/speculations:
Individual: 10000
and GroupContact: 20000
).civibuild restore
takes 40s -- 300x faster.)pop
calls Contact.get
to retrieve all CIDs. For 100k contacts, that response is quite large and requires a large buffer. It failed with 100mb(!) buffer. So I bumped up to 200mb.coworker -d maxConcurrentWorkers=8
. (Best-case-scenario: 2h becomes 15m)
pop basic-100k.yml > basic-100k.mysql
) instead of invoking APIs.
pop
generates a record like Participant
or GroupContact
, it needs to pick some random FK IDs (per Populator
and EntityStore
). It may be worth changing the approach:
first_contact_id
and last_contact_id
. Choose a random FK as contact_id = rand(first_contact_id, last_contact_id
). The strategy should be OK for newly-generated example-records (which form a contiguous batch).@totten merging this. glad it was useful. haven't used it for years. feel free to take ownership if you like :)
Overview
Add the
pop
console command directly intopop.git
Background/Motivation
@michaelmcandrew I needed some sample data recently, so I wondered if I could try
pop
again.In the previous work, it required adding everything to
cv
(https://github.com/civicrm/cv/pull/3). The discussion was a bit long, but the final problem (where the PR stalled) was the raw size of the dependencies -- Faker needs a lot of data, and embedding it incv.phar
made it too heavy. So we needed a way to run it without embedding the whole thing incv.phar
.With this PR,
pop
is a standalone command. To connect to CiviCRM, it callscv pipe
(akaCivi::pipe()
; Pipe Reference). The advantage of this arrangement:cv api3 Entity.action
.