Many customers mysql?

There is a main process that serves the RPC server.
This is a process that uses the cluster module to create 500+ forks, they are the same worker that will do the job.

Can each worker to open a connection to mysql or better in the master to keep the connection and workerb to kick the master to the upgraded database?

PS is it Possible the fork to pass an open connection to the master?
July 12th 19 at 16:48
2 answers
July 12th 19 at 16:50
500+ workarou? on the same machine? why so much? performance will only lose from this amount

by sabzh, open the connection in each worker is created, mysql is not able to resolve competitive access to the same connection. Within the same process is to resolve libs-drivers, placing requests in a queue, but multiple processes that could be a problem
Every worker is an object with its cookies. (Roughly speaking, this is one authoritative account on the site X)
Confuses me 500 open connections.
Isn't it better to master to do the pool? - Vergie.Moore29 commented on July 12th 19 at 16:53
: of course the better the connection pool in a single process, if performance is not to be missed, then you can do a cluster of processes according to the number of processor cores - trisha_Kovacek commented on July 12th 19 at 16:56
July 12th 19 at 16:52
You have 500+ processors on the machine? No sense in doing the number of workerb larger than the number of available cores.
Reduce the number of sarkerov and every worker open up a pool of connections.

Find more questions by tags MySQLNode.js