How to close the connection with mysql a looped script?

0 like 0 dislike
6 views
I use RabbitMQ. He has sorcery where there are different queries to the database. And I have piling up the connection to the database, since they are not closed (the script is not completed, and waits for new messages).

Question: what are the correct ways of closing connections?

I see:
1. Or register close the connection after saving the message.
2. Or not to close (but it eats a lot of resources)
3. Or is there something else.
by | 6 views

1 Answer

0 like 0 dislike
It may not be necessary every time to open a connection when receiving a task and will not accumulate?
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
0 like 0 dislike
3 answers
110,608 questions
257,186 answers
0 comments
33,804 users