Data Export and Import Questions #7394
BackgroundI have a standalone Greptime 0.17.2 instance running in Docker via Docker Compose. There area few other services on that vm, and I have caused some of them to crash when hitting Greptime with too large of a query. (I'm still figuring out how to not do that...) Due to that, I thought moving Greptime over to a vm on its own would help ensure I don't take other things down. At the same time I thought I'd set up data storage on an S3 compatible target. I think if I ever need to cluster, having the data on S3 already would help. My problem is that the data export is really really slow. As in my metrics table is something like 27GB, and my export has only created 19GB worth of data in over 20 hours. The docs mention watching system resources, but not really anything on how to adjust things based on what you see. I tried exporting a second table at the same time, but that caused the docker container to run out of resources and get killed. This is inside our data center, so networking should not be an issue. I think we're on 10G at the slowest. My target storage is an nfs mount with lots of space. I initially started exporting the data the wrong way and it was getting sent to the local container storage, and that export was moving just as slow. So the speed issue should not be caused by NFS, I hope. I do have the docker service limited with Questions:
Thanks! |
Replies: 3 comments 9 replies
|
Thank you for the detailed context and questions. Here are a few suggestions that may help:
You can repeat this for different time windows until the full history is covered. This has two benefits: Each export job is smaller and less likely to hit resource limits or fail halfway. If one job fails, you only need to re-run that specific time range, not the whole 27 GB again.
Increasing the memory limit is the most effective way to avoid the container being OOM-killed during export. If possible, raising the memory limit (for example to 16–32 GB, depending on your VM capacity) will significantly reduce the risk of OOM and make the export more stable.
Yes — as long as your new writes do not use timestamps that overlap with the historical data you are importing, you can absolutely start writing to the new Greptime instance while gradually importing the old data. This approach is safe and commonly used when migrating from one instance to another without downtime. The only thing to avoid is writing new data that falls into the same timestamp ranges as the historical batches you are importing. If your system always writes strictly increasing timestamps, then you can migrate history “little by little” without any interruption. |
|
Quick update: the new Export/Import V2 work has now landed on Compared with the older export/import flow discussed above, Export/Import V2 adds URI-based snapshots, resumable chunked export/import, snapshot For a migration like the one described here, the recommended V2 flow is roughly:
Also, for the older We're also adding user-facing docs/examples for the V2 commands here: |
|
Hello! We have similar performance issues with data export/import. We’re seeing very slow GreptimeDB export/import performance when the dataset has a very high table count - even though the on-disk size is relatively small (e.g. ~102k tables / 12.3 GiB and ~144k tables / 8.1 GiB). Exports take at least 1-2 days in a 8 core and 32GiB memory Incus container. We've tried out both v1 and v2 exports with different parallelism options but the performance wouldn't improve in any meaningful way. The main bottleneck appears to be the sheer number of tables rather than total data volume. We can't really reduce the amount of tables since we're using Netdata as our metrics exporter and it automatically created these tables. Is there a configuration or strategy to improve export/import performance specifically for high table cardinality? |

Quick update: the new Export/Import V2 work has now landed on
main. The delivery was tracked in:Compared with the older export/import flow discussed above, Export/Import V2 adds URI-based snapshots, resumable chunked export/import, snapshot
verify/list/delete, progress reporting, parallelism controls, and local/MinIO object-store E2E coverage.For a migration like the one described here, the recommended V2 flow is roughly:
--state-pathif you want a known resume-state location.