On the horizon user setting section there is an option called 'Items per page' that changes the number of items per page . 
It seems it does not work on security_groups page and on that page all of the security groups will be loaded and that causes a bad gateway error timeout on the browser .