John Johnson wrote:
> > I have a server that is dedicated solely for running a single ruby
>
> > application. Is there a ruby configuration file that I can change to
> > help speed ruby up and take as much resources as it needs? Basically
> > make sure there is no memory limit, processing limit, and give it the
> > highest priority process as possible. Also is there anything else I
> > can do to get the most speed out of ruby?
>
> If you're using a UNIX like server, you might try running the process at a
> higher priority using the 'nice' command, or have the ruby program change
> it's priority before and after the critical section of code:
>
> #!/usr/bin/env ruby
>
> ruby_pid = $$
> ..
> %x{ renice -20 #{ ruby_pid } }
> # critical code
> %x{ renice 0 #{ ruby_pid } }
>
> Of course you'll have to run it as root to be able to change your priority
> higher (more negative) than 0.
>
> I would be interested to hear your results.
>
> Regards,
>   JJ

This topic has been addressed many, many times in this group. Do try
searching it and reviewing the prior posts - many were very helpful.
One thing I recently read in Enterprise Integration with Ruby was a
anicdote about an application that was generating tons of small,
intermediate objects/strings?  This caused a lot of garbage collection
overhead.  Storing the intermediate strings in an array so they
wouldn't be GC'd resulted in a dramatic performance improvement.  So,
you could consider how GC may or may not be effecting your application
and see if you can do likewise, since you say memory usage is no
option.  Also, in my personal experience, ALWAYS preallocting objects
whenever possible can have a not insignificant performance benefit, ie,
instance objects outside of loops that are used within the loop, rather
than instancing the object w/in the loop, where it is destroyed and
then reinstanced on each iteration. Also, have your run the profiler
over your app?  If not, it would be good to do so.

Ken