This configuration is compatible with FastGPT v4.17.0, adjusted for deployment and upgrade requirements in pharmaceutical preparations manufacturing scenarios.
What this category of data looks like
Ledger data for pharmaceutical preparations manufacturing comes from approved formulation processes, MES/electronic batch records, equipment and environmental monitoring systems, LIMS, and quality management systems. Daily generated documents include master production files, batch production records, batch packaging records, cleaning records, inspection records, deviation/CAPA/change documents, and batch release review forms. Data is updated per batch production, each critical process step, and fixed monitoring plans. Fields include material batch numbers, process parameter values, inspection results, deviation descriptions, release status, and more. Units include kilograms, hours, batch numbers and other compliant formats.
Constraints Imposed by These Characteristics on Deployment and Upgrade
Since data sources cover multiple production and quality systems, deployment requires configuring connection parameters for multiple data sources to ensure consistent cross-system data pulling. Data is updated frequently in batches and requires long-term retention, so database connection pool and storage configurations must adapt to accumulated data volume to avoid connection exhaustion or storage overflow. GMP requirements mandate that ledger data be synchronized with production operations. During deployment, access permissions must be strictly controlled: only production, quality assurance and other authorized departments can access core ledger data to prevent unauthorized modification. Batch record documents require compliant storage, so deployment must integrate with the enterprise’s own storage system to ensure data sovereignty and traceability.
How to Configure the Settings
| Configuration Item | Recommended Setting | Rationale |
|---|---|---|
DB_MAX_LINK | 200–300 | The batch data volume for pharmaceutical preparations manufacturing is large. Sufficient connection count avoids connection exhaustion when multiple departments submit ledger summary requests, ensuring query stability. |
REDIS_URL | redis://192.168.1.100:6379/0 | High-frequency caching of batch record data requires a low-latency local Redis instance. This significantly shortens ledger summary response times and adapts to rapid updates of each batch of data. |
STORAGE_S3_ENDPOINT | Intranet endpoint address of the enterprise’s own object storage | Compliant documents such as batch production records must be stored in the enterprise’s own storage system to ensure data traceability and compliance, meeting GMP requirements for file storage. |
PG_URL | PostgreSQL instance address connected to LIMS and quality management systems | Ledger data needs to link to LIMS inspection records and deviation/change records from the quality management system. Unified PostgreSQL storage enables fast cross-system associated queries. |
FILE_TOKEN_KEY | Randomly generated 32-bit string | This secures access to batch record files, prevents unauthorized users from downloading sensitive production and quality documents, and complies with data security control requirements. |
ROOT_KEY | Key configured per the enterprise’s internal permission management rules | This restricts only administrators from production, quality assurance and other departments to access core system configurations, preventing unauthorized modification of ledger summary rules and parameters. |
Three Common Configuration Mistakes
- Phenomenon: After Docker deployment on a Windows environment, accessing the address corresponding to
FE_DOMAINreturns a 502 error. Cause: The 80 port of the FastGPT container is not mapped to the correct host port, or the host firewall blocks traffic on the mapped port. - Phenomenon: During intranet Docker-Compose deployment, OneAPI reports a MySQL connection refusal error, and logs show MySQL started normally. Cause: No network alias is set for the MySQL service in the Docker Compose configuration, so the FastGPT container cannot resolve the MySQL hostname and establish a connection.
- Phenomenon: After configuring the model API, ledger summary response speed is much slower than direct model API calls via curl. Cause: Database connection parameters such as
DB_MAX_LINKare not adjusted, leading to database connection exhaustion during multiple concurrent requests and blocking the API response process.
How to Confirm Successful Configuration
- Run the
docker pscommand to confirm all FastGPT-related containers are in running state, with no abnormal exits or restart records. - Call FastGPT’s internal data query interface, attempt to pull simulated batch production record fields, and confirm that LIMS inspection results and quality management system deviation records can be properly associated.
- Upload a simulated batch packaging record document, verify that the file is stored normally in the storage system corresponding to the configured
STORAGE_S3_ENDPOINT, and that it can be accessed normally via an authorized link. - Initiate 3–5 concurrent ledger summary requests, confirm that the number of database connections does not exceed the configured
DB_MAX_LINKvalue, and that there are no connection timeout or error logs.
The values provided here are common starting points and should be evaluated against the reader’s own samples.