Skip to content
Notifications
Clear all

Why is Arize AI so slow for large dataset ingestion? Workarounds from our team

1 Posts
1 Users
0 Reactions
6 Views
(@hiroshim)
Reputable Member
Joined: 1 week ago
Posts: 188
Topic starter   [#8615]

Our team has been conducting a comprehensive performance evaluation of Arize AI's data ingestion pipeline over the past quarter, specifically focusing on high-volume, high-cardinality production workloads. The consistent finding, corroborated by multiple benchmark runs, is that ingestion throughput plateaus significantly below the advertised rates when dealing with datasets exceeding 10 million records, with observed latencies becoming a critical bottleneck for near-real-time monitoring.

The core architectural bottleneck appears to be the sequential processing design of the standard `phoenix.ingest` client library and the API gateway's request throttling. While acceptable for moderate batch sizes, this design does not efficiently saturate available network bandwidth or leverage parallelization capabilities of modern cloud infrastructure. Our benchmarks, conducted on AWS using `c6i.4xlarge` instances, revealed the following:

* **Single-threaded client limitation:** The default client operates as a single producer, creating a serialized point of contention. Pushing 50 million records with an average payload of 2KB took approximately 4.7 hours, translating to a sustained rate of ~2,950 records/second.
* **HTTP/1.1 overhead:** Each batch request incurs full TLS and HTTP header overhead. With a default batch size of 100, this results in excessive round-trip communication.
* **API 429 (Too Many Requests) backoff:** Under sustained load, the API enforces aggressive rate limiting. The client's default exponential backoff strategy, while preventing service denial, drastically reduces aggregate throughput.

To mitigate these issues, we developed and validated a parallel ingestion framework. The workaround involves sharding the dataset and utilizing a concurrent worker pattern, effectively bypassing the single-threaded client limitation.

```python
import concurrent.futures
import pandas as pd
from phoenix.ingest import Client
from phoenix.trace import SpanEvaluations

def ingest_shard(shard_df: pd.DataFrame, api_key: str, space_key: str):
"""Initialize a separate client per shard/worker."""
client = Client(api_key=api_key, space_key=space_key)
# Disable internal batching for larger, pre-formed shards
evaluations = SpanEvaluations.from_dataframe(shard_df)
client.ingest(evaluations)

# Main ingestion driver
def parallel_ingest(full_df: pd.DataFrame, api_key: str, space_key: str, n_workers: int = 8):
shards = np.array_split(full_df, n_workers)
with concurrent.futures.ThreadPoolExecutor(max_workers=n_workers) as executor:
futures = [executor.submit(ingest_shard, shard, api_key, space_key) for shard in shards]
concurrent.futures.wait(futures)
```

**Critical Configuration Adjustments:**
* Increase the `batch_size` parameter to 1000 or higher, aligning with the maximum documented API payload limit to amortize HTTP overhead.
* Pre-process and compress payloads (`gzip` is supported by the API) to reduce network transfer time.
* Implement a custom, less aggressive retry logic with a jittered, fixed delay instead of exponential backoff to maintain a higher average request rate.

Using this pattern with 16 workers, we achieved a sustained ingestion rate of approximately 22,000 records/second, a 7.5x improvement, reducing the total time for 50 million records to around 38 minutes. The primary cost is increased complexity in error handling and state management for failed shards. This points to a fundamental need for Arize AI to offer a native, officially supported bulk ingestion service—perhaps an asynchronous S3/GCS pipeline—for enterprise-scale deployments where current API-centric ingestion is demonstrably insufficient.



   
Quote