SOLVED: performance issues with file I/O on dcm4chee, java7+ and mysql 5.5+

313 views
Skip to first unread message

Petr Kalina

unread,
Nov 25, 2015, 11:12:12 AM11/25/15
to dcm...@googlegroups.com
dear Community,

in case you are experiencing performance problems with the above mentioned platforms, it might be worthwhile to try these settings:

1) using the JMX console, in the storescp service mbean try seting the SyncFileBeforeCStoreRSP to False (and SyncFileAfterCStoreRSP to True). in my case this this prevented chee from flushing the files to disk after receiving every instance instead relying on the filesystem to do this work. interestingly, this resulted in massive performance improvement (see the code of the org.dcm4chex.archive.dcm.storescp.StoreSCP.storeToFile() function fro details on what's happening). it may be java7 related problem, however it is likely to be specific for my environment - ubuntu/raid10/ext3 - i didn't verify this.

2) in the my.cnf (or my.ini) use the innodb_flush_log_at_trx_commit=0 setting (you can also use the value =2 for an even faster performance - check out this thread for a short explanation of what this actually means - http://dba.stackexchange.com/questions/12611/is-it-safe-to-use-innodb-flush-log-at-trx-commit-2) for the innodb engine. again, this resulted in a massive bump in the prformance of the database writes being executed as part of storing new data. again, this may be mysql 5.5 specific, or it may be related to my environment.

you can read about the implications of using these settings in the chee and mysql documentation, for my particular deployment it's perfectly ok to use them, however for sure verify yours before doing this..

just for the record, anyone struggling with this, the visualvm profiler app that is part of jvm distribution as of java6 is a great start. in case you've hit this post and you need help setting the profiling, let me know. this post, however, is more or less all you need: http://hillert.blogspot.cz/2010/01/remote-profiling-of-jboss-using.html . for the web3 gui you just have to modify the used java_opts according to http://www.dcm4che.org/jira/browse/WEB-969 in order for it work while profiling.

best of luck, petr

Ivo

unread,
Feb 3, 2016, 11:45:18 AM2/3/16
to dcm4che
Dear Petr,

I am having trouble connecting visualvm to dcm4chee-2.18.1-psql on Ubuntu 14.04 (no iptables set).

I use oracle jdk 7u79 (installed under /opt/jdk1.7.0_79)

1. I created the policy file for jstatd

sudo vim /opt/jdk1.7.0_79/security/tools.policy

 

grant codebase "file:/opt/jdk1.7.0_79/lib/tools.jar" {

   permission java.security.AllPermission;

};


2. use following run.conf java parameters

  - '-server'
  - '-Xms256m'
  - '-Xmx1024m'
  - '-XX:MaxPermSize=512m'
  - '-Dsun.rmi.dgc.client.gcInterval=3600000'
  - '-Dsun.rmi.dgc.server.gcInterval=3600000'
  - '-Djboss.platform.mbeanserver'
  - '-Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl'
  - '-Dcom.sun.management.jmxremote'
  - '-Dcom.sun.management.jmxremote.authenticate=false'
  - '-Dcom.sun.management.jmxremote.ssl=false'
  - '-Dcom.sun.management.jmxremote.port=12345'
  - '-Djava.rmi.server.hostname=192.168.1.100'

3. start jstatd

sudo /opt/jdk1.7.0_79/bin/jstatd -p 1099 -J-Djava.security.policy=/opt/jdk1.7.0_79/security/tools.policy -J-Djava.rmi.server.hostname=192.168.1.100

4. start dcm4chee

5. in visualvm

- add server 192.168.1.100 to visualvm
- add jmx connection 192.168.1.100:12345 and select "Do not require ssl connection"

I am unable to connect and get error message

"Cannot connect to 192.168.1.100:12345 using service:jmx:rmi:///jndi/rmi:192.168.1.100:123245/jmxrmi"

Also since I added the extra jvm parameters I see following error in server.log

javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
        at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:674)
        at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
        at javax.naming.InitialContext.init(InitialContext.java:242)
        at javax.naming.InitialContext.<init>(InitialContext.java:192)
        at org.dcm4chex.archive.mbean.JndiHelper.jndiLookup(JndiHelper.java:19)
        at org.dcm4chex.archive.mbean.FileSystemMgt2Service.fileSystemMgt2(FileSystemMgt2Service.java:878)
        at org.dcm4chex.archive.mbean.FileSystemMgt2Service.internalDeleteOrphanedPrivateFiles(FileSystemMgt2Service.java:851)
        at org.dcm4chex.archive.mbean.FileSystemMgt2Service.deleteOrphanedPrivateFiles(FileSystemMgt2Service.java:835)
        at org.dcm4chex.archive.mbean.FileSystemMgt2Service$2$1.run(FileSystemMgt2Service.java:324)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:274)
        at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:72)
        at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:61)
        at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:671)
        ... 9 more


I would very much appreciate your help on this :)
Ivo
Reply all
Reply to author
Forward
0 new messages