Here’s a comprehensive solution addressing all three key areas:
REST API Payload Limits:
First, configure your server to handle larger payloads. Update these settings:
In site.xconf:
<Property name="wt.httpgw.maxPostSize" value="20971520"/>
<Property name="wt.method.server.maxRequestSize" value="20971520"/>
If using Apache/nginx proxy, also increase client_max_body_size to 20MB. However, increasing limits alone isn’t the solution - you need proper batch processing.
Batch Processing Strategy:
Implement a chunked upload pattern with optimal batch sizing:
// Pseudocode - Chunked batch upload:
1. Split 2000 records into batches of 25 records each
2. Create upload queue with all batches
3. Initialize 3 parallel worker threads
4. Each worker: fetch batch, POST to /quality-records/batch
5. Handle response: success -> next batch, failure -> retry logic
6. Track progress and log results
For 15KB records, 25-record batches = ~375KB per request, well under limits and processes in 20-30 seconds. This gives you 80 batches total, processed by 3 workers in parallel = ~10-12 minutes total for 2000 records.
Server/Proxy Configuration:
Beyond payload limits, optimize timeout settings:
- Method server connection timeout: Increase to 120 seconds minimum
- Database connection pool: Ensure maxActive >= number of worker threads + 10
- Transaction timeout: Set to 180 seconds for batch operations
In site.xconf:
<Property name="wt.pom.dbcp.maxWait" value="120000"/>
<Property name="wt.method.server.connectionTimeout" value="120000"/>
Implement retry logic with exponential backoff for failed batches. Use HTTP status codes to determine retry strategy: 413/408 = reduce batch size, 500/503 = retry after delay, 4xx client errors = log and skip.
For production deployment, add monitoring to track batch processing metrics: success rate, average processing time per batch, and failure patterns. This helps tune batch size and worker count based on actual system performance.
Consider implementing a staging table approach where you bulk insert to a temporary table first, then use Windchill’s bulk loader utilities to process into final quality objects. This can be 5-10x faster for very large datasets.
This draft is based on general Windchill knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.