Hi,

we were seeing a slow Session.login in our full system, taking something 
between 10-15ms. IIUC, the usual goal was for it to be <1ms.

I then looked at the raw Oak benchmarks, and noticed that the LoginTest and 
LoginLogoutTest only login with the admin user, which AFAIU handled in a 
simpler way. Thus I added similar tests that test with a custom created user - 
see pull request at [1], I think these should definitely be added.

Then I noticed differences with the java versions, 1.6 is a lot slower than 
1.7. Here is the call:

$ java -jar target/oak-run-1.1-SNAPSHOT.jar benchmark LoginLogoutUserTest 
Oak-Tar

Results:

java 1.6
# LoginLogoutUserTest              C     min     10%     50%     90%     max    
   N
Oak-Tar                            1     884     884     993   25315   26367    
  11

java 1.7
# LoginLogoutUserTest              C     min     10%     50%     90%     max    
   N
Oak-Tar                            1     636     644     651     717     940    
  90

java 1.8
# LoginLogoutUserTest              C     min     10%     50%     90%     max    
   N
Oak-Tar                            1     633     643     650     685     747    
  92

(Was using 1.6 initially since that is still the default and most stable on Mac 
OSX)

Are those differences known?

One thing I noticed is that it seems to be memory dependent, with a difference 
of the default heap size between 128 MB on 1.6 vs. 4GB for 1.7/1.8 (according 
to "java -XX:+PrintFlagsFinal -version | grep MaxHeapSize").

The tests crashed on 1.6 easily with OutOfMemory once I set a concurrency of 5 
or more. 5 required more than 1 GB to run through. All the test itself does is 
create 1000 sessions, and these are logged out upon test teardown. Related, we 
saw a lot of garbage collection going on in a normal request performance test 
on our system (I don't know at the moment what java version was used there).

Can it be that Oak needs a lot of memory for new sessions (even if they don't 
need that much) and newer JVMs can handle that better (or just because of the 
larger default heap)?

[1] https://github.com/apache/jackrabbit-oak/pull/19

Cheers,
Alex

Reply via email to