Selaa lähdekoodia

TG-3: Decrease ingestion chunk size to 1000 to prevent MySQL TCP packet limit crashes

lanfr144 4 viikkoa sitten
vanhempi
commit
ac91a886e6
1 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  1. 2 1
      ingest_csv.py

+ 2 - 1
ingest_csv.py

@@ -34,7 +34,8 @@ def ingest_file(filename, conn):
         "allergens", "traces"
     ]
     
-    chunk_size = 50000 
+    # Reduced chunk size to 1000 to prevent 'max_allowed_packet' and PyMySQL memory crash
+    chunk_size = 1000 
     total_processed = 0
 
     # Using chunking to stream into MySQL efficiently