Because this question is still relevant, I should like to point out that if you're running on Java <8, then one reason you might get very slow start times on Linux (and perhaps Solaris as well) is because the Oracle JVM on those platforms has a bug with regard to where it is gettings its random numbers.
Even if told to get its random numbers from /dev/urandom, it won't (at least, not entirely?). If you get it to read from /dev/./urandom, which is the same, but doesn't match the internal broken logic, then you may well find that Java starts much faster (particularly in J2EE middleware environments).
http://bugs.java.com/view_bug.do?bug_id=6521844
That said, even with Java 8, logstash --configtest is still super slow to launch; this is likely due to the fact that a 64-bit JVM in server mode will do a lot of work on optimizing at startup (even then, I suspect JRuby is doing a lot of Ruby-related things).
The JRuby wiki has a document about other startup performance improvements (https://github.com/jruby/jruby/wiki/Improving-startup-time), but not very applicable to getting logstash much faster. I could get startup time for 'logstash --configtest' down to about 8 seconds with this:
[root@node-2 ~]# DEBUG=1 /opt/logstash/bin/logstash help
DEBUG: exec /opt/logstash/vendor/jruby/bin/jruby --1.9 -J-XX:+UseParNewGC -J-XX:+UseConcMarkSweepGC -J-Djava.awt.headless=true -J-XX:CMSInitiatingOccupancyFraction=75 -J-XX:+UseCMSInitiatingOccupancyOnly -J-XX:+HeapDumpOnOutOfMemoryError -J-Xmx1g -J-XX:HeapDumpPath=/opt/logstash/heapdump.hprof /opt/logstash/lib/bootstrap/environment.rb logstash/runner.rb help
Take the command it will exec, remove all the java options, and replace with --dev
[root@node-2 ~]# time /opt/logstash/vendor/jruby/bin/jruby /opt/logstash/lib/bootstrap/environment.rb logstash/runner.rb agent --configtest --config /etc/logstash/logstash-submission.conf
Configuration OK
real 0m13.367s
user 0m12.966s
sys 0m0.321s
[root@node-2 ~]# time /opt/logstash/vendor/jruby/bin/jruby --dev /opt/logstash/lib/bootstrap/environment.rb logstash/runner.rb agent --configtest --config /etc/logstash/logstash-submission.conf
Configuration OK
real 0m6.954s
user 0m6.629s
sys 0m0.286s
7 seconds still ain't great, but its better than 14 or so. 7 seconds is around the sweet spot for a sip of coffee, so avoids the awkward middle of your test finishing before your sip is complete. B^)
A simple alias may be a useful quick win:
alias logstash-configtest="/opt/logstash/vendor/jruby/bin/jruby --dev /opt/logstash/lib/bootstrap/environment.rb logstash/runner.rb agent --configtest"
I believe you can also run logstash with the USE_RUBY=1 flag to use the 'ruby' instead of the vendored jruby -- you wouldn't do this for running logstash normally, but it might be useful for --configtest if you want to use it frequently. -- you do need to make sure you have all the various Ruby modules, and then you'd have a version skew between your native ruby and the vendored jruby... But perhaps a Ruby buff could take this idea and run with it.