HI,
Running into odd MySQL issue where high use of ram then crashes.
I have node red and mysql running in a kubernetes cluster, each in their own container. I have given MySQL 16gb of ram. Nothing else is running, I'm running a maintenance routine this weekend on a third party DAM system.
Basically looping through 2,700 partnumbers, then calling MySQL looking up the partnumber and all its related data, building a jason query and updating a third party system via an API.
The MySQL select is crashing the container, I upgraded to 1.0.1. I'm using JSON Array Aggregate as each linked table could have more than one result. i.e partnumber could be used in multiple years.
I have a rate limit of 1 message every 20 seconds to see if this would help MySQL but no go. Run about 50 records and she goes down.
CrashLoopBackOff 8 (3m17s ago) 34m
All the relevant table columns are indexed, especially the pivot tables for the joins.
[{"id":"affd6c530e4abdd1","type":"function","z":"5f7b654b5e96e1db","name":"Look Up Part Number","func":"let data = msg.payload;\n\nmsg.payload={}\nmsg.payload.partnumber = data.collection_title;\n\nlet query = \"SELECT JSON_ARRAYAGG( JSON_OBJECT('partnumber',pn.partnumber, 'name', pn.name, 'ShortDescription', pn.ShortDescription,\";\nquery += \"'year', vy.year, 'make', vm.make, 'model', vmod.model, 'engine', ve.engine, 'brand', vb.brand ) ) AS json \";\nquery += \"FROM vehicle_partnumbers AS pn \";\n//year\nquery += \"LEFT JOIN partnumber_vehicle_years_link AS vyl ON vyl.partnumber_id = pn.partnumber_id \";\nquery += \"LEFT JOIN vehicle_years AS vy ON vy.year_id = vyl.year_id \";\n\n\n//make\nquery += \"LEFT JOIN partnumber_vehicle_make_link AS vml ON vml.partnumber_id = pn.partnumber_id \";\nquery += \"LEFT JOIN vehicle_make AS vm ON vm.make_id = vml.make_id \";\n\n\n//model\nquery += \"LEFT JOIN partnumber_vehicle_model_link AS vmodl ON vmodl.partnumber_id = pn.partnumber_id \";\nquery += \"LEFT JOIN vehicle_model AS vmod ON vmod.model_id = vmodl.model_id \";\n\n\n//engine\nquery += \"LEFT JOIN partnumber_vehicle_engine_link AS vel ON vel.partnumber_id = pn.partnumber_id \";\nquery += \"LEFT JOIN vehicle_engine AS ve ON ve.engine_id = vel.engine_id \";\n\n\n//brand\nquery += \"LEFT JOIN partnumber_vehicle_brand_link AS vbl ON vbl.partnumber_id = pn.partnumber_id \";\nquery += \"LEFT JOIN vehicle_brand AS vb ON vb.brand_id = vbl.brand_id \";\n\nquery += \"WHERE partnumber = :partnumber\";\n\nmsg.topic = query;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1280,"y":2940,"wires":[["a117aa82fc0e8169"]]},{"id":"a117aa82fc0e8169","type":"mysql","z":"5f7b654b5e96e1db","mydb":"19c571b552634c36","name":"Holly DB","x":1460,"y":2940,"wires":[["a302f9f39facee8f"]]},{"id":"d424cc6f0b757563","type":"delay","z":"5f7b654b5e96e1db","name":"1 msg, 20s","pauseType":"rate","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"20","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"x":1090,"y":2940,"wires":[["affd6c530e4abdd1"]]},{"id":"a302f9f39facee8f","type":"switch","z":"5f7b654b5e96e1db","name":"Check with any Values","property":"payload[0].json","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":1640,"y":2940,"wires":[["8d6b8e6d09732c01"]],"outputLabels":["Results Returned"]},{"id":"446cef2f66ea7c6c","type":"inject","z":"5f7b654b5e96e1db","name":"","props":[{"p":"reset","v":"","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":1090,"y":2860,"wires":[["d424cc6f0b757563"]]},{"id":"19c571b552634c36","type":"MySQLdatabase","name":"","host":"db","port":"3306","db":"vehicle_applications","tz":"","charset":"UTF8"}]
Any ideas?
thanks
Harry