i have project run nightly performance test. it's same test every night our website hit hundreds of concurrent "users" 3 hours. performance results end in 1 of 2 states - bad or good, , each state seems consistent itself. our database guy (oracle btw) noticed on days of bad performance have many, many more calls on days, of 1 query.
from analysis far think has hibernate choosing use/not use proxies, cannot understand direct hibernate on days , not on others. cause such erratic non-deterministic behaviour in hibernate? on hibernate 4.2.0, , spring. not using 2nd level cache. there no other applications on our servers.
the object causes call emitted @ end of long chain of object related via parent/child. working head of chain.
bad run, notice 4m executions of 9wu... query
run, notice 630k executions of 9wu... query
edit: not able reproduce in module. appears when have -xmx set low (28m), calls not there, @ xmx = 128m runs. tips on in hibernate can see why/how decide on if should proxy or not?
edit 2: not able reproduce consistently in module. work great 5 runs fail 3 work fail. every time running exact same unit test. appear n+1 problem, loads bunch of children through "select item0..." query, during run decides use query or doesn't discard entries between webservice calls. see can obfuscate objects , provide details. unfortunately tree stored in database, , uses inheritance discriminator.
it's hard, of course, why might happening. however, there resources out there optimizing performance in hibernate , debugging problems it.
in linked article author suggests best way diagnose performance issues using yourkit java profiler. if load , performance environment remote , can't run profiler locally you can attach 1 remotely. of course, running profiler has overhead might find perforance characteristics changed because have 1 attached. still, best bet tracking down going on.
other useful links:
http://java.dzone.com/articles/debugging-hibernate-generated http://jroller.com/jcarreira/date/20050223#hibernate_tips
Comments
Post a Comment