performance - rails runner background aws sqs processor memory leakage issue -
in rails application, have created background job file process aws sqs messages
lib/events/some_processor.rb
sqs = aws::sqs.new q = sqs.queues.create queue_name loop q.receive_message |msg| json_attrs = json.parse(msg.body) event = event.find(json_attrs["id"].to_i) event.process_logic(json_attrs["params"]) |status| rails.logger.info(status) msg.visibility_timeout = 30.minutes end end .. $> rails runner lib/events/some_processor.rb
events queue processor running infinite loop in aws instances
in production environment memory of slow increasing , instance terminated when reaches high.
i tried in machine running couple of hours memory increased when messages in queue , memory reduce if no messages process.
how identify memory leaks , db connections when in process in development environment.
Comments
Post a Comment