Fast registration feature, can support millions of instance registration.
This feature is primarily used in scenarios where an ultra-high performance registry is required and is not recommended for scenarios where performance requirements are low or instance levels are small.
This feature is turn off by default, if need fast register you should open the fast registration switch.
When this feature is open, you can call register interface API, the service center will put instances in the queue, then direct return instanceId to users, at last, register registry asynchronously by timing task.
1.Config the fast registration queue size, to enable fast registration
If queueSize is bigger than 0, fast registration will trigger
The default configuration of /conf/app.yaml is as follows:
register: fastRegistration: # this config is only support in mongo case now # if fastRegister.queueSize is > 0, enable to fast register instance, else register instance in normal case # if fastRegister is enabled, instance will be registered asynchronously, # just put instance in the queue and return instanceID, and then register through the timing task queueSize: 0
Config queueSize in /conf/app.yaml, for example set queueSize to 50w
register.fastRegistration.queueSize=500000
2.Start service center
./service-center
3.Call the registry interface
Call the registry interface, you will receive InstanceID soon, now a fast registration has been completed once
The flow chart is as follows:
Normal Case:
If the fast registration is enabled, it is put in the queue and eventually registered to MongoDB in batch by timed tasks(The time interval is 100 millimeters)
Abnormal Case:
1.The database with ETCD scenario does not have this feature; only the Mongo database scenario does
2.Because the registration is asynchronous, there will be a certain amount of delay in the registration, the delay is basically in the second level
The performance of a fast registration instance is about three times better than that of a normal registration
best performance test:
service center | mongoDB | concurrency | tps | latency | queueSize |
---|---|---|---|---|---|
8u16g*2 | 16u32g | 200 | 9w | 1mm | 100w |
16u32g*2 | 16u32g | 500 | 15w | 2mm | 100w |