Hi All,

Currently, for each path defined in swagger yaml, MSF4J creates new micro
service. This leads increasing memory consumption, booting up time.

If I gave the real stats, for API Manager 3.0, initial booting time was
lesser than 2 seconds with 4 micro services, after adding more REST API
paths (for the same swagger ymal definition), the booting time was
increased to 6.1 seconds. Following micro-services are defined at the
moment in API Manager which will grow in future.


[2017-03-09 12:44:43,399]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.keymanager.KeymanagerService@566ffc20
[2017-03-09 12:44:43,405]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.keymanager.KeymanagerService@566ffc20
[2017-03-09 12:44:43,436]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.admin.PoliciesApi@3868a733
[2017-03-09 12:44:43,463]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.admin.PoliciesApi@3868a733
[2017-03-09 12:44:43,578]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.publisher.ApisApi@3d75ed80
[2017-03-09 12:44:43,642]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.publisher.ApisApi@3d75ed80
[2017-03-09 12:44:43,701]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.publisher.ApplicationsApi@516acba6
[2017-03-09 12:44:43,740]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.publisher.ApplicationsApi@516acba6
[2017-03-09 12:44:43,776]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.publisher.EndpointsApi@52efb978
[2017-03-09 12:44:43,808]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.publisher.EndpointsApi@52efb978
[2017-03-09 12:44:43,838]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.publisher.EnvironmentsApi@55df6f78
[2017-03-09 12:44:43,869]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.publisher.EnvironmentsApi@55df6f78
[2017-03-09 12:44:43,916]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.publisher.LabelsApi@986a887
[2017-03-09 12:44:43,956]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.publisher.LabelsApi@986a887
[2017-03-09 12:44:43,991]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.publisher.PoliciesApi@18cb6f74
[2017-03-09 12:44:44,029]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.publisher.PoliciesApi@18cb6f74
[2017-03-09 12:44:44,071]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.publisher.SubscriptionsApi@3740316c
[2017-03-09 12:44:44,109]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.publisher.SubscriptionsApi@3740316c
[2017-03-09 12:44:44,151]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.store.ApisApi@19ca2c53
[2017-03-09 12:44:44,194]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.store.ApisApi@19ca2c53
[2017-03-09 12:44:44,244]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.store.ApplicationsApi@66c70660
[2017-03-09 12:44:44,290]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.store.ApplicationsApi@66c70660
[2017-03-09 12:44:44,339]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.store.PoliciesApi@50ba8085
[2017-03-09 12:44:44,380]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.store.PoliciesApi@50ba8085
[2017-03-09 12:44:44,424]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.store.SubscriptionsApi@18da9675
[2017-03-09 12:44:44,474]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.store.SubscriptionsApi@18da9675
[2017-03-09 12:44:44,525]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.store.TagsApi@1e835f96
[2017-03-09 12:44:44,573]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.apimgt.rest.api.store.TagsApi@1e835f96
[2017-03-09 12:44:44,843]  INFO
{org.wso2.msf4j.internal.MicroservicesServerSC} - All microservices are
available
[2017-03-09 12:44:44,844]  INFO
{org.wso2.carbon.transport.http.netty.internal.NettyTransportServiceComponent}
- All CarbonNettyServerInitializers are available
[2017-03-09 12:44:44,856]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.uuf.httpconnector.msf4j.UUFMicroservice@1a3c0a9c
[2017-03-09 12:44:44,856]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.uuf.httpconnector.msf4j.UUFMicroservice@1a3c0a9c
[2017-03-09 12:44:44,857]  WARN
{org.wso2.carbon.kernel.internal.startupresolver.StartupComponentManager} -
You are trying to add an available capability org.wso2.msf4j.Microservice
from bundle(org.wso2.carbon.uuf.httpconnector.msf4j:1.0.0.m13) to an
already activated startup listener component wso2-microservices-server in
bundle(msf4j-core:2.1.1). Refer the Startup Order Resolver documentation
and validated your configuration
[2017-03-09 12:44:44,857]  INFO
{org.wso2.carbon.uuf.httpconnector.msf4j.internal.MSF4JHttpConnector} - UUF
app 'org.wso2.carbon.apimgt.web.store' is available at '/store'.
[2017-03-09 12:44:44,859]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.uuf.httpconnector.msf4j.UUFMicroservice@3178a583
[2017-03-09 12:44:44,859]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.uuf.httpconnector.msf4j.UUFMicroservice@3178a583
[2017-03-09 12:44:44,859]  WARN
{org.wso2.carbon.kernel.internal.startupresolver.StartupComponentManager} -
You are trying to add an available capability org.wso2.msf4j.Microservice
from bundle(org.wso2.carbon.uuf.httpconnector.msf4j:1.0.0.m13) to an
already activated startup listener component wso2-microservices-server in
bundle(msf4j-core:2.1.1). Refer the Startup Order Resolver documentation
and validated your configuration
[2017-03-09 12:44:44,860]  INFO
{org.wso2.carbon.uuf.httpconnector.msf4j.internal.MSF4JHttpConnector} - UUF
app 'org.wso2.carbon.apimgt.web.publisher' is available at '/publisher'.
[2017-03-09 12:44:44,861]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.uuf.httpconnector.msf4j.UUFMicroservice@2d9caac3
[2017-03-09 12:44:44,861]  INFO
{org.wso2.msf4j.internal.MicroservicesRegistryImpl} - Added microservice:
org.wso2.carbon.uuf.httpconnector.msf4j.UUFMicroservice@2d9caac3

Do we really need to create new micro service for each path? What's the
reason behind this?

Some of the services below can be combined to one, for example
org.wso2.carbon.apimgt.rest.api.publisher.ApisApi,
org.wso2.carbon.apimgt.rest.api.publisher.ApplicationsApi,
org.wso2.carbon.apimgt.rest.api.publisher.EndpointsApi,
org.wso2.carbon.apimgt.rest.api.publisher.EnvironmentsApi,
org.wso2.carbon.apimgt.rest.api.publisher.LabelsApi,
org.wso2.carbon.apimgt.rest.api.publisher.SubscriptionsApi can be combined
to one micro service, since they can be functionally categorized together
as publisher micro service.

org.wso2.carbon.apimgt.rest.api.store.ApisApi,
org.wso2.carbon.apimgt.rest.api.store.ApplicationsApi,
org.wso2.carbon.apimgt.rest.api.store.PoliciesApi,
org.wso2.carbon.apimgt.rest.api.store.SubscriptionsApi,
org.wso2.carbon.apimgt.rest.api.store.TagsApi can be combined to one micro
service, since they can be functionally categorized together as store micro
service.

Also, we need to eliminate micro service on which runs on HTTP and need to
have only HTTPs as default. If someone needs to serve through HTTP, they
can enable through a configuration.

Your responses are much appreciated.

-- 
Thanks
Abimaran Kugathasan
Senior Software Engineer - API Technologies

Email : [email protected]
Mobile : +94 773922820

<http://stackoverflow.com/users/515034>
<http://lk.linkedin.com/in/abimaran>  <http://www.lkabimaran.blogspot.com/>
<https://github.com/abimarank>  <https://twitter.com/abimaran>
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to