This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.mosaic.esa; | |
| import javassist.util.proxy.MethodHandler; | |
| import javassist.util.proxy.ProxyFactory; | |
| import javassist.util.proxy.ProxyObject; | |
| import net.sf.cglib.proxy.Enhancer; | |
| import net.sf.cglib.proxy.MethodInterceptor; | |
| import net.sf.cglib.proxy.MethodProxy; | |
| import org.junit.Test; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.*; | |
| import java.nio.*; | |
| import java.nio.channels.*; | |
| /** | |
| * Compares the performance of streaming data to disk vs using memory mapped files. | |
| *. | |
| public class MappedIO { | |
| private static int numOfInts = 4000000; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Use this when the Java 5 dir/* syntax does not work. This hit me using Gatling on Ubuntu recently. | |
| CLASSPATH="$(echo $GATLING_HOME/lib/*.jar | tr ' ' ':'):$GATLING_CONF:${JAVA_CLASSPATH}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- RSync server config ( /etc/zeebox/rsync.conf | |
| lock file = /var/run/rsync.lock | |
| log file = /var/log/rsyncd.log | |
| pid file = /var/run/rsyncd.pid | |
| [cache] | |
| path = /mnt/cache | |
| uid = tomcat | |
| gid = tomcat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Verification | |
| Check your system limits: | |
| $ cat /proc/sys/fs/file-max | |
| $ sysctl -a |grep fs.file-max | |
| To check the number of file descriptors used by any given process use | |
| $ ls -la /proc/<pid>/fd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| find . -maxdepth 1 -type f ! -name `*.gz` -exec gzip "{}" \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Native Compilation Options | |
| ----------------------- | |
| XX:+PrintCompilation Prints out when HotSpot stops the world to compile a method into native code | |
| -XX:CompileThreshold=1000 Sets the number of invocations required before a method will be considered for compilation. | |
| Trades off startup time and resources for speed. -client sets this to 1500, -server runs with 10,000 | |