What the data for this category looks like
Market and yield data for the coal chemical category comes primarily from domestic bulk commodity spot trading platforms, futures exchange market APIs, and industry association monitoring reports. Spot data is updated daily. Futures data is pushed every 15 minutes during trading days. Industry inventory and capacity data is updated weekly. Individual data entries are stored in structured JSON format, including fields such as product_name, quote_unit, latest_price, daily_fluctuation, inventory_volume. Quotation units are mostly yuan per ton, while inventory and capacity units are ten thousand tons.
What constraints these characteristics impose on database and operations work
High-frequency, short-interval futures data generates a large volume of write requests in a short time, requiring the database's write throughput to adapt to sudden traffic. Differences in format across multiple data sources require a preprocessing layer that supports varying field structures and unit conversion logic. Large-volume weekly bulk inventory data requires configuring appropriate batch submission thresholds to avoid write blocking. Long-term stored historical market data consumes significant disk space, requiring a regular archiving strategy to free storage space. At the same time, multi-field query demands across multiple categories require the database to create indexes for frequently queried fields such as product name and time range, to ensure query efficiency.
How to set configurations
| Configuration Item | Recommended Value | Rationale |
|---|---|---|
VECTOR_STORE_BATCH_SIZE | 50-100 entries/batch | Coal chemical data has moderate per-entry size. This batch size balances write throughput and memory usage, and fits the resource limits of 8-core 64g hardware |
EMBEDDING_MODEL_BATCH_SIZE | 32 entries/batch | When using shaw/dmeta-embedding-zh, this value fits the video memory capacity of RTX2070, preventing video memory overflow |
DB_WRITE_TIMEOUT | 600 seconds | Weekly bulk inventory data takes a long time to write. This timeout setting prevents interruptions to the write process mid-operation |
MAX_UPLOAD_FILE_SIZE | 1000 MB | Single-batch imported historical coal chemical market CSV files are large. This setting allows complete upload and parsing |
RECALL_TOP_K | Top 10 entries | Coal chemical yield daily reports need to cover market data for mainstream categories. This recall volume ensures information completeness |
MONGO_CONNECTION_POOL_SIZE | 20-30 | High-frequency futures data writes require a sufficient connection pool to handle concurrent requests, preventing connection exhaustion |
The parameter values provided on this page are common recommended starting points for configuration. Actual values are affected by material form, data volume, and business rules. Specific issues require individual analysis. It is recommended to test on your own samples before finalizing settings.
Three Common Misconfigurations
- Symptom: Knowledge base search responses time out, and the number of returned results is insufficient. Cause: The
RECALL_TOP_Kparameter was not adjusted to a value suitable for multi-category coal chemical data, resulting in a recall range that does not match business requirements. - Symptom: Disk space insufficient error occurs during writing, and data import fails even after restarting the service. Cause: No
MAX_UPLOAD_FILE_SIZEsetting or regular archiving strategy was configured. The volume of single-batch imported historical data exceeds the reserved disk space. - Symptom: Startup error
getaddrinfo EAI_AGAIN mongooccurs, and the service cannot connect to the database normally. Cause: The MongoDB connection pool configurationMONGO_CONNECTION_POOL_SIZEis too high, or theDB_CONNECT_TIMEOUTparameter was not adjusted, leading to frequent DNS resolution failures.
How to Confirm Correct Configuration
- Run a batch write test for single coal chemical market data, observe the database write success rate, and adjust
VECTOR_STORE_BATCH_SIZEto a value where the success rate remains stable. - Import a single historical coal chemical data file, verify that the upload and parsing process has no errors, and confirm that
MAX_UPLOAD_FILE_SIZEfits the file volume. - Simulate concurrent write requests for high-frequency futures data, check the database connection pool status, and adjust
MONGO_CONNECTION_POOL_SIZEto a value where no connection exhaustion errors occur. - Trigger a knowledge base search request, verify the category coverage of returned results, and adjust
RECALL_TOP_Kto a value that meets business requirements.
Question material comes from public community discussions. Configuration values are common starting points and should be measured against your own samples. Verified on 2026-09-14.