- 
    
Incident report
 - 
    Resolution: Fixed
 - 
    
Major
 - 
    1.8.13rc1
 - 
    MySQL on SSD Vertex 3, nginx with php-fpm.
 
For example we have:
hosts - 254
items - 131523
triggers - 13537
functions - 26007
graphs - 82893
graphs_items - 495851
groups - 11
hosts_groups - 554
rights - 3
screens - 899
screens_items - 16182
trigger_depends -  0
users_groups - 4
usrgrs - 20
Web-interface spent about 1 sec for SQL queries, but screens page opened very slow (about 120 seconds). See debug.log.
I found source code block where web-interface spent this time (CScreen->get()). It is comparing two hashes for excluding unavailable graphs for this user:
// graph
                        foreach($restr_graphs as $resourceid){
                                foreach($screens_items as $screen_itemid => $screen_item){
                                        if(($screen_item['resourceid'] == $resourceid) && ($screen_item['resourcetype'] == SCREEN_RESOURCE_GRAPH))
                                }
                        }
I suppose this problem might happen for other screen elements too. For example, simple graphs.
Mysql dump for test lab is available.