运行SonarQube 4.5.2 由高性能MS SQL 2012生产集群支持
为项目渲染仪表板大约需要15-25秒。
我启用了完整的调试日志记录,并在日志中找到了这些
17049ms GET /sonar/dashboard/index/69881?did=2
...
19891ms GET /sonar/dashboard/index/69881?did=2
...
19172ms GET /sonar/dashboard/index/69881?did=2
我无法在日志中看到任何花费不合理时间的SQL语句 但是,我发现了许多与此类似的声明
2015.01.14 14:36:50 INFO http-bio-10.230.49.59-9000-exec-8 web[sql] 219ms Executed SQL: SELECT * FROM [project_measures] WHERE (rule_priority is null and rule_id is null and characteristic_id is null and person_id is null and snapshot_id in (N'8469895',N'8469896',N'8469897',N'8469898',N'8469899',N'8469900',N'8469888',N'8469889',N'8469890',N'8469902',N'8469903',N'8469904',N'8469905',N'8469906',N'8469907',N'8469908',N'8469909',N'8469910',N'8469911',N'8469912',N'8469913',N'8469914',N'8469915',N'8469917',N'8469926',N'8469927',N'8469928',N'8469930',N'8469919',N'8469920',N'8469921',N'8469922',N'8469923',N'8469924',N'8469932',N'8469933',N'8469934',N'8469935',N'8469937',N'8469938',N'8469939',N'8469941',N'8469943',N'8469944',N'8469946',N'8469947',N'8469948',N'8469949',N'8469950',N'8469955',N'8469956',N'8469957',N'8469951',N'8469952',N'8469953',N'8470089',N'8470091',N'8470092',N'8470093',N'8470094',N'8470095',N'8470096',N'8470097',N'8470098',N'8470099',N'8470100',N'8470101',N'8470102',N'8470103',N'8470104',N'8470105',N'8470086',N'8470087',N'8466975',N'8466976',N'8466977',N'8466978',N'8466979',N'8470208',N'8470209',N'8470210',N'8470211',N'8470212',N'8470213',N'8470215',N'8470216',N'8470217',N'8470218',N'8470220',N'8470222',N'8470227',N'8470228',N'8470229',N'8470230',N'8470231',N'8470232',N'8470233',N'8470234',N'8470235',N'8470236',N'8470237',N'8470238',N'8470239',N'8470240',N'8470241',N'8470242',N'8470243',N'8470244',N'8470245',N'8470246',N'8470247',N'8470248',N'8470249',N'8470250',N'8470251',N'8470252',N'8470253',N'8470254',N'8470255',N'8470223',N'8470257',N'8470258',N'8470259',N'8470260',N'8470261',N'8470262',N'8470264',N'8470265',N'8470266',N'8470267',N'8470268',N'8470269',N'8470270',N'8470271',N'8470272',N'8470273',N'8470274',N'8470275',N'8470276',N'8470277',N'8470278',N'8470224',N'8470280',N'8470281',N'8470282',N'8470283',N'8470290',N'8470284',N'8470285',N'8470286',N'8470287',N'8470288',N'8470289',N'8470291',N'8470292',N'8470293',N'8470294',N'8470295',N'8470296',N'8470297',N'8470298',N'8470299',N'8470300',N'8470301',N'8470302',N'8470303',N'8470304',N'8470305',N'8470306',N'8470307',N'8470308',N'8470309',N'8470310',N'8470311',N'8470225',N'8470313',N'8470314',N'8470315',N'8470317',N'8470319',N'8470320',N'8470321',N'8470322',N'8470323',N'8470324',N'8470325',N'8470326',N'8470328',N'8470329',N'8470330',N'8470332',N'8470333',N'8470334',N'8470335',N'8470337',N'8470338',N'8470339',N'8470340',N'8470344',N'8470345',N'8470346',N'8470347',N'8470348',N'8470349',N'8470350',N'8470351',N'8470352',N'8470353',N'8470354',N'8470341',N'8470342',N'8470359',N'8470360',N'8470361',N'8470363',N'8470367',N'8470368',N'8470364',N'8470365',N'8470366',N'8470370',N'8470371',N'8470373',N'8470374',N'8470375',N'8470372',N'8470376',N'8470377',N'8470379',N'8470380',N'8470356',N'8470382',N'8470385',N'8470383',N'8470357',N'8470387',N'8470389',N'8470390',N'8470391',N'8470392',N'8470393',N'8470394',N'8470395',N'8470396',N'8470397',N'8470398',N'8470399',N'8470400',N'8470401',N'8470422',N'8470423',N'8470424',N'8470425',N'8470402',N'8470403',N'8470404',N'8470405',N'8470406',N'8470407',N'8470408',N'8470409',N'8470410',N'8470411',N'8470412',N'8470413',N'8470414',N'8470415',N'8470416',N'8470417',N'8470418',N'8470419',N'8470420',N'8470421',N'8470427',N'8470441',N'8470442',N'8470443',N'8470444',N'8470445',N'8470446',N'8470447',N'8470448',N'8470450',N'8470449',N'8470451',N'8470452',N'8470453',N'8470454',N'8470455',N'8470428',N'8470429',N'8470430',N'8470431',N'8470432',N'8470433',N'8470434',N'8470435',N'8470436',N'8470437',N'8470438',N'8470439',N'8470457',N'8470458',N'8470460',N'8470461',N'8470463',N'8470464',N'8470465',N'8470681',N'8470683',N'8470684',N'8470685',N'8470686',N'8470687',N'8470693',N'8470688',N'8470689',N'8470690',N'8470691',N'8470692',N'8470694',N'8470695',N'8470699',N'8470700',N'8470701',N'8470702',N'8470703',N'8470704',N'8470705',N'8470706',N'8470707',N'8470708',N'8470709',N'8470710',N'8470711',N'8470712',N'8470713',N'8470714',N'8470715',N'8470724',N'8470725',N'8470726',N'8470727',N'8470728',N'8470729',N'8470730',N'8470731',N'8470732',N'8470733',N'8470734',N'8470735',N'8470736',N'8470737',N'8470738',N'8470739',N'8470740',N'8470741',N'8470742',N'8470716',N'8470717',N'8470718',N'8470719',N'8470720',N'8470721',N'8470722',N'8470696',N'8470697',N'8470744',N'8470745',N'8470747',N'8470748',N'8470749',N'8470750',N'8470756',N'8470757',N'8470758',N'8470760',N'8470761',N'8470751',N'8470763',N'8470752',N'8470753',N'8470765',N'8470766',N'8470767',N'8470768',N'8470769',N'8470770',N'8470771',N'8470772',N'8470774',N'8470777',N'8470776',N'8470779',N'8470780',N'8470781',N'8470782',N'8470783',N'8470784',N'8470785',N'8470786',N'8470787',N'8470788',N'8470789',N'8470790',N'8470791',N'8470792',N'8470793',N'8470794',N'8470795',N'8470796',N'8470797',N'8470798',N'8470799',N'8470808',N'8470809',N'8470810',N'8470811',N'8470812',N'8470813',N'8470814',N'8470815',N'8470816',N'8470817',N'8470818',N'8470819',N'8470820',N'8470821',N'8470822',N'8470823',N'8470824',N'8470825',N'8470826',N'8470827',N'8470800',N'8470801',N'8470802',N'8470803',N'8470804',N'8470805',N'8470806',N'8470829',N'8470830',N'8470831',N'8470832',N'8470833',N'8470834',N'8470754',N'8470836',N'8470837',N'8470839',N'8470840',N'8470845',N'8470846',N'8470843',N'8470841',N'8468773',N'8468785',N'8468786',N'8468787',N'8468788',N'8468789',N'8468790',N'8468791',N'8468774',N'8468775',N'8468776',N'8468777',N'8468778',N'8468779',N'8468780',N'8468781',N'8468782',N'8468783',N'8468793',N'8468794',N'8468795',N'8468797',N'8468798',N'8468799',N'8468800',N'8468801',N'8468802',N'8468803',N'8468804',N'8468805',N'8471049',N'8471050',N'8471051',N'8471052',N'8471053',N'8471054',N'8471055',N'8471056',N'8471057',N'8471059',N'8471060',N'8471061',N'8471062',N'8471063',N'8471064',N'8471065',N'8471066',N'8471067',N'8471068',N'8471069',N'8471070',N'8471071',N'8471072',N'8471073',N'8471074',N'8471075',N'8471076',N'8471077',N'8471078',N'8471079',N'8471080',N'8471081',N'8471082',N'8471083',N'8471084',N'8471085',N'8471086',N'8471087',N'8471088',N'8471089',N'8471090',N'8471091',N'8471092',N'8471094',N'8471095',N'8468848',N'8468849',N'8468859',N'8468860',N'8468861',N'8468862',N'8468863',N'8468864',N'8468865',N'8468866',N'8468867',N'8468868',N'8468869',N'8468870',N'8468851',N'8468852',N'8468853',N'8468854',N'8468855',N'8468856',N'8468857',N'8468872',N'8468878',N'8468879',N'8468880',N'8468881',N'8468882',N'8468883',N'8468884',N'8468885',N'8468886',N'8468887',N'8468888',N'8468898',N'8468899',N'8468900',N'8468901',N'8468902',N'8468903',N'8468904',N'8468905',N'8468906',N'8468907',N'8468908',N'8468909',N'8468910',N'8468911',N'8468912',N'8468913',N'8468914',N'8468915',N'8468916',N'8468889',N'8468890',N'8468891',N'8468892',N'8468893',N'8468894',N'8468895',N'8468896',N'8468918',N'8468919',N'8468920',N'8468921',N'8468922',N'8468925',N'8468926',N'8468927',N'8468928',N'8468929',N'8468930',N'8468923',N'8468934',N'8468932',N'8468936',N'8468937',N'8468873',N'8468874',N'8468939',N'8468940',N'8468941',N'8468942',N'8468943',N'8468944',N'8468945',N'8468947',N'8468948',N'8468956',N'8468957',N'8468958',N'8468959',N'8468960',N'8468961',N'8468962',N'8468963',N'8468949',N'8468950',N'8468951',N'8468952',N'8468953',N'8468954',N'8468875',N'8468876',N'8468965',N'8468845',N'8468967',N'8468968',N'8468969',N'8468970',N'8468971',N'8468972',N'8468974',N'8468846',N'8468976',N'8468977',N'8468978',N'8468979',N'8468980',N'8468984',N'8468981',N'8468982',N'8468983',N'8468985',N'8468987',N'8469162',N'8469165',N'8469166',N'8469167',N'8469168',N'8469169',N'8469171',N'8469172',N'8469175',N'8469174',N'8469176',N'8469177',N'8469178',N'8469179',N'8469181',N'8469182',N'8469183',N'8469185',N'8469186',N'8469188',N'8469190',N'8469163',N'8469192',N'8469193',N'8469194',N'8469195',N'8469196',N'8469197',N'8469198',N'8469203',N'8469204',N'8469205',N'8469206',N'8469207',N'8469208',N'8469209',N'8469210',N'8469211',N'8469212',N'8469199',N'8469200',N'8469201',N'8469214',N'8469215',N'8469216',N'8469217',N'8469219',N'8469221',N'8469222',N'8469224',N'8469226',N'8469236',N'8469237',N'8469239',N'8469230',N'8469241',N'8469231',N'8469232',N'8469243',N'8469244',N'8469246',N'8469247',N'8469248',N'8469249',N'8469250',N'8469251',N'8469252',N'8469233',N'8469234',N'8469227',N'8469254',N'8469228',N'8469256',N'8469258',N'8469260',N'8469262',N'8469264',N'8469265',N'8469279',N'8469280',N'8469281',N'8469282',N'8469283',N'8469284',N'8469266',N'8469267',N'8469268',N'8469269',N'8469270',N'8469271',N'8469272',N'8469273',N'8469274',N'8469275',N'8469276',N'8469277',N'8469286',N'8469287',N'8469288',N'8469289',N'8469291',N'8469293',N'8469294',N'8469295',N'8469296',N'8469297',N'8469298',N'8469299',N'8469300',N'8469301',N'8469302',N'8469303',N'8469304',N'8469305',N'8469306',N'8469307',N'8469308',N'8469309',N'8469310',N'8469337',N'8469338',N'8469339',N'8469340',N'8469341',N'8469342',N'8469343',N'8469344',N'8469345',N'8469346',N'8469347',N'8469348',N'8469349',N'8469350',N'8469351',N'8469353',N'8469352',N'8469354',N'8469355',N'8469356',N'8469357',N'8469358',N'8469359',N'8469360',N'8469361',N'8469362',N'8469363',N'8469364',N'8469365',N'8469366',N'8469367',N'8469368',N'8469369',N'8469370',N'8469371',N'8469372',N'8469373',N'8469374',N'8469375',N'8469376',N'8469377',N'8469311',N'8469312',N'8469313',N'8469314',N'8469315',N'8469316',N'8469317',N'8469318',N'8469319',N'8469320',N'8469321',N'8469322',N'8469323',N'8469324',N'8469325',N'8469326',N'8469327',N'8469328',N'8469329',N'8469330',N'8469331',N'8469332',N'8469333',N'8469334',N'8469335',N'8469379',N'8469380',N'8469382',N'8469383',N'8469384',N'8469385',N'8469386',N'8469387',N'8469388',N'8469389',N'8469390',N'8469391',N'8469392',N'8469393',N'8469394',N'8469395',N'8469396',N'8469397',N'8469398',N'8469399',N'8469400',N'8469401',N'8469402',N'8469403',N'8469404',N'8469406',N'8469407',N'8469408',N'8469409',N'8469410',N'8469411',N'8469412',N'8469413',N'8469414',N'8469415',N'8469416',N'8469417',N'8469418',N'8469419',N'8469420',N'8469422',N'8469421',N'8469423',N'8469424',N'8469425',N'8469426',N'8469427',N'8469429',N'8469430',N'8469431',N'8469432',N'8469433',N'8469434',N'8469435',N'8469436',N'8469437',N'8469438',N'8469439',N'8469440',N'8469442',N'8469444',N'8469456',N'8469457',N'8469458',N'8469459',N'8469460',N'8469461',N'8469462',N'8469463',N'8469464',N'8469446',N'8469447',N'8469448',N'8469449',N'8469450',N'8469451',N'8469452',N'8469453',N'8469454',N'8469481',N'8469466',N'8469467',N'8469468',N'8469469',N'8469470',N'8469471',N'8469472',N'8469473',N'8469474',N'8469475',N'8469476',N'8469477',N'8469478',N'8469479',N'8469480',N'8469483',N'8469484',N'8469485',N'8469486',N'8471004',N'8471005',N'8471006',N'8471007',N'8471008',N'8471019',N'8471020',N'8471021',N'8471022',N'8471023',N'8471009',N'8471010',N'8471011',N'8471012',N'8471013',N'8471025',N'8471026',N'8471014',N'8471016',N'8471015',N'8471017',N'8466575',N'8466576',N'8466577',N'8466578',N'8466579',N'8466580',N'8466581',N'8466582',N'8466584',N'8466585',N'8466587',N'8466589') and metric_id in (N'3',N'53',N'185'))
这导致我执行
select count(*) from sonar.snapshots
= 16003
我认为这是一个非常高的数字?
有趣的是,为一个新项目渲染仪表板(大约一个月的分析)需要花费一半的时间来分析一个项目 多年了
我们有大约20-30个项目,但只有少数项目非常活跃。 我只会说3-4个活跃的项目。 其余的只是每年分析大约5-10次,所以这些项目不应该真正累积快照。
团队中的开发人员对页面加载时间感到沮丧,因此非常感谢您对此进行调整的任何帮助!
对于所有历史记录,有没有办法清理Sonar DB?
更新
仪表板包含
我创建了一个更“专注”的仪表板,包含更少的小部件。 这使仪表板加载时间缩短了50%,降至10-11秒。 更好,但也很慢。 此仪表板的小部件是
对于较新的较小项目,加载时间从大约12秒减少到9秒,所以我没有看到性能翻倍。
答案 0 :(得分:2)
升级到5.0.1版时,性能问题已得到解决。