Github user sudhansu7 commented on the pull request:

    https://github.com/apache/cloudstack/pull/897#issuecomment-152273822
  
    @remibergsma  @runseb 
    I have below performance analysis, which I did some time back. I trying to 
find out the dbdump to do a real test. But below analysis will may help to 
understand the issue and the solution.
    
    Clicking 'Network' tab invokes 3 api as mentioned below.
     
    
http://localhost:8080/client/api?command=listZones&response=json&sessionkey=1ddeSxQjc604bdnHJegYqkM6EgA%3D&networktype=Advanced&_=1436356355027
 -- 371ms
    this is to enable vpc, vpnCustomerGateway menu option.
     
    
http://localhost:8080/client/api?command=listNetworks&response=json&sessionkey=1ddeSxQjc604bdnHJegYqkM6EgA%3D&supportedServices=SecurityGroup&listAll=true&details=min&_=1436356355424
 -- 18.97s
    this is to enable securityGroups menu option. 
    
    
    
http://localhost:8080/client/api?command=listNetworks&response=json&sessionkey=1ddeSxQjc604bdnHJegYqkM6EgA%3D&listAll=true&page=1&pagesize=20&_=1436356374437
 -- 1.54s
    to list networks
     
    Second API call is taking 90% of the total response time.This api fetches 
all networks and interates over each network and for each network it makes an 
db call to fetch the services associated with the network. This is an expensive 
operation. 
     
    Solution: 
    
![image006](https://cloud.githubusercontent.com/assets/1062642/10827976/dbc6e066-7e97-11e5-8aec-09e0a84c1dc2.png)
    We can fetch listZones of type basic, if present then we can enable 
securityGroups menu option. For advanced zone with securitygroup service we can 
reuse first api call and can check "securitygroupsenabled" attribute in 
response. If present we will enable securityGroups menu option.
     
    
http://localhost:8080/client/api?command=listZones&response=json&sessionkey=JwxpVL74Wk6ZS7MvzSw0u6%2FA9eU%3D&networktype=Advanced&_=1436357831259
 --256ms
     
    
http://localhost:8080/client/api?command=listZones&response=json&sessionkey=JwxpVL74Wk6ZS7MvzSw0u6%2FA9eU%3D&networktype=Basic&_=1436357831901
 --11ms
     
    
http://localhost:8080/client/api?command=listNetworks&response=json&sessionkey=JwxpVL74Wk6ZS7MvzSw0u6%2FA9eU%3D&listAll=true&page=1&pagesize=20&_=1436357831968
 --868s
     
    total : 1.19s
    
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to