M
M
miki1312016-04-30 14:43:57
MySQL
miki131, 2016-04-30 14:43:57

Lots of mysql clients?

There is a main process in which the RPC server is opened.
The same process uses the cluster module to create 500+ forks, they are workers that will do the work.
Is it possible to open a connection to mysql in each worker, or is it better to keep the connection in the master and kick the master from the workers so that he updates the database?
PS Is it possible to fork an open connection from the master?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Belyaev, 2016-04-30
@bingo347

500+ workers? on one machine? why so many? performance will only lose from such a number
of subjects, open a connection in each worker, mysql is not able to resolve concurrent access to one connection. Within a single process, this is handled by driver libs by queuing requests, but on multiple processes this will be a problem.

U
un1t, 2016-04-30
@un1t

Do you have 500+ processors on your machine? It makes no sense to make the number of workers greater than the number of available cores.
Reduce the number of workers and open a connection pool in each worker.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question