the druid configuration I know is configured on a service
if mysql is installed on a machine
when we connect with a connection pool
according to https://blog.csdn.net/w059805.
the size formula of the connection pool is:
number of connections = ((number of cores * 2) + number of valid disks)
it should be said here that it is assumed that the configuration of the connection pool size is configured on a single service (project)
if we consider the situation that the microservice
has N services accessing the mysql machine
if the configuration of each service is the above formula
, then the total number of connection pools is N ((core 2) + effective disk)
this should not be correct
, but it doesn"t feel like you can divide the number of connections by N to assign the number of connections to each service
because N is uncertain. Because you don"t know when a service will fail, or when to add a few more services
secondly, the amount of database accessed by each service is also different
how do you understand this?
secondly, druid"s configuration monitoring system Servlet also configures
under a single service and accesses url such as
http://IP:PORT/druid
. Won"t N micro-services have N configured monitoring system Servlet?
if there are several micro-services on the same machine
, then you have to configure different url
, which feels weird?
maybe one solution is to extract all the dao layers that access the same mysql machine
from each microservice and operate independently into a microservice that can solve the above problems?
is such an architecture strange?